Ex Deorum 1.12

This commit is contained in:
thedarkcolour 2023-12-31 14:23:17 -08:00
parent 20b7846177
commit 2678b2893c
6 changed files with 36 additions and 9 deletions

View File

@ -5,7 +5,7 @@ plugins {
id 'org.spongepowered.mixin' version '0.7.+'
}
version = '1.11'
version = '1.12'
group = 'thedarkcolour.exdeorum'
base {
archivesName = 'exdeorum'

View File

@ -1,3 +1,7 @@
## Ex Deorum 1.12
- Fixed dupe bug with fluid mixing recipes
- Fixed bug where every fluid would appear as lava in a barrel
## Ex Deorum 1.11
- Added support for NuclearCraft: Neoteric - Boron, Thorium, Lithium, and Magnesium ores
- Fixed bug where hoppers and other automation could not craft fluid mixing recipes in the barrel (ex. Water and Lava to make Obsidian)

View File

@ -74,6 +74,8 @@ public class BarrelBlockEntity extends EBlockEntity {
public short compost;
// compost colors
public short r, g, b;
// used to avoid obsidian dupe
private boolean isBeingFilledByPlayer;
public BarrelBlockEntity(BlockPos pos, BlockState state) {
super(EBlockEntities.BARREL.get(), pos, state);
@ -183,7 +185,12 @@ public class BarrelBlockEntity extends EBlockEntity {
if (hasNoSolids()) {
var wasBurning = isBurning();
if (FluidUtil.interactWithFluidHandler(player, hand, tank)) {
this.isBeingFilledByPlayer = true;
if (FluidUtil.interactWithFluidHandler(player, hand, this.tank)) {
this.isBeingFilledByPlayer = false;
tryInWorldFluidMixing();
// If the item is a fluid handler, try to transfer fluids
if (wasBurning && !isHotFluid(tank.getFluid().getFluid().getFluidType())) {
progress = 0.0f;
@ -191,6 +198,7 @@ public class BarrelBlockEntity extends EBlockEntity {
return InteractionResult.sidedSuccess(level.isClientSide);
} else {
this.isBeingFilledByPlayer = false;
// try one more time to transfer fluids between item and barrel
var playerItem = player.getItemInHand(hand);
if (EConfig.SERVER.allowWaterBottleTransfer.get()) {
@ -222,7 +230,7 @@ public class BarrelBlockEntity extends EBlockEntity {
if (itemFluidCap.isPresent()) {
var fluidInTank = itemFluidCap.get().getFluidInTank(0);
if (fluidInTank.getAmount() >= 1000) {
if (tank.getFluidAmount() >= 1000) {
if (!level.isClientSide) {
tryFluidMixing(fluidInTank.getFluid());
}
@ -560,7 +568,9 @@ public class BarrelBlockEntity extends EBlockEntity {
@Override
protected void onContentsChanged() {
BarrelBlockEntity.this.tryInWorldFluidMixing();
if (!BarrelBlockEntity.this.isBeingFilledByPlayer) {
BarrelBlockEntity.this.tryInWorldFluidMixing();
}
}
}
}

View File

@ -69,7 +69,7 @@ public class BarrelRenderer implements BlockEntityRenderer<BarrelBlockEntity> {
var fluidStack = tank.getFluidInTank(0);
if (!fluidStack.isEmpty()) { // Get texture
var fluid = Fluids.LAVA;//fluidStack.getFluid();
var fluid = fluidStack.getFluid();
var level = barrel.getLevel();
var pos = barrel.getBlockPos();
var percentage = fluidStack.getAmount() / 1000.0f;

View File

@ -21,6 +21,7 @@ package thedarkcolour.exdeorum.data.recipe;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
@ -272,6 +273,15 @@ public class Recipes {
recipe.pattern("SES");
recipe.pattern("CCC");
});
recipes.shapedCrafting(RecipeCategory.BUILDING_BLOCKS, Items.SPONGE, recipe -> {
recipe.define('S', Blocks.SLIME_BLOCK);
recipe.define('W', ItemTags.WOOL);
recipe.define('C', EItems.WOOD_CHIPPINGS);
recipe.pattern("WCW");
recipe.pattern("CSC");
recipe.pattern("WCW");
MKRecipeProvider.unlockedByHaving(recipe, EItems.WOOD_CHIPPINGS.get());
});
}
private static void modUShaped(MKRecipeProvider recipes, String modid, RegistryObject<? extends Item> sides, RegistryObject<? extends Item> middle, RegistryObject<? extends Item> result) {
@ -286,17 +296,17 @@ public class Recipes {
});
}
// todo wtf does this do? why is it using a MutableObject
private static void grid2x2TagResult(Consumer<FinishedRecipe> writer, MKRecipeProvider recipes, TagKey<Item> resultTag, Ingredient ingredient) {
var ref = new MutableObject<FinishedRecipe>();
recipes.pushWriter(ref::setValue, newWriter -> {
// capture the generated recipe and wrap it in a TagResultRecipe
var wrappedRecipe = new MutableObject<FinishedRecipe>();
recipes.pushWriter(wrappedRecipe::setValue, newWriter -> {
recipes.shapedCrafting(resultTag.location().getPath() + "_tag", RecipeCategory.MISC, Items.AIR, recipe -> {
recipe.define('#', ingredient);
recipe.pattern("##");
recipe.pattern("##");
});
});
writer.accept(new TagResultRecipe.Finished(resultTag, ref.getValue()));
writer.accept(new TagResultRecipe.Finished(resultTag, wrappedRecipe.getValue()));
}
private static void shapedCrook(MKRecipeProvider recipes, RegistryObject<? extends Item> crook, Ingredient stick) {
@ -425,6 +435,7 @@ public class Recipes {
hammerRecipe(writer, "stone_pebbles", ingredient(Items.STONE, Items.STONE_BRICKS, Items.CHISELED_STONE_BRICKS, Items.CRACKED_STONE_BRICKS), EItems.STONE_PEBBLE.get(), new UniformGenerator(ConstantValue.exactly(1), ConstantValue.exactly(6)));
hammerRecipe(writer, "basalt", ingredient(Items.POLISHED_BASALT, Items.SMOOTH_BASALT), Items.BASALT);
hammerRecipe(writer, "wood_chippings", ingredient(BlockTags.LOGS), EItems.WOOD_CHIPPINGS.get(), new UniformGenerator(ConstantValue.exactly(3), ConstantValue.exactly(8)));
hammerRecipe(writer, "tube_coral", ingredient(Items.TUBE_CORAL_BLOCK), Items.TUBE_CORAL);
hammerRecipe(writer, "brain_coral", ingredient(Items.BRAIN_CORAL_BLOCK), Items.BRAIN_CORAL);
@ -485,6 +496,7 @@ public class Recipes {
barrelCompost(writer, "spore_blossom", ingredient(Items.SPORE_BLOSSOM), 125);
barrelCompost(writer, "weeping_vines", ingredient(Items.WEEPING_VINES), 100);
barrelCompost(writer, "twisting_vines", ingredient(Items.TWISTING_VINES), 100);
barrelCompost(writer, "wood_chippings", ingredient(EItems.WOOD_CHIPPINGS), 125);
// flesh
barrelCompost(writer, "rotten_flesh", ingredient(Items.ROTTEN_FLESH), 100);
barrelCompost(writer, "spider_eye", ingredient(Items.SPIDER_EYE), 80);

View File

@ -117,6 +117,7 @@ public class EItems {
public static final RegistryObject<Item> SCULK_CORE = ITEMS.register("sculk_core", () -> new SculkCoreItem(props().stacksTo(1)));
public static final RegistryObject<Item> RANDOM_POTTERY_SHERD = ITEMS.register("random_pottery_sherd", () -> new RandomResultItem.RandomSherd(props()));
public static final RegistryObject<Item> RANDOM_ARMOR_TRIM = ITEMS.register("random_armor_trim", () -> new RandomResultItem.RandomSandyArmorTrim(props()));
public static final RegistryObject<Item> WOOD_CHIPPINGS = registerSimpleItem("wood_chippings");
// Buckets
public static final RegistryObject<Item> UNFIRED_PORCELAIN_BUCKET = registerSimpleItem("unfired_porcelain_bucket");