diff --git a/build.gradle b/build.gradle index 851e6531..b88a9630 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ plugins { id 'org.spongepowered.mixin' version '0.7.+' } -version = '1.11' +version = '1.12' group = 'thedarkcolour.exdeorum' base { archivesName = 'exdeorum' diff --git a/changelog.md b/changelog.md index a0a8369f..ea9240b0 100644 --- a/changelog.md +++ b/changelog.md @@ -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) diff --git a/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java b/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java index cc7f56b4..167780e5 100644 --- a/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java +++ b/src/main/java/thedarkcolour/exdeorum/blockentity/BarrelBlockEntity.java @@ -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(); + } } } } diff --git a/src/main/java/thedarkcolour/exdeorum/client/ter/BarrelRenderer.java b/src/main/java/thedarkcolour/exdeorum/client/ter/BarrelRenderer.java index 996ff866..0aeba22d 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/ter/BarrelRenderer.java +++ b/src/main/java/thedarkcolour/exdeorum/client/ter/BarrelRenderer.java @@ -69,7 +69,7 @@ public class BarrelRenderer implements BlockEntityRenderer { 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; diff --git a/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java b/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java index e0cef55e..0a794d22 100644 --- a/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java +++ b/src/main/java/thedarkcolour/exdeorum/data/recipe/Recipes.java @@ -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 sides, RegistryObject middle, RegistryObject result) { @@ -286,17 +296,17 @@ public class Recipes { }); } - // todo wtf does this do? why is it using a MutableObject private static void grid2x2TagResult(Consumer writer, MKRecipeProvider recipes, TagKey resultTag, Ingredient ingredient) { - var ref = new MutableObject(); - recipes.pushWriter(ref::setValue, newWriter -> { + // capture the generated recipe and wrap it in a TagResultRecipe + var wrappedRecipe = new MutableObject(); + 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 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); diff --git a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java index 032c3baf..1d6045bb 100644 --- a/src/main/java/thedarkcolour/exdeorum/registry/EItems.java +++ b/src/main/java/thedarkcolour/exdeorum/registry/EItems.java @@ -117,6 +117,7 @@ public class EItems { public static final RegistryObject SCULK_CORE = ITEMS.register("sculk_core", () -> new SculkCoreItem(props().stacksTo(1))); public static final RegistryObject RANDOM_POTTERY_SHERD = ITEMS.register("random_pottery_sherd", () -> new RandomResultItem.RandomSherd(props())); public static final RegistryObject RANDOM_ARMOR_TRIM = ITEMS.register("random_armor_trim", () -> new RandomResultItem.RandomSandyArmorTrim(props())); + public static final RegistryObject WOOD_CHIPPINGS = registerSimpleItem("wood_chippings"); // Buckets public static final RegistryObject UNFIRED_PORCELAIN_BUCKET = registerSimpleItem("unfired_porcelain_bucket");