From a73919357bf7a945cfd47f2da2f2f62e1f9434d8 Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Fri, 10 Jul 2020 13:48:59 +0200 Subject: [PATCH 1/4] fluid reading for the processing recipes and its serializer --- .../com/simibubi/create/AllRecipeTypes.java | 23 ++--- .../create/compat/jei/ConversionRecipe.java | 19 ++-- .../jei/category/CreateRecipeCategory.java | 4 +- .../compat/jei/category/CrushingCategory.java | 4 +- .../compat/jei/category/MillingCategory.java | 2 +- .../MysteriousItemConversionCategory.java | 2 +- .../jei/category/PolishingCategory.java | 2 +- .../compat/jei/category/PressingCategory.java | 4 +- .../compat/jei/category/SawingCategory.java | 4 +- .../jei/category/SplashingCategory.java | 2 +- .../crusher/AbstractCrushingRecipe.java | 2 +- .../components/crusher/CrushingRecipe.java | 9 +- .../CrushingWheelControllerTileEntity.java | 2 +- .../components/fan/SplashingRecipe.java | 12 ++- .../components/millstone/MillingRecipe.java | 12 ++- .../millstone/MillstoneTileEntity.java | 2 +- .../mixer/MechanicalMixerTileEntity.java | 68 ++++++++----- .../components/mixer/MixingRecipe.java | 42 ++++++-- .../press/MechanicalPressTileEntity.java | 7 +- .../components/press/PressingRecipe.java | 13 ++- .../components/saw/CuttingRecipe.java | 12 ++- .../components/saw/SawTileEntity.java | 2 +- .../fluids/CombinedFluidHandler.java | 12 +-- .../processing/BasinOperatingTileEntity.java | 4 +- .../processing/BasinTileEntity.java | 12 ++- ...peList.java => CombinedItemFluidList.java} | 22 +++-- .../processing/ProcessingOutput.java | 6 +- .../processing/ProcessingRecipe.java | 65 +++++++++--- .../ProcessingRecipeSerializer.java | 99 +++++++++++++++---- .../curiosities/tools/SandPaperItem.java | 7 +- .../tools/SandPaperPolishingRecipe.java | 21 ++-- .../content/logistics/InWorldProcessing.java | 2 +- 32 files changed, 349 insertions(+), 150 deletions(-) rename src/main/java/com/simibubi/create/content/contraptions/processing/{MultiIngredientTypeList.java => CombinedItemFluidList.java} (50%) diff --git a/src/main/java/com/simibubi/create/AllRecipeTypes.java b/src/main/java/com/simibubi/create/AllRecipeTypes.java index 87fcec136..28c52641a 100644 --- a/src/main/java/com/simibubi/create/AllRecipeTypes.java +++ b/src/main/java/com/simibubi/create/AllRecipeTypes.java @@ -49,30 +49,31 @@ public enum AllRecipeTypes { public > T getType() { return (T) type; } - - private AllRecipeTypes(Supplier> supplier) { + + AllRecipeTypes(Supplier> supplier) { this(supplier, null); } - private AllRecipeTypes(Supplier> supplier, - IRecipeType> existingType) { + AllRecipeTypes(Supplier> supplier, + IRecipeType> existingType) { this.supplier = supplier; this.type = existingType; } public static void register(RegistryEvent.Register> event) { ShapedRecipe.setCraftingSize(9, 9); - + for (AllRecipeTypes r : AllRecipeTypes.values()) { if (r.type == null) r.type = customType(Lang.asId(r.name())); - + r.serializer = r.supplier.get(); ResourceLocation location = new ResourceLocation(Create.ID, Lang.asId(r.name())); - event.getRegistry().register(r.serializer.setRegistryName(location)); + event.getRegistry() + .register(r.serializer.setRegistryName(location)); } } - + private static > IRecipeType customType(String id) { return Registry.register(Registry.RECIPE_TYPE, new ResourceLocation(Create.ID, id), new IRecipeType() { public String toString() { @@ -80,10 +81,10 @@ public enum AllRecipeTypes { } }); } - - private static Supplier> processingSerializer(IRecipeFactory> factory) { + + private static Supplier> processingSerializer( + IRecipeFactory> factory) { return () -> new ProcessingRecipeSerializer<>(factory); } - } diff --git a/src/main/java/com/simibubi/create/compat/jei/ConversionRecipe.java b/src/main/java/com/simibubi/create/compat/jei/ConversionRecipe.java index 069783c75..fe21c60d6 100644 --- a/src/main/java/com/simibubi/create/compat/jei/ConversionRecipe.java +++ b/src/main/java/com/simibubi/create/compat/jei/ConversionRecipe.java @@ -1,8 +1,11 @@ package com.simibubi.create.compat.jei; -import java.util.Arrays; +import java.util.Collections; import java.util.List; +import javax.annotation.Nullable; +import javax.annotation.ParametersAreNonnullByDefault; + import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.Create; import com.simibubi.create.content.contraptions.processing.ProcessingIngredient; @@ -13,6 +16,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.items.wrapper.RecipeWrapper; /** @@ -21,24 +25,27 @@ import net.minecraftforge.items.wrapper.RecipeWrapper; * @author simibubi * */ +@ParametersAreNonnullByDefault public class ConversionRecipe extends ProcessingRecipe { public ConversionRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration) { + List results, int processingDuration, @Nullable List fluidIngredients, + @Nullable List fluidResults) { super(AllRecipeTypes.CONVERSION, id, group, ingredients, results, processingDuration); } static int counter = 0; public static ConversionRecipe create(ItemStack from, ItemStack to) { - List ingredients = Arrays.asList(new ProcessingIngredient(Ingredient.fromStacks(from))); - List outputs = Arrays.asList(new ProcessingOutput(to, 1)); + List ingredients = + Collections.singletonList(new ProcessingIngredient(Ingredient.fromStacks(from))); + List outputs = Collections.singletonList(new ProcessingOutput(to, 1)); return new ConversionRecipe(new ResourceLocation(Create.ID, "conversion_" + counter++), ingredients, outputs); } public ConversionRecipe(ResourceLocation id, List ingredients, - List results) { - this(id, "conversions", ingredients, results, -1); + List results) { + this(id, "conversions", ingredients, results, -1, null, null); } @Override diff --git a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java index 59e5a866d..832841461 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java @@ -59,10 +59,10 @@ public abstract class CreateRecipeCategory> implements IRec if (!(recipe instanceof ProcessingRecipe)) return jeiSlot; ProcessingRecipe processingRecipe = (ProcessingRecipe) recipe; - List rollableResults = processingRecipe.getRollableResults(); + List rollableResults = processingRecipe.getRollableItemResults(); if (rollableResults.size() <= index) return jeiSlot; - if (processingRecipe.getRollableResults().get(index).getChance() == 1) + if (processingRecipe.getRollableItemResults().get(index).getChance() == 1) return jeiSlot; return AllGuiTextures.JEI_CHANCE_SLOT; } diff --git a/src/main/java/com/simibubi/create/compat/jei/category/CrushingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/CrushingCategory.java index 5e95a3c2c..088456e68 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/CrushingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/CrushingCategory.java @@ -41,7 +41,7 @@ public class CrushingCategory extends CreateRecipeCategory results = recipe.getRollableResults(); + List results = recipe.getRollableItemResults(); int size = results.size(); int offset = -size * 19 / 2; for (int outputIndex = 0; outputIndex < size; outputIndex++) { @@ -54,7 +54,7 @@ public class CrushingCategory extends CreateRecipeCategory results = recipe.getRollableResults(); + List results = recipe.getRollableItemResults(); AllGuiTextures.JEI_SLOT.draw(50, 2); AllGuiTextures.JEI_DOWN_ARROW.draw(72, 7); diff --git a/src/main/java/com/simibubi/create/compat/jei/category/MillingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/MillingCategory.java index 90ddeacc8..79985ef23 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/MillingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/MillingCategory.java @@ -43,7 +43,7 @@ public class MillingCategory extends CreateRecipeCategory results = recipe.getRollableResults(); + List results = recipe.getRollableItemResults(); boolean single = results.size() == 1; for (int outputIndex = 0; outputIndex < results.size(); outputIndex++) { int xOffset = outputIndex % 2 == 0 ? 0 : 19; diff --git a/src/main/java/com/simibubi/create/compat/jei/category/MysteriousItemConversionCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/MysteriousItemConversionCategory.java index 42a1cdde0..36514730c 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/MysteriousItemConversionCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/MysteriousItemConversionCategory.java @@ -41,7 +41,7 @@ public class MysteriousItemConversionCategory extends CreateRecipeCategory results = recipe.getRollableResults(); + List results = recipe.getRollableItemResults(); itemStacks.init(0, true, 26, 16); itemStacks.set(0, Arrays.asList(recipe.getIngredients().get(0).getMatchingStacks())); itemStacks.init(1, false, 131, 16); diff --git a/src/main/java/com/simibubi/create/compat/jei/category/PolishingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/PolishingCategory.java index 3b3399f27..0fd563557 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/PolishingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/PolishingCategory.java @@ -43,7 +43,7 @@ public class PolishingCategory extends CreateRecipeCategory results = recipe.getRollableResults(); + List results = recipe.getRollableItemResults(); itemStacks.init(0, true, 26, 28); itemStacks.set(0, Arrays.asList(recipe.getIngredients().get(0).getMatchingStacks())); diff --git a/src/main/java/com/simibubi/create/compat/jei/category/PressingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/PressingCategory.java index f1260b4fd..b635f5625 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/PressingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/PressingCategory.java @@ -41,7 +41,7 @@ public class PressingCategory extends CreateRecipeCategory { itemStacks.init(0, true, 26, 50); itemStacks.set(0, Arrays.asList(recipe.getIngredients().get(0).getMatchingStacks())); - List results = recipe.getRollableResults(); + List results = recipe.getRollableItemResults(); for (int outputIndex = 0; outputIndex < results.size(); outputIndex++) { itemStacks.init(outputIndex + 1, false, 131 + 19 * outputIndex, 50); itemStacks.set(outputIndex + 1, results.get(outputIndex).getStack()); @@ -54,7 +54,7 @@ public class PressingCategory extends CreateRecipeCategory { public void draw(PressingRecipe recipe, double mouseX, double mouseY) { AllGuiTextures.JEI_SLOT.draw(26, 50); getRenderedSlot(recipe, 0).draw(131, 50); - if (recipe.getRollableResults().size() > 1) + if (recipe.getRollableItemResults().size() > 1) getRenderedSlot(recipe, 1).draw(131 + 19, 50); AllGuiTextures.JEI_SHADOW.draw(61, 41); AllGuiTextures.JEI_LONG_ARROW.draw(52, 54); diff --git a/src/main/java/com/simibubi/create/compat/jei/category/SawingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/SawingCategory.java index 52de5db32..c5b331f8c 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/SawingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/SawingCategory.java @@ -40,7 +40,7 @@ public class SawingCategory extends CreateRecipeCategory { itemStacks.init(0, true, 43, 4); itemStacks.set(0, Arrays.asList(recipe.getIngredients().get(0).getMatchingStacks())); - List results = recipe.getRollableResults(); + List results = recipe.getRollableItemResults(); for (int outputIndex = 0; outputIndex < results.size(); outputIndex++) { int xOffset = outputIndex % 2 == 0 ? 0 : 19; int yOffset = (outputIndex / 2) * -19; @@ -55,7 +55,7 @@ public class SawingCategory extends CreateRecipeCategory { @Override public void draw(CuttingRecipe recipe, double mouseX, double mouseY) { AllGuiTextures.JEI_SLOT.draw(43, 4); - int size = recipe.getRollableResults().size(); + int size = recipe.getRollableItemResults().size(); for (int i = 0; i < size; i++) { int xOffset = i % 2 == 0 ? 0 : 19; int yOffset = (i / 2) * -19; diff --git a/src/main/java/com/simibubi/create/compat/jei/category/SplashingCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/SplashingCategory.java index 9fe2eb3c6..89ca987c2 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/SplashingCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/SplashingCategory.java @@ -42,7 +42,7 @@ public class SplashingCategory extends ProcessingViaFanCategory .get(0) .getMatchingStacks())); - List results = recipe.getRollableResults(); + List results = recipe.getRollableItemResults(); boolean single = results.size() == 1; for (int outputIndex = 0; outputIndex < results.size(); outputIndex++) { int xOffset = outputIndex % 2 == 0 ? 0 : 19; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/AbstractCrushingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/AbstractCrushingRecipe.java index 2ee5d5f1d..bd99f7740 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/AbstractCrushingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/AbstractCrushingRecipe.java @@ -13,7 +13,7 @@ import net.minecraftforge.items.wrapper.RecipeWrapper; public abstract class AbstractCrushingRecipe extends ProcessingRecipe { public AbstractCrushingRecipe(AllRecipeTypes recipeType, ResourceLocation id, String group, - List ingredients, List results, int processingDuration) { + List ingredients, List results, int processingDuration) { super(recipeType, id, group, ingredients, results, processingDuration); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingRecipe.java index 9f77db133..407c0ad3b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingRecipe.java @@ -8,12 +8,14 @@ import com.simibubi.create.content.contraptions.processing.ProcessingOutput; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.items.wrapper.RecipeWrapper; public class CrushingRecipe extends AbstractCrushingRecipe { public CrushingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration) { + List results, int processingDuration, List fluidIngredients, + List fluidResults) { super(AllRecipeTypes.CRUSHING, id, group, ingredients, results, processingDuration); } @@ -21,9 +23,10 @@ public class CrushingRecipe extends AbstractCrushingRecipe { public boolean matches(RecipeWrapper inv, World worldIn) { if (inv.isEmpty()) return false; - return ingredients.get(0).test(inv.getStackInSlot(0)); + return ingredients.get(0) + .test(inv.getStackInSlot(0)); } - + @Override protected int getMaxOutputCount() { return 7; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java index 8141fcf36..3f5eeec54 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java @@ -191,7 +191,7 @@ public class CrushingWheelControllerTileEntity extends SmartTileEntity { inventory.clear(); for (int roll = 0; roll < rolls; roll++) { List rolledResults = recipe.get() - .rollResults(); + .rollResults().getItemStacks(); for (int i = 0; i < rolledResults.size(); i++) { ItemStack stack = rolledResults.get(i); ItemHelper.addToList(stack, list); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/SplashingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/SplashingRecipe.java index 47da85aa0..d873ae952 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/SplashingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/SplashingRecipe.java @@ -11,11 +11,16 @@ import com.simibubi.create.content.logistics.InWorldProcessing.SplashingInv; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; +import javax.annotation.ParametersAreNonnullByDefault; + +@ParametersAreNonnullByDefault public class SplashingRecipe extends ProcessingRecipe { public SplashingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration) { + List results, int processingDuration, List fluidIngredients, + List fluidResults) { super(AllRecipeTypes.SPLASHING, id, group, ingredients, results, processingDuration); } @@ -23,9 +28,10 @@ public class SplashingRecipe extends ProcessingRecipe ingredients, - List results, int processingDuration) { + List results, int processingDuration, List fluidIngredients, + List fluidResults) { super(AllRecipeTypes.MILLING, id, group, ingredients, results, processingDuration); } @@ -22,9 +27,10 @@ public class MillingRecipe extends AbstractCrushingRecipe { public boolean matches(RecipeWrapper inv, World worldIn) { if (inv.isEmpty()) return false; - return ingredients.get(0).test(inv.getStackInSlot(0)); + return ingredients.get(0) + .test(inv.getStackInSlot(0)); } - + @Override protected int getMaxOutputCount() { return 4; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java index bccc88d6d..434c6883c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java @@ -94,7 +94,7 @@ public class MillstoneTileEntity extends KineticTileEntity { ItemStack stackInSlot = inputInv.getStackInSlot(0); stackInSlot.shrink(1); inputInv.setStackInSlot(0, stackInSlot); - lastRecipe.rollResults().forEach(stack -> ItemHandlerHelper.insertItemStacked(outputInv, stack, false)); + lastRecipe.rollResults().forEachItemStack(stack -> ItemHandlerHelper.insertItemStacked(outputInv, stack, false)); sendData(); markDirty(); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java index 76cf705ef..af4bd4f79 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java @@ -1,14 +1,15 @@ package com.simibubi.create.content.contraptions.components.mixer; -import java.util.ArrayList; import java.util.Comparator; import java.util.LinkedList; import java.util.List; import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity; +import com.simibubi.create.content.contraptions.fluids.CombinedFluidHandler; import com.simibubi.create.content.contraptions.processing.BasinOperatingTileEntity; import com.simibubi.create.content.contraptions.processing.BasinTileEntity.BasinInventory; +import com.simibubi.create.content.contraptions.processing.CombinedItemFluidList; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform; import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour; @@ -29,7 +30,6 @@ import net.minecraft.util.NonNullList; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; -import net.minecraftforge.items.IItemHandler; public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { @@ -65,7 +65,7 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { } public float getRenderedHeadOffset(float partialTicks) { - int localTick = 0; + int localTick; float offset = 0; if (running) { if (runningTicks < 20) { @@ -154,26 +154,45 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { } public void renderParticles() { - IItemHandler itemHandler = basinItemInv.orElse(null); - BasinInventory inv = (BasinInventory) itemHandler; + if (world == null) + return; + basinItemInv.ifPresent(inv -> { + for (int slot = 0; slot < ((BasinInventory) inv).getInputHandler() + .getSlots(); slot++) { + ItemStack stackInSlot = inv.getStackInSlot(slot); + if (stackInSlot.isEmpty()) + continue; - for (int slot = 0; slot < inv.getInputHandler() - .getSlots(); slot++) { - ItemStack stackInSlot = itemHandler.getStackInSlot(slot); - if (stackInSlot.isEmpty()) - continue; + ItemParticleData data = new ItemParticleData(ParticleTypes.ITEM, stackInSlot); + float angle = world.rand.nextFloat() * 360; + Vec3d offset = new Vec3d(0, 0, 0.25f); + offset = VecHelper.rotate(offset, angle, Axis.Y); + Vec3d target = VecHelper.rotate(offset, getSpeed() > 0 ? 25 : -25, Axis.Y) + .add(0, .25f, 0); - ItemParticleData data = new ItemParticleData(ParticleTypes.ITEM, stackInSlot); - float angle = world.rand.nextFloat() * 360; - Vec3d offset = new Vec3d(0, 0, 0.25f); - offset = VecHelper.rotate(offset, angle, Axis.Y); - Vec3d target = VecHelper.rotate(offset, getSpeed() > 0 ? 25 : -25, Axis.Y) - .add(0, .25f, 0); + Vec3d center = offset.add(VecHelper.getCenterOf(pos)); + target = VecHelper.offsetRandomly(target.subtract(offset), world.rand, 1 / 128f); + world.addParticle(data, center.x, center.y - 2, center.z, target.x, target.y, target.z); + } + }); + + // Fluid Particles + /* + * basinFluidInv.ifPresent(fluidInv -> ((CombinedFluidHandler) + * fluidInv).forEachTank(fluidStack -> { if(fluidStack.isEmpty()) return; float + * angle = world.rand.nextFloat() * 360; Vec3d offset = new Vec3d(0, 0, 0.25f); + * offset = VecHelper.rotate(offset, angle, Axis.Y); Vec3d target = + * VecHelper.rotate(offset, getSpeed() > 0 ? 25 : -25, Axis.Y) .add(0, .25f, 0); + * + * Vec3d center = offset.add(VecHelper.getCenterOf(pos)); target = + * VecHelper.offsetRandomly(target.subtract(offset), world.rand, 1 / 128f); + * IParticleData data = new AirFlowParticleData(this.pos.down(2)); + * world.addParticle(data, center.x, center.y - 2, center.z, target.x, target.y, + * target.z); + * + * })); + */ - Vec3d center = offset.add(VecHelper.getCenterOf(pos)); - target = VecHelper.offsetRandomly(target.subtract(offset), world.rand, 1 / 128f); - world.addParticle(data, center.x, center.y - 2, center.z, target.x, target.y, target.z); - } } @Override @@ -195,14 +214,16 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { .allMatch(ingredient -> (ingredient.isSimple() || ingredient.getMatchingStacks().length == 1))) return false; - List remaining = new ArrayList<>(); + CombinedItemFluidList remaining = new CombinedItemFluidList(); inputs.forEachItemStack(stack -> remaining.add(stack.copy())); + basinFluidInv.ifPresent( + fluidInv -> ((CombinedFluidHandler) fluidInv).forEachTank(fluidStack -> remaining.add(fluidStack.copy()))); // sort by leniency List sortedIngredients = new LinkedList<>(ingredients); sortedIngredients.sort(Comparator.comparingInt(i -> i.getMatchingStacks().length)); Ingredients: for (Ingredient ingredient : sortedIngredients) { - for (ItemStack stack : remaining) { + for (ItemStack stack : remaining.getItemStacks()) { if (stack.isEmpty()) continue; if (ingredient.test(stack)) { @@ -212,6 +233,9 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { } return false; } + + if (!(recipe instanceof MixingRecipe)) + return true; return true; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java index 58ee10ff0..adfac18fd 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java @@ -1,10 +1,14 @@ package com.simibubi.create.content.contraptions.components.mixer; + import java.util.ArrayList; -import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; import java.util.LinkedList; import java.util.List; +import javax.annotation.Nonnull; + import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.contraptions.processing.BasinTileEntity.BasinInputInventory; import com.simibubi.create.content.contraptions.processing.ProcessingIngredient; @@ -17,36 +21,45 @@ import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; public class MixingRecipe extends ProcessingRecipe { public MixingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration) { + List results, int processingDuration) { super(AllRecipeTypes.MIXING, id, group, ingredients, results, processingDuration); } + public MixingRecipe(ResourceLocation id, String group, List ingredients, + List results, int processingDuration, List fluidIngredients, + List fluidResults) { + super(AllRecipeTypes.MIXING, id, group, ingredients, results, processingDuration, fluidIngredients, + fluidResults); + } + @Override protected int getMaxInputCount() { return 9; } - + @Override protected int getMaxOutputCount() { return 1; } - + @Override protected boolean canHaveCatalysts() { return true; } - + @Override - public boolean matches(BasinInputInventory inv, World worldIn) { + public boolean matches(BasinInputInventory inv, @Nonnull World worldIn) { if (inv.isEmpty()) return false; - NonNullList ingredients = getIngredients(); - if (!ingredients.stream().allMatch(Ingredient::isSimple)) + NonNullList ingredients = this.getIngredients(); + if (!ingredients.stream() + .allMatch(Ingredient::isSimple)) return false; List remaining = new ArrayList<>(); @@ -59,7 +72,7 @@ public class MixingRecipe extends ProcessingRecipe { // sort by leniency List sortedIngredients = new LinkedList<>(ingredients); - sortedIngredients.sort((i1, i2) -> i1.getMatchingStacks().length - i2.getMatchingStacks().length); + sortedIngredients.sort(Comparator.comparingInt(i -> i.getMatchingStacks().length)); Ingredients: for (Ingredient ingredient : sortedIngredients) { for (ItemStack stack : remaining) { if (stack.isEmpty()) @@ -76,7 +89,16 @@ public class MixingRecipe extends ProcessingRecipe { public static MixingRecipe of(IRecipe recipe) { return new MixingRecipe(recipe.getId(), recipe.getGroup(), ProcessingIngredient.list(recipe.getIngredients()), - Arrays.asList(new ProcessingOutput(recipe.getRecipeOutput(), 1)), -1); + Collections.singletonList(new ProcessingOutput(recipe.getRecipeOutput(), 1)), -1); } + @Override + protected boolean canHaveFluidIngredient() { + return true; + } + + @Override + protected boolean canHaveFluidOutput() { + return true; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java index e35e23ae7..94ffcfdd2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java @@ -6,8 +6,10 @@ import java.util.Optional; import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.AllSoundEvents; +import com.simibubi.create.content.contraptions.fluids.CombinedFluidHandler; import com.simibubi.create.content.contraptions.processing.BasinOperatingTileEntity; import com.simibubi.create.content.contraptions.processing.BasinTileEntity.BasinInventory; +import com.simibubi.create.content.contraptions.processing.CombinedItemFluidList; import com.simibubi.create.content.logistics.InWorldProcessing; import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.item.ItemHelper; @@ -297,11 +299,12 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity { .allMatch(Ingredient::isSimple)) return false; - List remaining = new ArrayList<>(); + CombinedItemFluidList remaining = new CombinedItemFluidList(); inputs.forEachItemStack(stack -> remaining.add(stack.copy())); + basinFluidInv.ifPresent(fluidInv -> ((CombinedFluidHandler) fluidInv).forEachTank(fluidStack -> remaining.add(fluidStack.copy()))); Ingredients: for (Ingredient ingredient : ingredients) { - for (ItemStack stack : remaining) { + for (ItemStack stack : remaining.getItemStacks()) { if (stack.isEmpty()) continue; if (ingredient.test(stack)) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/PressingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/PressingRecipe.java index c8efe3b34..a71395bc8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/PressingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/PressingRecipe.java @@ -10,11 +10,16 @@ import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; +import javax.annotation.ParametersAreNonnullByDefault; + +@ParametersAreNonnullByDefault public class PressingRecipe extends ProcessingRecipe { public PressingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration) { + List results, int processingDuration, List fluidIngredients, + List fluidResults) { super(AllRecipeTypes.PRESSING, id, group, ingredients, results, processingDuration); } @@ -22,12 +27,12 @@ public class PressingRecipe extends ProcessingRecipe { public CuttingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration) { + List results, int processingDuration, List fluidIngredients, + List fluidResults) { super(AllRecipeTypes.CUTTING, id, group, ingredients, results, processingDuration); } @@ -22,9 +27,10 @@ public class CuttingRecipe extends ProcessingRecipe { public boolean matches(RecipeWrapper inv, World worldIn) { if (inv.isEmpty()) return false; - return ingredients.get(0).test(inv.getStackInSlot(0)); + return ingredients.get(0) + .test(inv.getStackInSlot(0)); } - + @Override protected int getMaxOutputCount() { return 4; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java index 9fd313749..e127b162b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java @@ -248,7 +248,7 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity { for (int roll = 0; roll < rolls; roll++) { List results = new LinkedList(); if (recipe instanceof CuttingRecipe) - results = ((CuttingRecipe) recipe).rollResults(); + results = ((CuttingRecipe) recipe).rollResults().getItemStacks(); else if (recipe instanceof StonecuttingRecipe) results.add(recipe.getRecipeOutput() .copy()); diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/CombinedFluidHandler.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/CombinedFluidHandler.java index 8d62457ea..d7ae0d73b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/CombinedFluidHandler.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/CombinedFluidHandler.java @@ -1,6 +1,11 @@ package com.simibubi.create.content.contraptions.fluids; -import net.minecraft.fluid.Fluid; +import java.util.Arrays; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import javax.annotation.Nonnull; + import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.ListNBT; import net.minecraft.util.math.MathHelper; @@ -8,11 +13,6 @@ import net.minecraftforge.common.util.NonNullConsumer; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; -import javax.annotation.Nonnull; -import java.util.Arrays; -import java.util.stream.Collectors; -import java.util.stream.IntStream; - public class CombinedFluidHandler implements IFluidHandler { private final int capacity; private final FluidStack[] tanks; diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java index 492c3f106..18645dedd 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinOperatingTileEntity.java @@ -37,7 +37,7 @@ public abstract class BasinOperatingTileEntity extends KineticTileEntity { protected IRecipe lastRecipe; protected LazyOptional basinItemInv = LazyOptional.empty(); protected LazyOptional basinFluidInv = LazyOptional.empty(); - protected MultiIngredientTypeList inputs; + protected CombinedItemFluidList inputs; public BasinOperatingTileEntity(TileEntityType typeIn) { super(typeIn); @@ -59,7 +59,7 @@ public abstract class BasinOperatingTileEntity extends KineticTileEntity { } public void gatherInputs() { - inputs = new MultiIngredientTypeList(); + inputs = new CombinedItemFluidList(); basinItemInv.ifPresent(inv -> { IItemHandlerModifiable inputHandler = ((BasinInventory) inv).getInputHandler(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java index 78f4d7b95..f96fc6384 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java @@ -3,6 +3,8 @@ package com.simibubi.create.content.contraptions.processing; import java.util.List; import java.util.Optional; +import javax.annotation.Nonnull; + import com.simibubi.create.content.contraptions.fluids.CombinedFluidHandler; import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; @@ -10,6 +12,7 @@ import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputB import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; +import net.minecraft.nbt.ListNBT; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; @@ -24,8 +27,6 @@ import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.wrapper.CombinedInvWrapper; import net.minecraftforge.items.wrapper.RecipeWrapper; -import javax.annotation.Nonnull; - public class BasinTileEntity extends SmartTileEntity implements ITickableTileEntity { public boolean contentsChanged; @@ -121,7 +122,7 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt super.read(compound); inputItemInventory.deserializeNBT(compound.getCompound("InputItems")); outputItemInventory.deserializeNBT(compound.getCompound("OutputItems")); - if (compound.hasUniqueId("fluids")) + if (compound.contains("fluids")) fluidInventory .ifPresent(combinedFluidHandler -> combinedFluidHandler.readFromNBT(compound.getList("fluids", 10))); } @@ -131,7 +132,10 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt super.write(compound); compound.put("InputItems", inputItemInventory.serializeNBT()); compound.put("OutputItems", outputItemInventory.serializeNBT()); - fluidInventory.ifPresent(combinedFuidHandler -> compound.put("fluids", combinedFuidHandler.getListNBT())); + fluidInventory.ifPresent(combinedFuidHandler -> { + ListNBT nbt = combinedFuidHandler.getListNBT(); + compound.put("fluids", nbt); + }); return compound; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/MultiIngredientTypeList.java b/src/main/java/com/simibubi/create/content/contraptions/processing/CombinedItemFluidList.java similarity index 50% rename from src/main/java/com/simibubi/create/content/contraptions/processing/MultiIngredientTypeList.java rename to src/main/java/com/simibubi/create/content/contraptions/processing/CombinedItemFluidList.java index 1206bc283..f5eac96d6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/MultiIngredientTypeList.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/CombinedItemFluidList.java @@ -6,23 +6,31 @@ import net.minecraftforge.fluids.FluidStack; import java.util.ArrayList; import java.util.function.Consumer; -public class MultiIngredientTypeList { - private final ArrayList itemIngredients = new ArrayList<>(); - private final ArrayList fluidIngredients = new ArrayList<>(); +public class CombinedItemFluidList { + private final ArrayList itemStacks = new ArrayList<>(); + private final ArrayList fluidStacks = new ArrayList<>(); public void add(ItemStack itemstack) { - itemIngredients.add(itemstack); + itemStacks.add(itemstack); } public void add(FluidStack fluidStack) { - fluidIngredients.add(fluidStack); + fluidStacks.add(fluidStack); } public void forEachItemStack(Consumer itemStackConsumer) { - itemIngredients.forEach(itemStackConsumer); + itemStacks.forEach(itemStackConsumer); } public void forEachFluidStack(Consumer fluidStackConsumer) { - fluidIngredients.forEach(fluidStackConsumer); + fluidStacks.forEach(fluidStackConsumer); + } + + public ArrayList getItemStacks() { + return itemStacks; + } + + public ArrayList getFluidStacks() { + return fluidStacks; } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingOutput.java b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingOutput.java index aacc6d39c..186cf0b72 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingOutput.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingOutput.java @@ -7,9 +7,9 @@ import net.minecraft.network.PacketBuffer; public class ProcessingOutput { - private static Random r = new Random(); - private ItemStack stack; - private float chance; + private static final Random r = new Random(); + private final ItemStack stack; + private final float chance; public ProcessingOutput(ItemStack stack, float chance) { this.stack = stack; diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipe.java index ae665072a..8d93a2200 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipe.java @@ -1,12 +1,12 @@ package com.simibubi.create.content.contraptions.processing; -import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.Create; +import mcp.MethodsReturnNonnullByDefault; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; @@ -15,7 +15,13 @@ import net.minecraft.item.crafting.IRecipeType; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.NonNullList; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.FluidStack; +import javax.annotation.Nullable; +import javax.annotation.ParametersAreNonnullByDefault; + +@MethodsReturnNonnullByDefault +@ParametersAreNonnullByDefault public abstract class ProcessingRecipe implements IRecipe { protected final List ingredients; private final List results; @@ -24,9 +30,11 @@ public abstract class ProcessingRecipe implements IRecipe< protected final ResourceLocation id; protected final String group; protected final int processingDuration; + protected final List fluidIngredients; + protected final List fluidResults; public ProcessingRecipe(AllRecipeTypes recipeType, ResourceLocation id, String group, - List ingredients, List results, int processingDuration) { + List ingredients, List results, int processingDuration) { this.type = recipeType.type; this.serializer = recipeType.serializer; this.id = id; @@ -34,20 +42,37 @@ public abstract class ProcessingRecipe implements IRecipe< this.ingredients = ingredients; this.results = results; this.processingDuration = processingDuration; + this.fluidIngredients = null; + this.fluidResults = null; + validate(recipeType); + } + + public ProcessingRecipe(AllRecipeTypes recipeType, ResourceLocation id, String group, + List ingredients, List results, int processingDuration, + @Nullable List fluidIngredients, @Nullable List fluidResults) { + this.type = recipeType.type; + this.serializer = recipeType.serializer; + this.id = id; + this.group = group; + this.ingredients = ingredients; + this.results = results; + this.processingDuration = processingDuration; + this.fluidIngredients = fluidIngredients; + this.fluidResults = fluidResults; validate(recipeType); } private void validate(AllRecipeTypes recipeType) { if (ingredients.size() > getMaxInputCount()) Create.logger.warn("Your custom " + recipeType.name() + " recipe (" + id.toString() + ") has more inputs (" - + ingredients.size() + ") than supported (" + getMaxInputCount() + ")."); + + ingredients.size() + ") than supported (" + getMaxInputCount() + ")."); if (results.size() > getMaxOutputCount()) Create.logger.warn("Your custom " + recipeType.name() + " recipe (" + id.toString() + ") has more outputs (" - + results.size() + ") than supported (" + getMaxOutputCount() + ")."); + + results.size() + ") than supported (" + getMaxOutputCount() + ")."); ingredients.forEach(i -> { if (i.isCatalyst() && !canHaveCatalysts()) Create.logger.warn("Your custom " + recipeType.name() + " recipe (" + id.toString() - + ") has a catalyst ingredient, which act like a regular ingredient in this type."); + + ") has a catalyst ingredient, which act like a regular ingredient in this type."); }); } @@ -62,14 +87,14 @@ public abstract class ProcessingRecipe implements IRecipe< return processingDuration; } - public List rollResults() { - List stacks = new ArrayList<>(); - for (ProcessingOutput output : getRollableResults()) { + public CombinedItemFluidList rollResults() { + CombinedItemFluidList results = new CombinedItemFluidList(); + for (ProcessingOutput output : getRollableItemResults()) { ItemStack stack = output.rollOutput(); if (!stack.isEmpty()) - stacks.add(stack); + results.add(stack); } - return stacks; + return results; } @Override @@ -84,7 +109,9 @@ public abstract class ProcessingRecipe implements IRecipe< @Override public ItemStack getRecipeOutput() { - return getRollableResults().isEmpty() ? ItemStack.EMPTY : getRollableResults().get(0).getStack(); + return getRollableItemResults().isEmpty() ? ItemStack.EMPTY + : getRollableItemResults().get(0) + .getStack(); } @Override @@ -119,15 +146,25 @@ public abstract class ProcessingRecipe implements IRecipe< return false; } - public List getRollableResults() { + public List getRollableItemResults() { return results; } - + public List getRollableIngredients() { return ingredients; } public List getPossibleOutputs() { - return getRollableResults().stream().map(output -> output.getStack()).collect(Collectors.toList()); + return getRollableItemResults().stream() + .map(ProcessingOutput::getStack) + .collect(Collectors.toList()); + } + + protected boolean canHaveFluidIngredient() { + return false; + } + + protected boolean canHaveFluidOutput() { + return false; } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java index aff3b800f..a07dfb1e2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java @@ -6,15 +6,23 @@ import java.util.List; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import mcp.MethodsReturnNonnullByDefault; +import net.minecraft.fluid.Fluid; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipeSerializer; import net.minecraft.network.PacketBuffer; import net.minecraft.util.JSONUtils; import net.minecraft.util.ResourceLocation; import net.minecraft.util.registry.Registry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.registries.ForgeRegistries; +import javax.annotation.ParametersAreNonnullByDefault; + +@MethodsReturnNonnullByDefault +@ParametersAreNonnullByDefault public class ProcessingRecipeSerializer> - extends net.minecraftforge.registries.ForgeRegistryEntry> implements IRecipeSerializer { + extends net.minecraftforge.registries.ForgeRegistryEntry> implements IRecipeSerializer { protected final IRecipeFactory factory; @@ -27,32 +35,58 @@ public class ProcessingRecipeSerializer> String s = JSONUtils.getString(json, "group", ""); List ingredients = new ArrayList<>(); + List fluidIngredients = new ArrayList<>(); for (JsonElement e : JSONUtils.getJsonArray(json, "ingredients")) { - int count = 1; - if (JSONUtils.hasField((JsonObject) e, "count")) { - count = JSONUtils.getInt(e.getAsJsonObject().get("count"), "count"); - } - for(int i = 0; i < count; i++) { - ingredients.add(ProcessingIngredient.parse(e.getAsJsonObject())); + JsonObject entry = e.getAsJsonObject(); + if (JSONUtils.hasField(entry, "fluid")) { + Fluid fluid = ForgeRegistries.FLUIDS + .getValue(ResourceLocation.tryCreate(JSONUtils.getString(entry.get("fluid"), "fluid"))); + int amount = 1; + if (JSONUtils.hasField((JsonObject) e, "amount")) { + amount = JSONUtils.getInt(entry.get("amount"), "amount"); + } + if (fluid != null && amount > 0) + fluidIngredients.add(new FluidStack(fluid, amount)); + } else { + int count = 1; + if (JSONUtils.hasField((JsonObject) e, "count")) { + count = JSONUtils.getInt(entry.get("count"), "count"); + } + for (int i = 0; i < count; i++) { + ingredients.add(ProcessingIngredient.parse(entry)); + } } } List results = new ArrayList<>(); + List fluidResults = new ArrayList<>(); for (JsonElement e : JSONUtils.getJsonArray(json, "results")) { - String s1 = JSONUtils.getString(e.getAsJsonObject().get("item"), "item"); - int i = JSONUtils.getInt(e.getAsJsonObject().get("count"), "count"); - float chance = 1; - if (JSONUtils.hasField((JsonObject) e, "chance")) - chance = JSONUtils.getFloat(e.getAsJsonObject().get("chance"), "chance"); - ItemStack itemstack = new ItemStack(Registry.ITEM.getOrDefault(new ResourceLocation(s1)), i); - results.add(new ProcessingOutput(itemstack, chance)); + JsonObject entry = e.getAsJsonObject(); + if (JSONUtils.hasField(entry, "fluid")) { + Fluid fluid = ForgeRegistries.FLUIDS + .getValue(ResourceLocation.tryCreate(JSONUtils.getString(entry.get("fluid"), "fluid"))); + int amount = 1; + if (JSONUtils.hasField((JsonObject) e, "amount")) { + amount = JSONUtils.getInt(entry.get("amount"), "amount"); + } + if (fluid != null && amount > 0) + fluidResults.add(new FluidStack(fluid, amount)); + } else { + String s1 = JSONUtils.getString(entry.get("item"), "item"); + int i = JSONUtils.getInt(entry.get("count"), "count"); + float chance = 1; + if (JSONUtils.hasField((JsonObject) e, "chance")) + chance = JSONUtils.getFloat(entry.get("chance"), "chance"); + ItemStack itemstack = new ItemStack(Registry.ITEM.getOrDefault(new ResourceLocation(s1)), i); + results.add(new ProcessingOutput(itemstack, chance)); + } } int duration = -1; if (JSONUtils.hasField(json, "processingTime")) duration = JSONUtils.getInt(json, "processingTime"); - return this.factory.create(recipeId, s, ingredients, results, duration); + return this.factory.create(recipeId, s, ingredients, results, duration, fluidIngredients, fluidResults); } public T read(ResourceLocation recipeId, PacketBuffer buffer) { @@ -63,14 +97,24 @@ public class ProcessingRecipeSerializer> for (int i = 0; i < ingredientCount; i++) ingredients.add(ProcessingIngredient.parse(buffer)); + int fluidInputCount = buffer.readInt(); + List fluidIngredients = new ArrayList<>(); + for (int i = 0; i < fluidInputCount; i++) + fluidIngredients.add(FluidStack.readFromPacket(buffer)); + List results = new ArrayList<>(); int outputCount = buffer.readInt(); for (int i = 0; i < outputCount; i++) results.add(ProcessingOutput.read(buffer)); + int fluidOutputCount = buffer.readInt(); + List fluidResults = new ArrayList<>(); + for (int i = 0; i < fluidOutputCount; i++) + fluidResults.add(FluidStack.readFromPacket(buffer)); + int duration = buffer.readInt(); - return this.factory.create(recipeId, s, ingredients, results, duration); + return this.factory.create(recipeId, s, ingredients, results, duration, fluidIngredients, fluidResults); } public void write(PacketBuffer buffer, T recipe) { @@ -78,16 +122,31 @@ public class ProcessingRecipeSerializer> buffer.writeInt(recipe.ingredients.size()); recipe.ingredients.forEach(i -> i.write(buffer)); + if (recipe.canHaveFluidIngredient() && recipe.fluidIngredients != null) { + buffer.writeInt(recipe.fluidIngredients.size()); + recipe.fluidIngredients.forEach(fluidStack -> fluidStack.writeToPacket(buffer)); + } else { + buffer.writeInt(0); + } - buffer.writeInt(recipe.getRollableResults().size()); - recipe.getRollableResults().forEach(i -> i.write(buffer)); + buffer.writeInt(recipe.getRollableItemResults() + .size()); + recipe.getRollableItemResults() + .forEach(i -> i.write(buffer)); + if (recipe.canHaveFluidOutput() && recipe.fluidResults != null) { + buffer.writeInt(recipe.fluidResults.size()); + recipe.fluidResults.forEach(fluidStack -> fluidStack.writeToPacket(buffer)); + } else { + buffer.writeInt(0); + } buffer.writeInt(recipe.processingDuration); } public interface IRecipeFactory> { - T create(ResourceLocation id, String group, List ingredients, List results, - int duration); + T create(ResourceLocation recipeId, String s, List ingredients, + List results, int duration, List fluidIngredients, + List fluidResults); } } diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItem.java b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItem.java index c1c4c7f0f..d06c16b4c 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItem.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.curiosities.tools; import com.simibubi.create.foundation.utility.VecHelper; +import mcp.MethodsReturnNonnullByDefault; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.item.ItemEntity; @@ -24,6 +25,10 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; +import javax.annotation.ParametersAreNonnullByDefault; + +@MethodsReturnNonnullByDefault +@ParametersAreNonnullByDefault public class SandPaperItem extends Item { public SandPaperItem(Properties properties) { @@ -68,8 +73,6 @@ public class SandPaperItem extends Item { return FAIL; BlockRayTraceResult ray = (BlockRayTraceResult) raytraceresult; Vec3d hitVec = ray.getHitVec(); - if (hitVec == null) - return FAIL; AxisAlignedBB bb = new AxisAlignedBB(hitVec, hitVec).grow(1f); ItemEntity pickUp = null; diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java index b4e588e8a..b65e57c7e 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java @@ -10,19 +10,21 @@ import com.simibubi.create.content.curiosities.tools.SandPaperPolishingRecipe.Sa import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; -import net.minecraft.util.DamageSource; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.wrapper.RecipeWrapper; +import javax.annotation.ParametersAreNonnullByDefault; + +@ParametersAreNonnullByDefault public class SandPaperPolishingRecipe extends ProcessingRecipe { - public static DamageSource CURSED_POLISHING = new DamageSource("create.curse_polish").setExplosion(); - public SandPaperPolishingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration) { + List results, int processingDuration, List fluidIngredients, + List fluidResults) { super(AllRecipeTypes.SANDPAPER_POLISHING, id, group, ingredients, results, processingDuration); } @@ -33,18 +35,21 @@ public class SandPaperPolishingRecipe extends ProcessingRecipe { public static ItemStack applyPolish(World world, Vec3d position, ItemStack stack, ItemStack sandPaperStack) { List> matchingRecipes = getMatchingRecipes(world, stack); if (!matchingRecipes.isEmpty()) - return matchingRecipes.get(0).getCraftingResult(new SandPaperInv(stack)).copy(); + return matchingRecipes.get(0) + .getCraftingResult(new SandPaperInv(stack)) + .copy(); return stack; } @Override public boolean matches(SandPaperInv inv, World worldIn) { - return ingredients.get(0).test(inv.getStackInSlot(0)); + return ingredients.get(0) + .test(inv.getStackInSlot(0)); } public static List> getMatchingRecipes(World world, ItemStack stack) { - return world.getRecipeManager().getRecipes(AllRecipeTypes.SANDPAPER_POLISHING.getType(), new SandPaperInv(stack), - world); + return world.getRecipeManager() + .getRecipes(AllRecipeTypes.SANDPAPER_POLISHING.getType(), new SandPaperInv(stack), world); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/InWorldProcessing.java b/src/main/java/com/simibubi/create/content/logistics/InWorldProcessing.java index b2765dd7d..9aa814255 100644 --- a/src/main/java/com/simibubi/create/content/logistics/InWorldProcessing.java +++ b/src/main/java/com/simibubi/create/content/logistics/InWorldProcessing.java @@ -263,7 +263,7 @@ public class InWorldProcessing { if (recipe instanceof ProcessingRecipe) { stacks = new ArrayList<>(); for (int i = 0; i < stackIn.getCount(); i++) { - List rollResults = ((ProcessingRecipe) recipe).rollResults(); + List rollResults = ((ProcessingRecipe) recipe).rollResults().getItemStacks(); for (ItemStack stack : rollResults) { for (ItemStack previouslyRolled : stacks) { if (stack.isEmpty()) From 02450bd2f79ce4e1205ae977981d05c8261e0d41 Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Sat, 11 Jul 2020 16:18:17 +0200 Subject: [PATCH 2/4] More recipe Serializer changes - added Interface IExtendedProcessingRecipe supporting requiredHeat, fluid inputs and fluid outputs - set Mixing recipes to use the extended serializer in AllRecipeTypes - removed constructor parameters specifying fluid usage in recipes that do not support fluids (and changed the ConversionRecipe JEI support class back) - cleaned up annotations, ordered AllRecipeType enum values and imports, reformatted recipe code --- .../com/simibubi/create/AllRecipeTypes.java | 36 +++-- .../create/compat/jei/ConversionRecipe.java | 7 +- .../components/crusher/CrushingRecipe.java | 11 +- .../components/fan/SplashingRecipe.java | 8 +- .../components/millstone/MillingRecipe.java | 9 +- .../components/mixer/MixingRecipe.java | 143 +++++++++--------- .../components/press/PressingRecipe.java | 8 +- .../components/saw/CuttingRecipe.java | 8 +- .../processing/ProcessingRecipe.java | 31 ++-- .../ProcessingRecipeSerializer.java | 80 ++++++---- .../tools/SandPaperPolishingRecipe.java | 18 +-- 11 files changed, 174 insertions(+), 185 deletions(-) diff --git a/src/main/java/com/simibubi/create/AllRecipeTypes.java b/src/main/java/com/simibubi/create/AllRecipeTypes.java index 28c52641a..c5d81e469 100644 --- a/src/main/java/com/simibubi/create/AllRecipeTypes.java +++ b/src/main/java/com/simibubi/create/AllRecipeTypes.java @@ -1,7 +1,5 @@ package com.simibubi.create; -import java.util.function.Supplier; - import com.simibubi.create.compat.jei.ConversionRecipe; import com.simibubi.create.content.contraptions.components.crafter.MechanicalCraftingRecipe; import com.simibubi.create.content.contraptions.components.crusher.CrushingRecipe; @@ -12,11 +10,11 @@ import com.simibubi.create.content.contraptions.components.press.PressingRecipe; import com.simibubi.create.content.contraptions.components.saw.CuttingRecipe; import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; import com.simibubi.create.content.contraptions.processing.ProcessingRecipeSerializer; +import com.simibubi.create.content.contraptions.processing.ProcessingRecipeSerializer.IExtendedRecipeFactory; import com.simibubi.create.content.contraptions.processing.ProcessingRecipeSerializer.IRecipeFactory; import com.simibubi.create.content.curiosities.tools.SandPaperPolishingRecipe; import com.simibubi.create.content.curiosities.zapper.blockzapper.BlockzapperUpgradeRecipe; import com.simibubi.create.foundation.utility.Lang; - import net.minecraft.inventory.IInventory; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.IRecipeSerializer; @@ -26,18 +24,20 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.registry.Registry; import net.minecraftforge.event.RegistryEvent; +import java.util.function.Supplier; + public enum AllRecipeTypes { BLOCKZAPPER_UPGRADE(BlockzapperUpgradeRecipe.Serializer::new, IRecipeType.CRAFTING), - MECHANICAL_CRAFTING(MechanicalCraftingRecipe.Serializer::new), - CRUSHING(processingSerializer(CrushingRecipe::new)), - MILLING(processingSerializer(MillingRecipe::new)), - SPLASHING(processingSerializer(SplashingRecipe::new)), - PRESSING(processingSerializer(PressingRecipe::new)), - CUTTING(processingSerializer(CuttingRecipe::new)), - MIXING(processingSerializer(MixingRecipe::new)), - SANDPAPER_POLISHING(processingSerializer(SandPaperPolishingRecipe::new)), CONVERSION(processingSerializer(ConversionRecipe::new)), + CRUSHING(processingSerializer(CrushingRecipe::new)), + CUTTING(processingSerializer(CuttingRecipe::new)), + MECHANICAL_CRAFTING(MechanicalCraftingRecipe.Serializer::new), + MILLING(processingSerializer(MillingRecipe::new)), + MIXING(extendedProcessingSerializer(MixingRecipe::new)), + PRESSING(processingSerializer(PressingRecipe::new)), + SANDPAPER_POLISHING(processingSerializer(SandPaperPolishingRecipe::new)), + SPLASHING(processingSerializer(SplashingRecipe::new)), ; @@ -45,11 +45,6 @@ public enum AllRecipeTypes { public Supplier> supplier; public IRecipeType> type; - @SuppressWarnings("unchecked") - public > T getType() { - return (T) type; - } - AllRecipeTypes(Supplier> supplier) { this(supplier, null); } @@ -87,4 +82,13 @@ public enum AllRecipeTypes { return () -> new ProcessingRecipeSerializer<>(factory); } + private static Supplier> extendedProcessingSerializer( + IExtendedRecipeFactory> factory) { + return () -> new ProcessingRecipeSerializer<>(factory); + } + + @SuppressWarnings("unchecked") + public > T getType() { + return (T) type; + } } diff --git a/src/main/java/com/simibubi/create/compat/jei/ConversionRecipe.java b/src/main/java/com/simibubi/create/compat/jei/ConversionRecipe.java index fe21c60d6..4c838bc55 100644 --- a/src/main/java/com/simibubi/create/compat/jei/ConversionRecipe.java +++ b/src/main/java/com/simibubi/create/compat/jei/ConversionRecipe.java @@ -3,7 +3,6 @@ package com.simibubi.create.compat.jei; import java.util.Collections; import java.util.List; -import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; import com.simibubi.create.AllRecipeTypes; @@ -16,7 +15,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.items.wrapper.RecipeWrapper; /** @@ -29,8 +27,7 @@ import net.minecraftforge.items.wrapper.RecipeWrapper; public class ConversionRecipe extends ProcessingRecipe { public ConversionRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration, @Nullable List fluidIngredients, - @Nullable List fluidResults) { + List results, int processingDuration) { super(AllRecipeTypes.CONVERSION, id, group, ingredients, results, processingDuration); } @@ -45,7 +42,7 @@ public class ConversionRecipe extends ProcessingRecipe { public ConversionRecipe(ResourceLocation id, List ingredients, List results) { - this(id, "conversions", ingredients, results, -1, null, null); + this(id, "conversions", ingredients, results, -1); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingRecipe.java index 407c0ad3b..5f5ff519c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingRecipe.java @@ -1,21 +1,20 @@ package com.simibubi.create.content.contraptions.components.crusher; -import java.util.List; - import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.contraptions.processing.ProcessingIngredient; import com.simibubi.create.content.contraptions.processing.ProcessingOutput; - import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.items.wrapper.RecipeWrapper; +import javax.annotation.ParametersAreNonnullByDefault; +import java.util.List; + +@ParametersAreNonnullByDefault public class CrushingRecipe extends AbstractCrushingRecipe { public CrushingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration, List fluidIngredients, - List fluidResults) { + List results, int processingDuration) { super(AllRecipeTypes.CRUSHING, id, group, ingredients, results, processingDuration); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/SplashingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/SplashingRecipe.java index d873ae952..2ff2c545a 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/SplashingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/SplashingRecipe.java @@ -1,26 +1,22 @@ package com.simibubi.create.content.contraptions.components.fan; -import java.util.List; - import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.contraptions.processing.ProcessingIngredient; import com.simibubi.create.content.contraptions.processing.ProcessingOutput; import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; import com.simibubi.create.content.logistics.InWorldProcessing; import com.simibubi.create.content.logistics.InWorldProcessing.SplashingInv; - import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; import javax.annotation.ParametersAreNonnullByDefault; +import java.util.List; @ParametersAreNonnullByDefault public class SplashingRecipe extends ProcessingRecipe { public SplashingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration, List fluidIngredients, - List fluidResults) { + List results, int processingDuration) { super(AllRecipeTypes.SPLASHING, id, group, ingredients, results, processingDuration); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillingRecipe.java index 242138934..dae11e3bf 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillingRecipe.java @@ -1,25 +1,21 @@ package com.simibubi.create.content.contraptions.components.millstone; -import java.util.List; - import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.contraptions.components.crusher.AbstractCrushingRecipe; import com.simibubi.create.content.contraptions.processing.ProcessingIngredient; import com.simibubi.create.content.contraptions.processing.ProcessingOutput; - import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.items.wrapper.RecipeWrapper; import javax.annotation.ParametersAreNonnullByDefault; +import java.util.List; @ParametersAreNonnullByDefault public class MillingRecipe extends AbstractCrushingRecipe { public MillingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration, List fluidIngredients, - List fluidResults) { + List results, int processingDuration) { super(AllRecipeTypes.MILLING, id, group, ingredients, results, processingDuration); } @@ -35,5 +31,4 @@ public class MillingRecipe extends AbstractCrushingRecipe { protected int getMaxOutputCount() { return 4; } - } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java index adfac18fd..4857f4db6 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java @@ -1,20 +1,11 @@ package com.simibubi.create.content.contraptions.components.mixer; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.LinkedList; -import java.util.List; - -import javax.annotation.Nonnull; - import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.contraptions.processing.BasinTileEntity.BasinInputInventory; import com.simibubi.create.content.contraptions.processing.ProcessingIngredient; import com.simibubi.create.content.contraptions.processing.ProcessingOutput; import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; - import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.Ingredient; @@ -23,82 +14,86 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import javax.annotation.Nonnull; +import java.util.*; + public class MixingRecipe extends ProcessingRecipe { - public MixingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration) { - super(AllRecipeTypes.MIXING, id, group, ingredients, results, processingDuration); - } + public MixingRecipe(ResourceLocation id, String group, List ingredients, + List results, int processingDuration, List fluidIngredients, + List fluidResults, int requiredHeat) { + super(AllRecipeTypes.MIXING, id, group, ingredients, results, processingDuration, fluidIngredients, + fluidResults, requiredHeat); + } - public MixingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration, List fluidIngredients, - List fluidResults) { - super(AllRecipeTypes.MIXING, id, group, ingredients, results, processingDuration, fluidIngredients, - fluidResults); - } + public static MixingRecipe of(IRecipe recipe) { + return new MixingRecipe(recipe.getId(), recipe.getGroup(), ProcessingIngredient.list(recipe.getIngredients()), + Collections.singletonList(new ProcessingOutput(recipe.getRecipeOutput(), 1)), -1, null, null, 0); + } - @Override - protected int getMaxInputCount() { - return 9; - } + @Override + protected int getMaxInputCount() { + return 9; + } - @Override - protected int getMaxOutputCount() { - return 1; - } + @Override + protected int getMaxOutputCount() { + return 1; + } - @Override - protected boolean canHaveCatalysts() { - return true; - } + @Override + protected boolean canHaveCatalysts() { + return true; + } - @Override - public boolean matches(BasinInputInventory inv, @Nonnull World worldIn) { - if (inv.isEmpty()) - return false; + @Override + public boolean matches(BasinInputInventory inv, @Nonnull World worldIn) { + if (inv.isEmpty()) + return false; - NonNullList ingredients = this.getIngredients(); - if (!ingredients.stream() - .allMatch(Ingredient::isSimple)) - return false; + NonNullList ingredients = this.getIngredients(); + if (!ingredients.stream() + .allMatch(Ingredient::isSimple)) + return false; - List remaining = new ArrayList<>(); - for (int slot = 0; slot < inv.getSizeInventory(); ++slot) { - ItemStack itemstack = inv.getStackInSlot(slot); - if (!itemstack.isEmpty()) { - remaining.add(itemstack.copy()); - } - } + List remaining = new ArrayList<>(); + for (int slot = 0; slot < inv.getSizeInventory(); ++slot) { + ItemStack itemstack = inv.getStackInSlot(slot); + if (!itemstack.isEmpty()) { + remaining.add(itemstack.copy()); + } + } - // sort by leniency - List sortedIngredients = new LinkedList<>(ingredients); - sortedIngredients.sort(Comparator.comparingInt(i -> i.getMatchingStacks().length)); - Ingredients: for (Ingredient ingredient : sortedIngredients) { - for (ItemStack stack : remaining) { - if (stack.isEmpty()) - continue; - if (ingredient.test(stack)) { - stack.shrink(1); - continue Ingredients; - } - } - return false; - } - return true; - } + // sort by leniency + List sortedIngredients = new LinkedList<>(ingredients); + sortedIngredients.sort(Comparator.comparingInt(i -> i.getMatchingStacks().length)); + Ingredients: + for (Ingredient ingredient : sortedIngredients) { + for (ItemStack stack : remaining) { + if (stack.isEmpty()) + continue; + if (ingredient.test(stack)) { + stack.shrink(1); + continue Ingredients; + } + } + return false; + } + return true; + } - public static MixingRecipe of(IRecipe recipe) { - return new MixingRecipe(recipe.getId(), recipe.getGroup(), ProcessingIngredient.list(recipe.getIngredients()), - Collections.singletonList(new ProcessingOutput(recipe.getRecipeOutput(), 1)), -1); - } + @Override + protected boolean canHaveFluidIngredient() { + return true; + } - @Override - protected boolean canHaveFluidIngredient() { - return true; - } + @Override + protected boolean canHaveFluidOutput() { + return true; + } - @Override - protected boolean canHaveFluidOutput() { - return true; - } + @Override + protected boolean requiresHeating() { + return this.requiredHeat > 0; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/PressingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/PressingRecipe.java index a71395bc8..3ff546dd5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/PressingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/PressingRecipe.java @@ -1,25 +1,21 @@ package com.simibubi.create.content.contraptions.components.press; -import java.util.List; - import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity.PressingInv; import com.simibubi.create.content.contraptions.processing.ProcessingIngredient; import com.simibubi.create.content.contraptions.processing.ProcessingOutput; import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; - import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; import javax.annotation.ParametersAreNonnullByDefault; +import java.util.List; @ParametersAreNonnullByDefault public class PressingRecipe extends ProcessingRecipe { public PressingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration, List fluidIngredients, - List fluidResults) { + List results, int processingDuration) { super(AllRecipeTypes.PRESSING, id, group, ingredients, results, processingDuration); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/CuttingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/CuttingRecipe.java index 80d9a377d..12f7bfffc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/CuttingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/CuttingRecipe.java @@ -1,25 +1,21 @@ package com.simibubi.create.content.contraptions.components.saw; -import java.util.List; - import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.contraptions.processing.ProcessingIngredient; import com.simibubi.create.content.contraptions.processing.ProcessingOutput; import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; - import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.items.wrapper.RecipeWrapper; import javax.annotation.ParametersAreNonnullByDefault; +import java.util.List; @ParametersAreNonnullByDefault public class CuttingRecipe extends ProcessingRecipe { public CuttingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration, List fluidIngredients, - List fluidResults) { + List results, int processingDuration) { super(AllRecipeTypes.CUTTING, id, group, ingredients, results, processingDuration); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipe.java index 8d93a2200..8134ee208 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipe.java @@ -1,11 +1,7 @@ package com.simibubi.create.content.contraptions.processing; -import java.util.List; -import java.util.stream.Collectors; - import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.Create; - import mcp.MethodsReturnNonnullByDefault; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -19,37 +15,31 @@ import net.minecraftforge.fluids.FluidStack; import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; +import java.util.List; +import java.util.stream.Collectors; @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault public abstract class ProcessingRecipe implements IRecipe { protected final List ingredients; - private final List results; - private final IRecipeType type; - private final IRecipeSerializer serializer; protected final ResourceLocation id; protected final String group; protected final int processingDuration; protected final List fluidIngredients; protected final List fluidResults; + protected final int requiredHeat; + private final List results; + private final IRecipeType type; + private final IRecipeSerializer serializer; public ProcessingRecipe(AllRecipeTypes recipeType, ResourceLocation id, String group, List ingredients, List results, int processingDuration) { - this.type = recipeType.type; - this.serializer = recipeType.serializer; - this.id = id; - this.group = group; - this.ingredients = ingredients; - this.results = results; - this.processingDuration = processingDuration; - this.fluidIngredients = null; - this.fluidResults = null; - validate(recipeType); + this(recipeType, id, group, ingredients, results, processingDuration, null, null, 0); } public ProcessingRecipe(AllRecipeTypes recipeType, ResourceLocation id, String group, List ingredients, List results, int processingDuration, - @Nullable List fluidIngredients, @Nullable List fluidResults) { + @Nullable List fluidIngredients, @Nullable List fluidResults, int requiredHeat) { this.type = recipeType.type; this.serializer = recipeType.serializer; this.id = id; @@ -59,6 +49,7 @@ public abstract class ProcessingRecipe implements IRecipe< this.processingDuration = processingDuration; this.fluidIngredients = fluidIngredients; this.fluidResults = fluidResults; + this.requiredHeat = requiredHeat; validate(recipeType); } @@ -167,4 +158,8 @@ public abstract class ProcessingRecipe implements IRecipe< protected boolean canHaveFluidOutput() { return false; } + + protected boolean requiresHeating() { + return false; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java index a07dfb1e2..3c8de24d8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeSerializer.java @@ -1,11 +1,7 @@ package com.simibubi.create.content.contraptions.processing; -import java.util.ArrayList; -import java.util.List; - import com.google.gson.JsonElement; import com.google.gson.JsonObject; - import mcp.MethodsReturnNonnullByDefault; import net.minecraft.fluid.Fluid; import net.minecraft.item.ItemStack; @@ -17,7 +13,10 @@ import net.minecraft.util.registry.Registry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.registries.ForgeRegistries; +import javax.annotation.Nullable; import javax.annotation.ParametersAreNonnullByDefault; +import java.util.ArrayList; +import java.util.List; @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault @@ -39,18 +38,11 @@ public class ProcessingRecipeSerializer> for (JsonElement e : JSONUtils.getJsonArray(json, "ingredients")) { JsonObject entry = e.getAsJsonObject(); if (JSONUtils.hasField(entry, "fluid")) { - Fluid fluid = ForgeRegistries.FLUIDS - .getValue(ResourceLocation.tryCreate(JSONUtils.getString(entry.get("fluid"), "fluid"))); - int amount = 1; - if (JSONUtils.hasField((JsonObject) e, "amount")) { - amount = JSONUtils.getInt(entry.get("amount"), "amount"); - } - if (fluid != null && amount > 0) - fluidIngredients.add(new FluidStack(fluid, amount)); + addFluidToList(fluidIngredients, entry); } else { int count = 1; - if (JSONUtils.hasField((JsonObject) e, "count")) { - count = JSONUtils.getInt(entry.get("count"), "count"); + if (JSONUtils.hasField(entry, "count")) { + count = JSONUtils.getInt(entry, "count"); } for (int i = 0; i < count; i++) { ingredients.add(ProcessingIngredient.parse(entry)); @@ -63,20 +55,13 @@ public class ProcessingRecipeSerializer> for (JsonElement e : JSONUtils.getJsonArray(json, "results")) { JsonObject entry = e.getAsJsonObject(); if (JSONUtils.hasField(entry, "fluid")) { - Fluid fluid = ForgeRegistries.FLUIDS - .getValue(ResourceLocation.tryCreate(JSONUtils.getString(entry.get("fluid"), "fluid"))); - int amount = 1; - if (JSONUtils.hasField((JsonObject) e, "amount")) { - amount = JSONUtils.getInt(entry.get("amount"), "amount"); - } - if (fluid != null && amount > 0) - fluidResults.add(new FluidStack(fluid, amount)); + addFluidToList(fluidResults, entry); } else { - String s1 = JSONUtils.getString(entry.get("item"), "item"); - int i = JSONUtils.getInt(entry.get("count"), "count"); + String s1 = JSONUtils.getString(entry, "item"); + int i = JSONUtils.getInt(entry, "count"); float chance = 1; - if (JSONUtils.hasField((JsonObject) e, "chance")) - chance = JSONUtils.getFloat(entry.get("chance"), "chance"); + if (JSONUtils.hasField(entry, "chance")) + chance = JSONUtils.getFloat(entry, "chance"); ItemStack itemstack = new ItemStack(Registry.ITEM.getOrDefault(new ResourceLocation(s1)), i); results.add(new ProcessingOutput(itemstack, chance)); } @@ -86,7 +71,22 @@ public class ProcessingRecipeSerializer> if (JSONUtils.hasField(json, "processingTime")) duration = JSONUtils.getInt(json, "processingTime"); - return this.factory.create(recipeId, s, ingredients, results, duration, fluidIngredients, fluidResults); + int requiredHeat = 0; + if (JSONUtils.hasField(json, "requiredHeat")) + requiredHeat = JSONUtils.getInt(json, "requiredHeat"); + + return this.factory.create(recipeId, s, ingredients, results, duration, fluidIngredients, fluidResults, + requiredHeat); + } + + private void addFluidToList(List fluidStacks, JsonObject entry) { + Fluid fluid = ForgeRegistries.FLUIDS.getValue(ResourceLocation.tryCreate(JSONUtils.getString(entry, "fluid"))); + int amount = 1; + if (JSONUtils.hasField(entry, "amount")) { + amount = JSONUtils.getInt(entry, "amount"); + } + if (fluid != null && amount > 0) + fluidStacks.add(new FluidStack(fluid, amount)); } public T read(ResourceLocation recipeId, PacketBuffer buffer) { @@ -113,8 +113,10 @@ public class ProcessingRecipeSerializer> fluidResults.add(FluidStack.readFromPacket(buffer)); int duration = buffer.readInt(); + int requiredHeat = buffer.readInt(); - return this.factory.create(recipeId, s, ingredients, results, duration, fluidIngredients, fluidResults); + return this.factory.create(recipeId, s, ingredients, results, duration, fluidIngredients, fluidResults, + requiredHeat); } public void write(PacketBuffer buffer, T recipe) { @@ -141,12 +143,30 @@ public class ProcessingRecipeSerializer> } buffer.writeInt(recipe.processingDuration); + buffer.writeInt(recipe.requiredHeat); } public interface IRecipeFactory> { + default T create(ResourceLocation recipeId, String s, List ingredients, + List results, int duration, @Nullable List fluidIngredients, + @Nullable List fluidResults, int requiredHeat) { + return create(recipeId, s, ingredients, results, duration); + } + T create(ResourceLocation recipeId, String s, List ingredients, - List results, int duration, List fluidIngredients, - List fluidResults); + List results, int duration); } + public interface IExtendedRecipeFactory> extends IRecipeFactory { + @Override + T create(ResourceLocation recipeId, String s, List ingredients, + List results, int duration, @Nullable List fluidIngredients, + @Nullable List fluidResults, int requiredHeat); + + @Override + default T create(ResourceLocation recipeId, String s, List ingredients, + List results, int duration) { + throw new IllegalStateException("Incorrect recipe creation function used: " + recipeId); + } + } } diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java index b65e57c7e..c2a752b41 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperPolishingRecipe.java @@ -1,30 +1,26 @@ package com.simibubi.create.content.curiosities.tools; -import java.util.List; - import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.contraptions.processing.ProcessingIngredient; import com.simibubi.create.content.contraptions.processing.ProcessingOutput; import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; import com.simibubi.create.content.curiosities.tools.SandPaperPolishingRecipe.SandPaperInv; - import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.items.ItemStackHandler; import net.minecraftforge.items.wrapper.RecipeWrapper; import javax.annotation.ParametersAreNonnullByDefault; +import java.util.List; @ParametersAreNonnullByDefault public class SandPaperPolishingRecipe extends ProcessingRecipe { public SandPaperPolishingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration, List fluidIngredients, - List fluidResults) { + List results, int processingDuration) { super(AllRecipeTypes.SANDPAPER_POLISHING, id, group, ingredients, results, processingDuration); } @@ -41,17 +37,17 @@ public class SandPaperPolishingRecipe extends ProcessingRecipe { return stack; } + public static List> getMatchingRecipes(World world, ItemStack stack) { + return world.getRecipeManager() + .getRecipes(AllRecipeTypes.SANDPAPER_POLISHING.getType(), new SandPaperInv(stack), world); + } + @Override public boolean matches(SandPaperInv inv, World worldIn) { return ingredients.get(0) .test(inv.getStackInSlot(0)); } - public static List> getMatchingRecipes(World world, ItemStack stack) { - return world.getRecipeManager() - .getRecipes(AllRecipeTypes.SANDPAPER_POLISHING.getType(), new SandPaperInv(stack), world); - } - @Override protected int getMaxOutputCount() { return 1; From ae785b5a664ab7b60728f93cfefb05db2e25213f Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Sat, 11 Jul 2020 23:48:02 +0200 Subject: [PATCH 3/4] blaze_heater --- src/generated/resources/.cache/cache | 29 ++- .../create/blockstates/blaze_heater.json | 7 + .../assets/create/blockstates/fluid_pipe.json | 132 +++++----- .../create/blockstates/radial_chassis.json | 24 +- .../resources/assets/create/lang/en_ud.json | 1 + .../resources/assets/create/lang/en_us.json | 1 + .../assets/create/lang/unfinished/de_de.json | 3 +- .../assets/create/lang/unfinished/fr_fr.json | 3 +- .../assets/create/lang/unfinished/it_it.json | 3 +- .../assets/create/lang/unfinished/ja_jp.json | 3 +- .../assets/create/lang/unfinished/ko_kr.json | 3 +- .../assets/create/lang/unfinished/nl_nl.json | 3 +- .../assets/create/lang/unfinished/pt_br.json | 3 +- .../assets/create/lang/unfinished/ru_ru.json | 3 +- .../assets/create/lang/unfinished/zh_cn.json | 3 +- .../create/models/item/blaze_heater.json | 3 + .../loot_tables/blocks/blaze_heater.json | 19 ++ .../java/com/simibubi/create/AllBlocks.java | 42 ++-- .../components/mixer/MixingRecipe.java | 132 +++++----- .../contraptions/processing/HeaterBlock.java | 11 + .../create/foundation/data/BlockStateGen.java | 5 + .../foundation/data/SharedProperties.java | 5 +- .../models/block/blaze_heater/block.json | 236 ++++++++++++++++++ .../textures/block/blaze_heater_brazier.png | Bin 0 -> 4973 bytes 24 files changed, 489 insertions(+), 185 deletions(-) create mode 100644 src/generated/resources/assets/create/blockstates/blaze_heater.json create mode 100644 src/generated/resources/assets/create/models/item/blaze_heater.json create mode 100644 src/generated/resources/data/create/loot_tables/blocks/blaze_heater.json create mode 100644 src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java create mode 100644 src/main/resources/assets/create/models/block/blaze_heater/block.json create mode 100644 src/main/resources/assets/create/textures/block/blaze_heater_brazier.png diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 8e657704f..045150eed 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -24,6 +24,7 @@ f9fa6aa530eb0891a74eadfbebc663172a57147a assets\create\blockstates\basin.json 40d10934934ea142d71fc6ce598b1455c3ad47b4 assets\create\blockstates\belt_observer.json cf9045eb16e5299a1d917c4cb536289f49411276 assets\create\blockstates\birch_window.json 94a1a91403eb4b035fec48071e7fcae57a8a6abd assets\create\blockstates\birch_window_pane.json +0626725f70103a55dabcda6f87ca943279d45793 assets\create\blockstates\blaze_heater.json fba967b1f6e44b34a9d9662e2fedfc13aad7f36c assets\create\blockstates\brass_belt_funnel.json 8b1dd00adcc7e74c5a9feed069e2610b15a338cb assets\create\blockstates\brass_block.json b8dd6e505943e06706d0718ece620ab3cf943650 assets\create\blockstates\brass_casing.json @@ -123,7 +124,7 @@ de8a40b7daf1497d5aecee47a43b3e0b1d030b00 assets\create\blockstates\fancy_scoria_ fc9ac0a7e7191b93516719455a17177fa6524ecc assets\create\blockstates\fancy_weathered_limestone_bricks_slab.json b2a7c321b1795f20e7433f81a55ce4683de081b8 assets\create\blockstates\fancy_weathered_limestone_bricks_stairs.json 6372fe02ba0065acb0758121c45a15a1a8fdc5de assets\create\blockstates\fancy_weathered_limestone_bricks_wall.json -4cbd66ed3da77d1caad6ef4e657a86b1b4017a39 assets\create\blockstates\fluid_pipe.json +3aa8213ea6cd12a6964e3a70900b12d76d794d20 assets\create\blockstates\fluid_pipe.json 9d0e78a4d6d0ccac37c06d0f5810a800a04844b2 assets\create\blockstates\fluid_tank.json e9da1794b6ece7f9aa8bcb43d42c23a55446133b assets\create\blockstates\flywheel.json ac00d40e1ef50a37041c0481afa1a23a14dea78e assets\create\blockstates\framed_glass.json @@ -286,7 +287,7 @@ b7829c2ef2c47188713f8cab21b2c9bc7f9c5b79 assets\create\blockstates\portable_stor e8b0a401c10d1ba67ed71ba31bd5f9bc28571b65 assets\create\blockstates\powered_toggle_latch.json 3a739f9d4276828d83f2d2750bf3227c87bcd438 assets\create\blockstates\pulley_magnet.json 469e430d96cb0a5e1aaf6b7cc5d401d488c9e600 assets\create\blockstates\pulse_repeater.json -6fa36883e76e9e403bb429c8f86b8c0d3bba0cff assets\create\blockstates\radial_chassis.json +8d7e653bfd9846e684a0d3725595714a19201017 assets\create\blockstates\radial_chassis.json 8929677f2cc5354aa19ef182af69f9f0b41eb242 assets\create\blockstates\redstone_contact.json c29213b77ac0c78d8979c5f6188d2b265696f9b9 assets\create\blockstates\redstone_link.json 1eac804cba08aebb5f4646758ae1ef9b32e01365 assets\create\blockstates\reinforced_rail.json @@ -337,17 +338,17 @@ c60c3115fd6eeaa3a696428a87a74d184ab7d62d assets\create\blockstates\weathered_lim c77b46d8b459e5c7cc495393546f3fcca8a1fa1d assets\create\blockstates\weathered_limestone_pillar.json 7f39521b211441f5c3e06d60c5978cebe16cacfb assets\create\blockstates\zinc_block.json b7181bcd8182b2f17088e5aa881f374c9c65470c assets\create\blockstates\zinc_ore.json -541831ab0cf2f0222f0b7e42ec6c4b0ae636168d assets\create\lang\en_ud.json -fe44adfde38a1084754fe46b632811f90dcfcd7f assets\create\lang\en_us.json -143b76ed828949330ef0e338fb6709c28561ac2d assets\create\lang\unfinished\de_de.json -95bf7693b162141c2c76617ed4e04bec474e2def assets\create\lang\unfinished\fr_fr.json -b3bf60afc7d0dea72a9d7d01df36d34affd6a296 assets\create\lang\unfinished\it_it.json -ef336e01a8e3ed3f8c2713c66476bcc708e3e3b0 assets\create\lang\unfinished\ja_jp.json -66c84c388e552ee8259eca2ab1009493456fc4d3 assets\create\lang\unfinished\ko_kr.json -66b3140ef158b51208a191e6a90473fba5bb1749 assets\create\lang\unfinished\nl_nl.json -775702e0f3fbdab7ef8b1714e3cff69da56bd500 assets\create\lang\unfinished\pt_br.json -7c4c4e7a00456f893538a6baa35d726a8786bf93 assets\create\lang\unfinished\ru_ru.json -ce16074d9dc5d504f2a91b164258f0059163260b assets\create\lang\unfinished\zh_cn.json +00edba8c69557058bf9fbbc4d389dc455f24b0fc assets\create\lang\en_ud.json +9fd42e23b8b40831a23960c8a65284c0f5c77d9c assets\create\lang\en_us.json +49da0ae7f7ce3b7dcb3489ec4a5ae9859b01c6b2 assets\create\lang\unfinished\de_de.json +e4614a462e0274a0b44990d8110df40e2a739181 assets\create\lang\unfinished\fr_fr.json +6d2d32af208bc145bc9b84bec5fb49688313c409 assets\create\lang\unfinished\it_it.json +bf4ecea8db1411002fc3f6149c61e9ff764f60f9 assets\create\lang\unfinished\ja_jp.json +17cff516677a4bc7c82e5f4c037fd9472d8ed75d assets\create\lang\unfinished\ko_kr.json +b059db47666d44c83cfcb938603b6a324d3a8180 assets\create\lang\unfinished\nl_nl.json +ed177bca3522ec5265272268bcfb2eb5fa5011a2 assets\create\lang\unfinished\pt_br.json +79d0ebe3035b0471864d72b13f51e07ea27fef73 assets\create\lang\unfinished\ru_ru.json +ea9d56b17b0e9be13464966e6fdd90a500a578c3 assets\create\lang\unfinished\zh_cn.json 846200eb548d3bfa2e77b41039de159b4b6cfb45 assets\create\models\block\acacia_window.json 1930fa3a3c98d53dd19e4ee7f55bc27fd47aa281 assets\create\models\block\acacia_window_pane_noside.json 1763ea2c9b981d187f5031ba608f3d5d3be3986a assets\create\models\block\acacia_window_pane_noside_alt.json @@ -997,6 +998,7 @@ bf1fc6bdf7fca6f1958a2d3e96202c1cecb50669 assets\create\models\item\basin.json 695a69d5854e2eb134b55d855bd2b7b18808a01d assets\create\models\item\belt_observer.json 9044243882cfd49a2827e1b910a4c9b0e46daa47 assets\create\models\item\birch_window.json 6ed49f59ea91068ef68720f43e67a9237594bdf0 assets\create\models\item\birch_window_pane.json +fa2761dc44857eb840a94df869de66a91988f0da assets\create\models\item\blaze_heater.json 17d340c3678bd24cb085ba49490b2b4cb341a9e7 assets\create\models\item\brass_block.json f5a18f4279c2e845a5967b1c2f9e807c2bb77afb assets\create\models\item\brass_casing.json ab045c951352806c3f632dda7b71573f93f60ac4 assets\create\models\item\brass_funnel.json @@ -1786,6 +1788,7 @@ c7f81e30c31837a287d6d6040cdb02c7dec11441 data\create\loot_tables\blocks\belt.jso 1104e323abb2a8c25769c47dc5d1154965113cc9 data\create\loot_tables\blocks\belt_observer.json 67a8e2513c3cb09e6fe80279fda94f79d5018c37 data\create\loot_tables\blocks\birch_window.json bf1d5843f93533f84bc4adec5b77da2114fa2025 data\create\loot_tables\blocks\birch_window_pane.json +798ef290b388dee758df3e779b4b1c9289955f7b data\create\loot_tables\blocks\blaze_heater.json 1dbc446abe190b2832b2ce7d52c2f2d2bdd45949 data\create\loot_tables\blocks\brass_belt_funnel.json 70d9d4def43d5b31fa7cdc5ca5002c71cf4a90b0 data\create\loot_tables\blocks\brass_block.json 8a14258ad5d79d9e4dc5a318905644b446196420 data\create\loot_tables\blocks\brass_casing.json diff --git a/src/generated/resources/assets/create/blockstates/blaze_heater.json b/src/generated/resources/assets/create/blockstates/blaze_heater.json new file mode 100644 index 000000000..ede37bfd8 --- /dev/null +++ b/src/generated/resources/assets/create/blockstates/blaze_heater.json @@ -0,0 +1,7 @@ +{ + "variants": { + "": { + "model": "create:block/blaze_heater/block" + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/create/blockstates/fluid_pipe.json b/src/generated/resources/assets/create/blockstates/fluid_pipe.json index 96f2f6808..44255c27a 100644 --- a/src/generated/resources/assets/create/blockstates/fluid_pipe.json +++ b/src/generated/resources/assets/create/blockstates/fluid_pipe.json @@ -181,10 +181,10 @@ }, { "when": { - "north": "false", - "south": "true", "west": "true", - "east": "false" + "east": "false", + "north": "false", + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/lu_y" @@ -192,10 +192,10 @@ }, { "when": { - "north": "false", - "south": "true", "west": "false", - "east": "true" + "east": "true", + "north": "false", + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/ru_y" @@ -203,10 +203,10 @@ }, { "when": { - "north": "true", - "south": "false", "west": "true", - "east": "false" + "east": "false", + "north": "true", + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/ld_y" @@ -214,10 +214,10 @@ }, { "when": { - "north": "true", - "south": "false", "west": "false", - "east": "true" + "east": "true", + "north": "true", + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/rd_y" @@ -225,10 +225,10 @@ }, { "when": { + "west": "false", + "east": "false", "north": "true", - "south": "true", - "west": "false", - "east": "false" + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/ud_y" @@ -236,10 +236,10 @@ }, { "when": { + "west": "false", + "east": "false", "north": "false", - "south": "true", - "west": "false", - "east": "false" + "south": "true" }, "apply": { "model": "create:block/fluid_pipe/ud_y" @@ -247,10 +247,10 @@ }, { "when": { + "west": "false", + "east": "false", "north": "true", - "south": "false", - "west": "false", - "east": "false" + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_y" @@ -258,10 +258,10 @@ }, { "when": { - "north": "false", - "south": "false", "west": "true", - "east": "true" + "east": "true", + "north": "false", + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_y" @@ -269,10 +269,10 @@ }, { "when": { - "north": "false", - "south": "false", "west": "true", - "east": "false" + "east": "false", + "north": "false", + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_y" @@ -280,10 +280,10 @@ }, { "when": { - "north": "false", - "south": "false", "west": "false", - "east": "true" + "east": "true", + "north": "false", + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_y" @@ -291,10 +291,10 @@ }, { "when": { - "north": "false", - "south": "false", "west": "false", - "east": "false" + "east": "false", + "north": "false", + "south": "false" }, "apply": { "model": "create:block/fluid_pipe/none_y" @@ -302,10 +302,10 @@ }, { "when": { - "up": "true", "west": "false", - "down": "false", - "east": "true" + "east": "true", + "up": "true", + "down": "false" }, "apply": { "model": "create:block/fluid_pipe/lu_z" @@ -313,10 +313,10 @@ }, { "when": { - "up": "true", "west": "true", - "down": "false", - "east": "false" + "east": "false", + "up": "true", + "down": "false" }, "apply": { "model": "create:block/fluid_pipe/ru_z" @@ -324,10 +324,10 @@ }, { "when": { - "up": "false", "west": "false", - "down": "true", - "east": "true" + "east": "true", + "up": "false", + "down": "true" }, "apply": { "model": "create:block/fluid_pipe/ld_z" @@ -335,10 +335,10 @@ }, { "when": { - "up": "false", "west": "true", - "down": "true", - "east": "false" + "east": "false", + "up": "false", + "down": "true" }, "apply": { "model": "create:block/fluid_pipe/rd_z" @@ -346,10 +346,10 @@ }, { "when": { + "west": "false", + "east": "false", "up": "true", - "west": "false", - "down": "true", - "east": "false" + "down": "true" }, "apply": { "model": "create:block/fluid_pipe/ud_z" @@ -357,10 +357,10 @@ }, { "when": { + "west": "false", + "east": "false", "up": "true", - "west": "false", - "down": "false", - "east": "false" + "down": "false" }, "apply": { "model": "create:block/fluid_pipe/ud_z" @@ -368,10 +368,10 @@ }, { "when": { - "up": "false", "west": "false", - "down": "true", - "east": "false" + "east": "false", + "up": "false", + "down": "true" }, "apply": { "model": "create:block/fluid_pipe/ud_z" @@ -379,10 +379,10 @@ }, { "when": { - "up": "false", "west": "true", - "down": "false", - "east": "true" + "east": "true", + "up": "false", + "down": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_z" @@ -390,10 +390,10 @@ }, { "when": { - "up": "false", "west": "false", - "down": "false", - "east": "true" + "east": "true", + "up": "false", + "down": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_z" @@ -401,10 +401,10 @@ }, { "when": { - "up": "false", "west": "true", - "down": "false", - "east": "false" + "east": "false", + "up": "false", + "down": "false" }, "apply": { "model": "create:block/fluid_pipe/lr_z" @@ -412,10 +412,10 @@ }, { "when": { - "up": "false", "west": "false", - "down": "false", - "east": "false" + "east": "false", + "up": "false", + "down": "false" }, "apply": { "model": "create:block/fluid_pipe/none_z" diff --git a/src/generated/resources/assets/create/blockstates/radial_chassis.json b/src/generated/resources/assets/create/blockstates/radial_chassis.json index f97d8c8bc..9d00ea8b1 100644 --- a/src/generated/resources/assets/create/blockstates/radial_chassis.json +++ b/src/generated/resources/assets/create/blockstates/radial_chassis.json @@ -29,8 +29,8 @@ }, { "when": { - "axis": "x", - "sticky_south": "true" + "sticky_south": "true", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky", @@ -39,8 +39,8 @@ }, { "when": { - "axis": "y", - "sticky_south": "true" + "sticky_south": "true", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y_sticky" @@ -48,8 +48,8 @@ }, { "when": { - "axis": "z", - "sticky_south": "true" + "sticky_south": "true", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_x_sticky", @@ -59,8 +59,8 @@ }, { "when": { - "axis": "x", - "sticky_south": "false" + "sticky_south": "false", + "axis": "x" }, "apply": { "model": "create:block/radial_chassis_side_x", @@ -69,8 +69,8 @@ }, { "when": { - "axis": "y", - "sticky_south": "false" + "sticky_south": "false", + "axis": "y" }, "apply": { "model": "create:block/radial_chassis_side_y" @@ -78,8 +78,8 @@ }, { "when": { - "axis": "z", - "sticky_south": "false" + "sticky_south": "false", + "axis": "z" }, "apply": { "model": "create:block/radial_chassis_side_x", diff --git a/src/generated/resources/assets/create/lang/en_ud.json b/src/generated/resources/assets/create/lang/en_ud.json index be027ea35..72e9325f0 100644 --- a/src/generated/resources/assets/create/lang/en_ud.json +++ b/src/generated/resources/assets/create/lang/en_ud.json @@ -25,6 +25,7 @@ "block.create.belt_observer": "\u0279\u01DD\u028C\u0279\u01DDsqO \u0287\u05DF\u01DD\u15FA", "block.create.birch_window": "\u028Dopu\u0131M \u0265\u0254\u0279\u0131\u15FA", "block.create.birch_window_pane": "\u01DDu\u0250\u0500 \u028Dopu\u0131M \u0265\u0254\u0279\u0131\u15FA", + "block.create.blaze_heater": "\u0279\u01DD\u0287\u0250\u01DDH \u01DDz\u0250\u05DF\u15FA", "block.create.brass_belt_funnel": "\u05DF\u01DDuun\u2132 \u0287\u05DF\u01DD\u15FA ss\u0250\u0279\u15FA", "block.create.brass_block": "\u029E\u0254o\u05DF\u15FA ss\u0250\u0279\u15FA", "block.create.brass_casing": "bu\u0131s\u0250\u0186 ss\u0250\u0279\u15FA", diff --git a/src/generated/resources/assets/create/lang/en_us.json b/src/generated/resources/assets/create/lang/en_us.json index 5e18d7883..95d8f4bb3 100644 --- a/src/generated/resources/assets/create/lang/en_us.json +++ b/src/generated/resources/assets/create/lang/en_us.json @@ -28,6 +28,7 @@ "block.create.belt_observer": "Belt Observer", "block.create.birch_window": "Birch Window", "block.create.birch_window_pane": "Birch Window Pane", + "block.create.blaze_heater": "Blaze Heater", "block.create.brass_belt_funnel": "Brass Belt Funnel", "block.create.brass_block": "Brass Block", "block.create.brass_casing": "Brass Casing", diff --git a/src/generated/resources/assets/create/lang/unfinished/de_de.json b/src/generated/resources/assets/create/lang/unfinished/de_de.json index 0b7f7b251..190f7f295 100644 --- a/src/generated/resources/assets/create/lang/unfinished/de_de.json +++ b/src/generated/resources/assets/create/lang/unfinished/de_de.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 777", + "_": "Missing Localizations: 778", "_": "->------------------------] Game Elements [------------------------<-", @@ -29,6 +29,7 @@ "block.create.belt_observer": "Fließband-Beobachter", "block.create.birch_window": "UNLOCALIZED: Birch Window", "block.create.birch_window_pane": "UNLOCALIZED: Birch Window Pane", + "block.create.blaze_heater": "UNLOCALIZED: Blaze Heater", "block.create.brass_belt_funnel": "UNLOCALIZED: Brass Belt Funnel", "block.create.brass_block": "UNLOCALIZED: Brass Block", "block.create.brass_casing": "UNLOCALIZED: Brass Casing", diff --git a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json index 21baa7d50..8c6601e15 100644 --- a/src/generated/resources/assets/create/lang/unfinished/fr_fr.json +++ b/src/generated/resources/assets/create/lang/unfinished/fr_fr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 380", + "_": "Missing Localizations: 381", "_": "->------------------------] Game Elements [------------------------<-", @@ -29,6 +29,7 @@ "block.create.belt_observer": "Observateur d'entité", "block.create.birch_window": "UNLOCALIZED: Birch Window", "block.create.birch_window_pane": "UNLOCALIZED: Birch Window Pane", + "block.create.blaze_heater": "UNLOCALIZED: Blaze Heater", "block.create.brass_belt_funnel": "UNLOCALIZED: Brass Belt Funnel", "block.create.brass_block": "UNLOCALIZED: Brass Block", "block.create.brass_casing": "Boîtier en laiton", diff --git a/src/generated/resources/assets/create/lang/unfinished/it_it.json b/src/generated/resources/assets/create/lang/unfinished/it_it.json index cd54613f7..31cb804e6 100644 --- a/src/generated/resources/assets/create/lang/unfinished/it_it.json +++ b/src/generated/resources/assets/create/lang/unfinished/it_it.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 364", + "_": "Missing Localizations: 365", "_": "->------------------------] Game Elements [------------------------<-", @@ -29,6 +29,7 @@ "block.create.belt_observer": "Osservatore a Cinghia", "block.create.birch_window": "UNLOCALIZED: Birch Window", "block.create.birch_window_pane": "UNLOCALIZED: Birch Window Pane", + "block.create.blaze_heater": "UNLOCALIZED: Blaze Heater", "block.create.brass_belt_funnel": "UNLOCALIZED: Brass Belt Funnel", "block.create.brass_block": "Blocco di Ottone", "block.create.brass_casing": "Involucro di Ottone", diff --git a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json index 4bc000f9d..e8de81dbf 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ja_jp.json +++ b/src/generated/resources/assets/create/lang/unfinished/ja_jp.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 359", + "_": "Missing Localizations: 360", "_": "->------------------------] Game Elements [------------------------<-", @@ -29,6 +29,7 @@ "block.create.belt_observer": "ベルトオブザーバー", "block.create.birch_window": "UNLOCALIZED: Birch Window", "block.create.birch_window_pane": "UNLOCALIZED: Birch Window Pane", + "block.create.blaze_heater": "UNLOCALIZED: Blaze Heater", "block.create.brass_belt_funnel": "UNLOCALIZED: Brass Belt Funnel", "block.create.brass_block": "真鍮ブロック", "block.create.brass_casing": "真鍮ケーシング", diff --git a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json index 92d51ddfc..90490026c 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ko_kr.json +++ b/src/generated/resources/assets/create/lang/unfinished/ko_kr.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 364", + "_": "Missing Localizations: 365", "_": "->------------------------] Game Elements [------------------------<-", @@ -29,6 +29,7 @@ "block.create.belt_observer": "벨트 감지기", "block.create.birch_window": "UNLOCALIZED: Birch Window", "block.create.birch_window_pane": "UNLOCALIZED: Birch Window Pane", + "block.create.blaze_heater": "UNLOCALIZED: Blaze Heater", "block.create.brass_belt_funnel": "UNLOCALIZED: Brass Belt Funnel", "block.create.brass_block": "황동 블럭", "block.create.brass_casing": "황동 케이스", diff --git a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json index 82e15be94..f63747073 100644 --- a/src/generated/resources/assets/create/lang/unfinished/nl_nl.json +++ b/src/generated/resources/assets/create/lang/unfinished/nl_nl.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 714", + "_": "Missing Localizations: 715", "_": "->------------------------] Game Elements [------------------------<-", @@ -29,6 +29,7 @@ "block.create.belt_observer": "Transportband Observeerder", "block.create.birch_window": "UNLOCALIZED: Birch Window", "block.create.birch_window_pane": "UNLOCALIZED: Birch Window Pane", + "block.create.blaze_heater": "UNLOCALIZED: Blaze Heater", "block.create.brass_belt_funnel": "UNLOCALIZED: Brass Belt Funnel", "block.create.brass_block": "UNLOCALIZED: Brass Block", "block.create.brass_casing": "UNLOCALIZED: Brass Casing", diff --git a/src/generated/resources/assets/create/lang/unfinished/pt_br.json b/src/generated/resources/assets/create/lang/unfinished/pt_br.json index 134623835..0bfcce6dc 100644 --- a/src/generated/resources/assets/create/lang/unfinished/pt_br.json +++ b/src/generated/resources/assets/create/lang/unfinished/pt_br.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 784", + "_": "Missing Localizations: 785", "_": "->------------------------] Game Elements [------------------------<-", @@ -29,6 +29,7 @@ "block.create.belt_observer": "Observador de Esteira", "block.create.birch_window": "UNLOCALIZED: Birch Window", "block.create.birch_window_pane": "UNLOCALIZED: Birch Window Pane", + "block.create.blaze_heater": "UNLOCALIZED: Blaze Heater", "block.create.brass_belt_funnel": "UNLOCALIZED: Brass Belt Funnel", "block.create.brass_block": "UNLOCALIZED: Brass Block", "block.create.brass_casing": "UNLOCALIZED: Brass Casing", diff --git a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json index b3f27dba3..9c53dc16d 100644 --- a/src/generated/resources/assets/create/lang/unfinished/ru_ru.json +++ b/src/generated/resources/assets/create/lang/unfinished/ru_ru.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 778", + "_": "Missing Localizations: 779", "_": "->------------------------] Game Elements [------------------------<-", @@ -29,6 +29,7 @@ "block.create.belt_observer": "Ленточный сканер", "block.create.birch_window": "UNLOCALIZED: Birch Window", "block.create.birch_window_pane": "UNLOCALIZED: Birch Window Pane", + "block.create.blaze_heater": "UNLOCALIZED: Blaze Heater", "block.create.brass_belt_funnel": "UNLOCALIZED: Brass Belt Funnel", "block.create.brass_block": "UNLOCALIZED: Brass Block", "block.create.brass_casing": "UNLOCALIZED: Brass Casing", diff --git a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json index 0f1a8b8b8..cb10f3217 100644 --- a/src/generated/resources/assets/create/lang/unfinished/zh_cn.json +++ b/src/generated/resources/assets/create/lang/unfinished/zh_cn.json @@ -1,5 +1,5 @@ { - "_": "Missing Localizations: 40", + "_": "Missing Localizations: 41", "_": "->------------------------] Game Elements [------------------------<-", @@ -29,6 +29,7 @@ "block.create.belt_observer": "传送带侦测器", "block.create.birch_window": "白桦窗户", "block.create.birch_window_pane": "白桦窗户板", + "block.create.blaze_heater": "UNLOCALIZED: Blaze Heater", "block.create.brass_belt_funnel": "UNLOCALIZED: Brass Belt Funnel", "block.create.brass_block": "黄铜块", "block.create.brass_casing": "黄铜机壳", diff --git a/src/generated/resources/assets/create/models/item/blaze_heater.json b/src/generated/resources/assets/create/models/item/blaze_heater.json new file mode 100644 index 000000000..40a3c3428 --- /dev/null +++ b/src/generated/resources/assets/create/models/item/blaze_heater.json @@ -0,0 +1,3 @@ +{ + "parent": "create:block/blaze_heater/block" +} \ No newline at end of file diff --git a/src/generated/resources/data/create/loot_tables/blocks/blaze_heater.json b/src/generated/resources/data/create/loot_tables/blocks/blaze_heater.json new file mode 100644 index 000000000..291dbd019 --- /dev/null +++ b/src/generated/resources/data/create/loot_tables/blocks/blaze_heater.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "create:blaze_heater" + } + ], + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 67b0fd927..83446624d 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -56,6 +56,7 @@ import com.simibubi.create.content.contraptions.fluids.FluidTankBlock; import com.simibubi.create.content.contraptions.fluids.FluidTankModel; import com.simibubi.create.content.contraptions.fluids.PumpBlock; import com.simibubi.create.content.contraptions.processing.BasinBlock; +import com.simibubi.create.content.contraptions.processing.HeaterBlock; import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerBlock; import com.simibubi.create.content.contraptions.relays.advanced.sequencer.SequencedGearshiftBlock; import com.simibubi.create.content.contraptions.relays.advanced.sequencer.SequencedGearshiftGenerator; @@ -142,6 +143,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.model.generators.ConfiguredModel; import net.minecraftforge.common.ToolType; +@SuppressWarnings("unused") public class AllBlocks { private static final CreateRegistrate REGISTRATE = Create.registrate() @@ -204,7 +206,7 @@ public class AllBlocks { public static final BlockEntry ENCASED_SHAFT = REGISTRATE.block("encased_shaft", EncasedShaftBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate(BlockStateGen.axisBlockProvider(true)) .item() @@ -213,7 +215,7 @@ public class AllBlocks { public static final BlockEntry GEARBOX = REGISTRATE.block("gearbox", GearboxBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate(BlockStateGen.axisBlockProvider(true)) .item() @@ -222,7 +224,7 @@ public class AllBlocks { public static final BlockEntry CLUTCH = REGISTRATE.block("clutch", ClutchBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> BlockStateGen.axisBlock(c, p, AssetLookup.forPowered(c, p))) .item() @@ -231,7 +233,7 @@ public class AllBlocks { public static final BlockEntry GEARSHIFT = REGISTRATE.block("gearshift", GearshiftBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> BlockStateGen.axisBlock(c, p, AssetLookup.forPowered(c, p))) .item() @@ -241,7 +243,7 @@ public class AllBlocks { public static final BlockEntry ENCASED_BELT = REGISTRATE.block("encased_belt", EncasedBeltBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> new EncasedBeltGenerator((state, suffix) -> p.models() .getExistingFile(p.modLoc("block/" + c.getName() + "/" + suffix))).generate(c, p)) @@ -252,7 +254,7 @@ public class AllBlocks { public static final BlockEntry ADJUSTABLE_PULLEY = REGISTRATE.block("adjustable_pulley", AdjustablePulleyBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate((c, p) -> new EncasedBeltGenerator((state, suffix) -> { String powered = state.get(AdjustablePulleyBlock.POWERED) ? "_powered" : ""; @@ -287,7 +289,7 @@ public class AllBlocks { public static final BlockEntry WATER_WHEEL = REGISTRATE.block("water_wheel", WaterWheelBlock::new) .initialProperties(SharedProperties::wooden) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .blockstate(BlockStateGen.horizontalWheelProvider(false)) .addLayer(() -> RenderType::getCutoutMipped) .transform(StressConfigDefaults.setCapacity(16.0)) @@ -351,7 +353,7 @@ public class AllBlocks { public static final BlockEntry CRUSHING_WHEEL = REGISTRATE.block("crushing_wheel", CrushingWheelBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .blockstate(BlockStateGen.axisBlockProvider(false)) .addLayer(() -> RenderType::getCutoutMipped) .transform(StressConfigDefaults.setImpact(8.0)) @@ -371,7 +373,7 @@ public class AllBlocks { public static final BlockEntry MECHANICAL_PRESS = REGISTRATE.block("mechanical_press", MechanicalPressBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .blockstate(BlockStateGen.horizontalBlockProvider(true)) .transform(StressConfigDefaults.setImpact(8.0)) .item(BasinOperatorBlockItem::new) @@ -381,7 +383,7 @@ public class AllBlocks { public static final BlockEntry MECHANICAL_MIXER = REGISTRATE.block("mechanical_mixer", MechanicalMixerBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p))) .addLayer(() -> RenderType::getCutoutMipped) .transform(StressConfigDefaults.setImpact(4.0)) @@ -395,6 +397,14 @@ public class AllBlocks { .simpleItem() .register(); + public static final BlockEntry HEATER = REGISTRATE.block("blaze_heater", HeaterBlock::new) + .initialProperties(SharedProperties::softMetal) + .properties(p -> p.lightValue(12)) + .addLayer(() -> RenderType::getCutoutMipped) + .blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p))) + .simpleItem() + .register(); + public static final BlockEntry DEPOT = REGISTRATE.block("depot", DepotBlock::new) .initialProperties(SharedProperties::stone) .blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p))) @@ -521,7 +531,7 @@ public class AllBlocks { public static final BlockEntry CART_ASSEMBLER = REGISTRATE.block("cart_assembler", CartAssemblerBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .blockstate(BlockStateGen.cartAssembler()) .addLayer(() -> RenderType::getCutoutMipped) .tag(BlockTags.RAILS) @@ -532,7 +542,7 @@ public class AllBlocks { public static final BlockEntry REINFORCED_RAIL = REGISTRATE.block("reinforced_rail", ReinforcedRailBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .blockstate(BlockStateGen.reinforcedRail()) .addLayer(() -> RenderType::getCutoutMipped) .tag(BlockTags.RAILS) @@ -643,7 +653,7 @@ public class AllBlocks { public static final BlockEntry MECHANICAL_CRAFTER = REGISTRATE.block("mechanical_crafter", MechanicalCrafterBlock::new) .initialProperties(SharedProperties::softMetal) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .blockstate(BlockStateGen.horizontalBlockProvider(true)) .transform(StressConfigDefaults.setImpact(2.0)) .onRegister(CreateRegistrate.connectedTextures(new CrafterCTBehaviour())) @@ -655,7 +665,7 @@ public class AllBlocks { public static final BlockEntry SEQUENCED_GEARSHIFT = REGISTRATE.block("sequenced_gearshift", SequencedGearshiftBlock::new) .initialProperties(SharedProperties::stone) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate(new SequencedGearshiftGenerator()::generate) .item() @@ -664,7 +674,7 @@ public class AllBlocks { public static final BlockEntry FLYWHEEL = REGISTRATE.block("flywheel", FlywheelBlock::new) .initialProperties(SharedProperties::softMetal) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .transform(StressConfigDefaults.setNoImpact()) .blockstate(new FlywheelGenerator()::generate) .item() @@ -810,7 +820,7 @@ public class AllBlocks { public static final BlockEntry PACKAGER = REGISTRATE.block("packager", PackagerBlock::new) .initialProperties(SharedProperties::softMetal) .transform(StressConfigDefaults.setImpact(4.0)) - .properties(p -> p.nonOpaque()) + .properties(Block.Properties::nonOpaque) .blockstate((c, p) -> p.getVariantBuilder(c.get()) .forAllStates(s -> ConfiguredModel.builder() .modelFile(AssetLookup.partialBaseModel(c, p)) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java index 4857f4db6..5b5e2d081 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java @@ -1,6 +1,5 @@ package com.simibubi.create.content.contraptions.components.mixer; - import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.contraptions.processing.BasinTileEntity.BasinInputInventory; import com.simibubi.create.content.contraptions.processing.ProcessingIngredient; @@ -19,81 +18,80 @@ import java.util.*; public class MixingRecipe extends ProcessingRecipe { - public MixingRecipe(ResourceLocation id, String group, List ingredients, - List results, int processingDuration, List fluidIngredients, - List fluidResults, int requiredHeat) { - super(AllRecipeTypes.MIXING, id, group, ingredients, results, processingDuration, fluidIngredients, - fluidResults, requiredHeat); - } + public MixingRecipe(ResourceLocation id, String group, List ingredients, + List results, int processingDuration, List fluidIngredients, + List fluidResults, int requiredHeat) { + super(AllRecipeTypes.MIXING, id, group, ingredients, results, processingDuration, fluidIngredients, + fluidResults, requiredHeat); + } - public static MixingRecipe of(IRecipe recipe) { - return new MixingRecipe(recipe.getId(), recipe.getGroup(), ProcessingIngredient.list(recipe.getIngredients()), - Collections.singletonList(new ProcessingOutput(recipe.getRecipeOutput(), 1)), -1, null, null, 0); - } + public static MixingRecipe of(IRecipe recipe) { + return new MixingRecipe(recipe.getId(), recipe.getGroup(), ProcessingIngredient.list(recipe.getIngredients()), + Collections.singletonList(new ProcessingOutput(recipe.getRecipeOutput(), 1)), -1, null, null, 0); + } - @Override - protected int getMaxInputCount() { - return 9; - } + @Override + protected int getMaxInputCount() { + return 9; + } - @Override - protected int getMaxOutputCount() { - return 1; - } + @Override + protected int getMaxOutputCount() { + return 1; + } - @Override - protected boolean canHaveCatalysts() { - return true; - } + @Override + protected boolean canHaveCatalysts() { + return true; + } - @Override - public boolean matches(BasinInputInventory inv, @Nonnull World worldIn) { - if (inv.isEmpty()) - return false; + @Override + public boolean matches(BasinInputInventory inv, @Nonnull World worldIn) { + if (inv.isEmpty()) + return false; - NonNullList ingredients = this.getIngredients(); - if (!ingredients.stream() - .allMatch(Ingredient::isSimple)) - return false; + NonNullList ingredients = this.getIngredients(); + if (!ingredients.stream() + .allMatch(Ingredient::isSimple)) + return false; - List remaining = new ArrayList<>(); - for (int slot = 0; slot < inv.getSizeInventory(); ++slot) { - ItemStack itemstack = inv.getStackInSlot(slot); - if (!itemstack.isEmpty()) { - remaining.add(itemstack.copy()); - } - } + List remaining = new ArrayList<>(); + for (int slot = 0; slot < inv.getSizeInventory(); ++slot) { + ItemStack itemstack = inv.getStackInSlot(slot); + if (!itemstack.isEmpty()) { + remaining.add(itemstack.copy()); + } + } - // sort by leniency - List sortedIngredients = new LinkedList<>(ingredients); - sortedIngredients.sort(Comparator.comparingInt(i -> i.getMatchingStacks().length)); - Ingredients: - for (Ingredient ingredient : sortedIngredients) { - for (ItemStack stack : remaining) { - if (stack.isEmpty()) - continue; - if (ingredient.test(stack)) { - stack.shrink(1); - continue Ingredients; - } - } - return false; - } - return true; - } + // sort by leniency + List sortedIngredients = new LinkedList<>(ingredients); + sortedIngredients.sort(Comparator.comparingInt(i -> i.getMatchingStacks().length)); + Ingredients: for (Ingredient ingredient : sortedIngredients) { + for (ItemStack stack : remaining) { + if (stack.isEmpty()) + continue; + if (ingredient.test(stack)) { + stack.shrink(1); + continue Ingredients; + } + } + return false; + } + return true; + } - @Override - protected boolean canHaveFluidIngredient() { - return true; - } + @Override + protected boolean canHaveFluidIngredient() { + return true; + } - @Override - protected boolean canHaveFluidOutput() { - return true; - } + @Override + protected boolean canHaveFluidOutput() { + return true; + } - @Override - protected boolean requiresHeating() { - return this.requiredHeat > 0; - } + @Override + protected boolean requiresHeating() { + return this.requiredHeat > 0; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java new file mode 100644 index 000000000..781b6fd99 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java @@ -0,0 +1,11 @@ +package com.simibubi.create.content.contraptions.processing; + + +import net.minecraft.block.Block; + +public class HeaterBlock extends Block { + + public HeaterBlock(Properties properties) { + super(properties); + } +} diff --git a/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java b/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java index 4b0c993a8..ad0f06f01 100644 --- a/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java @@ -21,6 +21,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.mou import com.simibubi.create.content.contraptions.components.tracks.ReinforcedRailBlock; import com.simibubi.create.content.contraptions.fluids.FluidPipeBlock; import com.simibubi.create.content.contraptions.fluids.FluidTankBlock; +import com.simibubi.create.content.contraptions.processing.HeaterBlock; import com.simibubi.create.content.logistics.block.belts.observer.BeltObserverBlock; import com.simibubi.create.content.palettes.PavedBlock; import com.simibubi.create.foundation.utility.Iterate; @@ -212,6 +213,10 @@ public class BlockStateGen { .build(); }); } + + public static NonNullBiConsumer, RegistrateBlockstateProvider> blazeHeater(){ + return (c, p) -> ConfiguredModel.builder().modelFile(p.models().getExistingFile(p.modLoc("block/" + c.getName() + "/block"))).build(); + } public static NonNullBiConsumer, RegistrateBlockstateProvider> reinforcedRail() { return (c, p) -> p.getVariantBuilder(c.get()) diff --git a/src/main/java/com/simibubi/create/foundation/data/SharedProperties.java b/src/main/java/com/simibubi/create/foundation/data/SharedProperties.java index 2c25c51bd..f5f82a7f6 100644 --- a/src/main/java/com/simibubi/create/foundation/data/SharedProperties.java +++ b/src/main/java/com/simibubi/create/foundation/data/SharedProperties.java @@ -1,13 +1,15 @@ package com.simibubi.create.foundation.data; +import mcp.MethodsReturnNonnullByDefault; + import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.block.material.Material; import net.minecraft.block.material.MaterialColor; import net.minecraft.block.material.PushReaction; +@MethodsReturnNonnullByDefault public class SharedProperties { - public static Material beltMaterial = new Material(MaterialColor.GRAY, false, true, true, true, true, false, false, PushReaction.NORMAL); @@ -22,5 +24,4 @@ public class SharedProperties { public static Block wooden() { return Blocks.STRIPPED_SPRUCE_WOOD; } - } diff --git a/src/main/resources/assets/create/models/block/blaze_heater/block.json b/src/main/resources/assets/create/models/block/blaze_heater/block.json new file mode 100644 index 000000000..5f2cc3495 --- /dev/null +++ b/src/main/resources/assets/create/models/block/blaze_heater/block.json @@ -0,0 +1,236 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "create:block/blaze_heater_brazier", + "particle": "create:block/blaze_heater_brazier" + }, + "elements": [ + { + "name": "Brazier Sides 1", + "from": [2, 5, 2], + "to": [14, 14, 14], + "faces": { + "north": {"uv": [1.5, 2, 6.5, 5.5], "texture": "#0"}, + "east": {"uv": [1.5, 2, 6.5, 5.5], "texture": "#0"}, + "south": {"uv": [1.5, 2, 6.5, 5.5], "texture": "#0"}, + "west": {"uv": [1.5, 2, 6.5, 5.5], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "down": {"uv": [0, 0, 12, 12], "texture": "#0"} + } + }, + { + "name": "Brazier Sides 2", + "from": [1, 5, 2], + "to": [2, 14, 14], + "faces": { + "north": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "east": {"uv": [1.5, 2, 6.5, 5.5], "texture": "#0"}, + "south": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "west": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "down": {"uv": [0, 0, 12, 12], "texture": "#0"} + } + }, + { + "name": "Brazier Sides 3", + "from": [2, 5, 14], + "to": [14, 14, 15], + "faces": { + "north": {"uv": [1.5, 2, 6.5, 5.5], "texture": "#0"}, + "east": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "south": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "west": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 0, 12, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Brazier Sides 4", + "from": [14, 5, 2], + "to": [15, 14, 14], + "faces": { + "north": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "east": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "south": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "west": {"uv": [1.5, 2, 6.5, 5.5], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 0, 12, 12], "rotation": 180, "texture": "#0"} + } + }, + { + "name": "Brazier Sides 5", + "from": [2, 5, 1], + "to": [14, 14, 2], + "faces": { + "north": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "east": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "south": {"uv": [1.5, 2, 6.5, 5.5], "texture": "#0"}, + "west": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 0, 12, 12], "rotation": 270, "texture": "#0"} + } + }, + { + "name": "Brazier Spikes 1", + "from": [2, 14, 2], + "to": [14, 17, 3], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 14, 2]}, + "faces": { + "north": {"uv": [1.5, 0.5, 6.5, 2], "texture": "#0"}, + "east": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "south": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "west": {"uv": [0, 0, 1, 3], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "down": {"uv": [8, 8, 16, 16], "texture": "#0"} + } + }, + { + "name": "Brazier Spikes 1b", + "from": [2, 14, 1], + "to": [14, 17, 2], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 14, 2]}, + "faces": { + "north": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "east": {"uv": [0, 0, 1, 3], "texture": "#0"}, + "south": {"uv": [1.5, 0.5, 6.5, 2], "texture": "#0"}, + "west": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "rotation": 180, "texture": "#0"}, + "down": {"uv": [8, 8, 16, 16], "rotation": 180, "texture": "#0"} + } + }, + { + "name": "Brazier Spikes 2", + "from": [2, 14, 2], + "to": [3, 17, 14], + "rotation": {"angle": 45, "axis": "z", "origin": [2, 14, 8]}, + "faces": { + "north": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "east": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 1, 3], "texture": "#0"}, + "west": {"uv": [1.5, 0.5, 6.5, 2], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "rotation": 270, "texture": "#0"}, + "down": {"uv": [8, 8, 16, 16], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Brazier Spikes 2b", + "from": [1, 14, 2], + "to": [2, 17, 14], + "rotation": {"angle": 45, "axis": "z", "origin": [2, 14, 8]}, + "faces": { + "north": {"uv": [0, 0, 1, 3], "texture": "#0"}, + "east": {"uv": [1.5, 0.5, 6.5, 2], "texture": "#0"}, + "south": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "west": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "rotation": 90, "texture": "#0"}, + "down": {"uv": [8, 8, 16, 16], "rotation": 270, "texture": "#0"} + } + }, + { + "name": "Brazier Spikes 3", + "from": [2, 14, 13], + "to": [14, 17, 14], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 14, 14]}, + "faces": { + "north": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "east": {"uv": [0, 0, 1, 3], "texture": "#0"}, + "south": {"uv": [1.5, 0.5, 6.5, 2], "texture": "#0"}, + "west": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "rotation": 180, "texture": "#0"}, + "down": {"uv": [8, 8, 16, 16], "rotation": 180, "texture": "#0"} + } + }, + { + "name": "Brazier Spikes 3b", + "from": [2, 14, 14], + "to": [14, 17, 15], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 14, 14]}, + "faces": { + "north": {"uv": [1.5, 0.5, 6.5, 2], "texture": "#0"}, + "east": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "south": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "west": {"uv": [0, 0, 1, 3], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "down": {"uv": [8, 8, 16, 16], "texture": "#0"} + } + }, + { + "name": "Brazier Spikes 4", + "from": [14, 14, 2], + "to": [17, 15, 14], + "rotation": {"angle": 45, "axis": "z", "origin": [14, 14, 8]}, + "faces": { + "north": {"uv": [0, 0, 1, 3], "rotation": 270, "texture": "#0"}, + "east": {"uv": [8, 8, 16, 16], "rotation": 180, "texture": "#0"}, + "south": {"uv": [8, 8, 16, 16], "rotation": 90, "texture": "#0"}, + "west": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "up": {"uv": [8, 8, 16, 16], "rotation": 90, "texture": "#0"}, + "down": {"uv": [1.5, 0.5, 6.5, 2], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Brazier Spikes 4b", + "from": [14, 13, 2], + "to": [17, 14, 14], + "rotation": {"angle": 45, "axis": "z", "origin": [14, 14, 8]}, + "faces": { + "north": {"uv": [8, 8, 16, 16], "rotation": 270, "texture": "#0"}, + "east": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 1, 3], "rotation": 90, "texture": "#0"}, + "west": {"uv": [8, 8, 16, 16], "rotation": 180, "texture": "#0"}, + "up": {"uv": [1.5, 0.5, 6.5, 2], "rotation": 90, "texture": "#0"}, + "down": {"uv": [8, 8, 16, 16], "rotation": 90, "texture": "#0"} + } + }, + { + "name": "Base", + "from": [0, 0, 0], + "to": [16, 4, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [0.5, 8, 0.5]}, + "faces": { + "north": {"uv": [0, 6, 8, 8], "texture": "#0"}, + "east": {"uv": [0, 6, 8, 8], "texture": "#0"}, + "south": {"uv": [0, 6, 8, 8], "texture": "#0"}, + "west": {"uv": [0, 6, 8, 8], "texture": "#0"}, + "up": {"uv": [0, 8, 8, 16], "texture": "#0"}, + "down": {"uv": [0, 8, 8, 16], "texture": "#0"} + } + }, + { + "name": "Brazier bottom", + "from": [2, 4, 2], + "to": [14, 5, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [2.5, 8, 2.5]}, + "faces": { + "north": {"uv": [1.5, 5.5, 6.5, 6], "texture": "#0"}, + "east": {"uv": [1.5, 5.5, 6.5, 6], "texture": "#0"}, + "south": {"uv": [1.5, 5.5, 6.5, 6], "texture": "#0"}, + "west": {"uv": [1.5, 5.5, 6.5, 6], "texture": "#0"}, + "up": {"uv": [9, 1, 15, 7], "texture": "#0"}, + "down": {"uv": [8, 8, 16, 16], "texture": "#0"} + } + } + ], + "groups": [ + { + "name": "Brazier", + "origin": [0.5, 0.5, 0.5], + "children": [ + { + "name": "Brazier Sides", + "origin": [0.5, 0.5, 0.5], + "children": [0, 1, 2, 3, 4] + }, + { + "name": "Brazier Spikes", + "origin": [0.5, 0.5, 0.5], + "children": [5, 6, 7, 8, 9, 10, 11, 12] + }, 13, 14] + }, + { + "name": "Blazes", + "origin": [8, 8, 8], + "children": [15, 16, 17, 18] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/textures/block/blaze_heater_brazier.png b/src/main/resources/assets/create/textures/block/blaze_heater_brazier.png new file mode 100644 index 0000000000000000000000000000000000000000..5bb9f3d3754fc3df4a875debda01430f60bc58b7 GIT binary patch literal 4973 zcmV-z6O!zSP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3#tk}RnWh5xe(FM*c;Er(}>ci`pw6Pf+Gb3Go1 zrz@%|izET*NJmHQ_P_pl+&}nBp?a64wxXqY{<3C`or~t5zkWZ1&-e5G#rGD!e~i1& z8)!JYutT@^y2ny=Tbg*{xN=v?>}t*K+WFgtai?Rtn0a8 za(RvVFy&q`ZqRZo{+-|J)E%b_Y9LG=C~s` z#u#TzVLApIU}&7lUs!pC6Km46fI6m0I3z~n=UKwtR_}H*G&WwLIie@9Sm2TW>*fB+ zq;o8xLh$X=SDY(arf~{GE(GTT(?BGg*Qs(H{PFtr&u~p3DA&ym1G^u#0`LzBU%{0w z(20q{_mjY(u6F@k#0iAMgaiVh!7wo6-Pog5bA)Hvk*TuH)5zuk}M)csx(pQB^ArCQfe_q?KRb0rIuQ2 zt6IBjspTfEwAxzJ)-`H^aYe~TZK~Qkn|4<2Jl&bl`-mfrJY}Wv9d)OFqV~f2hu8mrT6j^5 z7b%-qKT%_}){iBE(TNylAQp1~@M;KzTQ*S(JLM*koGt{hHO?)TjKuieTCwOZe`gam9y`@ zg@6RU)#S)nbCn^iqy^&uVY5iFk1;~ip_x*&$`;~au86lHKFbnv*X5+_jv(;(uM1^i z!TECqQRNO?&g2PHV%#XeoO{291~XLH1!u58b6rRFVJjF{Sy5neiIF`-dY`LyFV)yN zq&>^(vUgeBtsuq;@X?apt89nk=TO|zkJjDGYD134U7Z=T5=ZT97-jFX)4~5~cip9` zZ2}uf>0~XD-Sm|8_@qEB6|j$_IU)`$#2bdyUYpK*Mi>Ov&}n7*+#^-R^%xk$?Rs({ zG1BHtMBHQ#W~WiQjLxoIh~CjvZL!6wScWYT4wZU6h$IOeADIiq^c3;YwT#SlWO^dc zKm~1XdT*89(F=XxTh=1V2(U`_huxNNHo}4e1=W_eE2#F9Es*B==^`}CI2=iJ zR|SW$d>OM9Ql$EI9aXQR0%tKtjT=|sT82d&MpBh<&8ZbuJCy5ryq>iQsm{UOK{5@= z^~WSi=rf1CbzPqyNTB?Pg7o2X@-}P-K_pxnq+)nz#n35Z<0~A{c?=K~n=QA3=GnQ0 z!T>5@B|oH(+!%0@iB1TDIEAr1Hw=>wCv{JRkfAtrlSm_3fQH;^iEtW`4|=3f*-+!i zj*R5)gnL`z{1}0B!6`F>3wfNES6B{|xdi|-W9F(FY)hj9Z8B3G&SN7%MzZ#`akqsM z;)IAE5=Y#lw@J}76K2Qp5Zc^xhDACMgFUR;*kd5rEn9|?HG?D^l@tx*gIMMdVu|n> z)GG*KNUubTSTTZt9bM1UACeS1h`+XCY|G<}ei_$XLIUwLeAyeU9SOQ_`L1!raG(n! zH>~6``m4;i9+JS>m{wphAOg-(?YWU+A!8(&_mSkd-7?2~DA$J&hudaQ3227P7Pt&o z^~Gu<8?Prqp&B1D4X_DYqFLJZQH{3i9OSr6ail_t1Rd?xFc}Udfy3GJGbK=t1*Sex z`yqE=fAS7j!)vhpvQh%;xF+d3Gas_!6yBVilo(du^U)7*8q0yCE)tB>;b$B@zy%v- zJl!pV9ls2tJji-Lp^x#5$;y*RPipyY&t|##UX49{#Fs1CdfW>RH5*bym(td;fztA2%}Q;l zuvdkPt5xCivU4R#7N|`K|JI3{;&IntZZ)n`J8Z21p>TboWKP_H00$gYxUpj#RM|Wb z5q7i<(%K8$H%kLKoNC#g3L&yDiI9-kp+PBLcURW3Zj;Ejkb(>yBh4_g5Uog5$|7Ze zC2dopnU&-64GTzFp*=e_CK_gXGiaZK2UQ-WK;mtovOyf?eK>Avf`0oVqG?RRJj+N} z?3zHf$~#O!NBKNZlNC>+Fv}o3jkdnk_3i*8+3qqSo=MVL z84-9A`q~UacxL%=FW6R=bxz7_Yvx>uu4V7o0E1pAbS!Ji> zk8}(BZwG&KA2GV{Y__no|7NfWz#u1}+GH$j3}n@8Un;p(%w&UDY+7vuL92ip)9hDU zpOx;ZdeL^nUvfQoEy5;xeMNsJ{7m|oYd^1@{ZRW+zixa3EQ)E#nljgQeg6^JM=cWxj+=PvKy`@A&c z1F`}J#BY(}b(VK%8Tway7Wct;NLm>2P*SBNx*jSE>i2%FlSp}@B^o7YqZu=11s4x$ z?ZJxMzE{-}l2Br$5TFNC9!Tme=x zS>PH$3fFFAH(QY0G={rRR7p%Eag=oZ09lxSWaO#`*C1=4Sl#m!??zX2W5Y#|P% zny6kJ=sMyW)=GGD7eO>Jxma_9^+<_OP@~7e^C+`<$|y5YMdE`nxF-rE4q4=7Hkn|Y zd<_XNUE7t#Ot34*7lfFtN51U+_`&|~b`kc*mGLQq%_kZH%g~cdJyX@`63H`SO5J=z zmLP^}uuxeVtuQu%68&eLk`-u*ff;AY2zYS-F1c+iUZ+>Rk^NZPtQWStr6EMUHIsrZ zu1QZzb82GCr0pBbWIad)$yfdZADnH>3I9I07awgHF$Uxo*1YYin?&n&IZ^c6K4}4P z>;OofAIDu%Ti9775M8gC66d_N%t~scvmaDo8UsG7wHb=t7Dkwoh;8`6-3AB!vFOiD zq7%<%EoVmh()87Hzi53A5uPqZL2J0hzSe>bZyY-_h{mZH-CVg&Gw#EKuSKT36(d_Q zpyrA7-M4#M`A&#Wptv9phc6Q{N+=h(-=TCRz8iF8;Zm_(DYOy zqsgyp6ZI(C%eEHOG(9&r-M1e!W_5t`Sw#g=u2N4b(j+dW}0000P zbVXQnLvL+uWo~o;Lvm$dbY)~9cWHEJAV*0}P*;Ht7XSbT*GWV{R9M5EmtBY?R~5&9 zRb3yq>UP(B^z`iPW`igZloebeD+@tFG=d6(hz}C<%@2!Ym`EYEQOZr|<$;JPjV&%YN|ZMkRF&XQE~##>=!+jp#@C`=F+FYe&^ zKECJSdmdSyqm&}cbB4nqQc8pn42MHp$1y=@tx-x*mL+z5S)OMc9u9cw@*cy{A@98V z4*!1Rb?)rlHae|S@;oEYGZXAu6q#4~o`tfqBuHyipltM~Luh+u~ zgur!O@;u`QPZmUhU{)kN`z^^dZ2`H_J^e(=G}Zj(ZxLazC|6rblWMUn;jAcdT$gSX zk!g*HA}ru&Iwg){I-L$mDS$-@0OEMcFaO-Ce9z+Cx%2$um1&jbEdWmIgkM@os@dM| za;y|>DG9BLQL3pDMYk>SeV>jDv1G`2G-T!ntVI#S;m`z{Y+({v8NY2DBMG$6|~qy1e5gTXQb8GezGlqJ6JvnfL?Ds-Y~3xU!p zM=C)|*~pgjg~uP~z1=;2^_LJKe4hE*j8L|@_Ul_D$s$cZ{^ky$Y$HOKpZ;OW#>OTW z&Yx#{yUVQ?UO;P2TL{L9!kHIDRz*5KdFd?ESgFFPN-V$=!j#S)A02Ugd<<2^(b0tK zH>kRsTZExJL3=NtySc^n8&p}QS&KSMCKIIZ)9dxf@|^v_fFjTFJP(~MUznwEG$2zk z<@y$3yF->JL(R673kJc z$AE8E6m&Wr!*6uVI8BhunFk#@7I=0^-w$vri#U!AbDWL!b&lc$8Mb-;Rj>N|<_DJJ zN`CZJo7;nhlWDr3(qI2M;2)!pRkod204mE2rP@LumSCLQ73FkH;kmdL*q$KOnoVCo z;PG}0aU7$R!usN4kFk0FVV?d{%=H^o{eGXFogGw?kf>t-LfJ-!A^m=zP889Wkrf01 zqy1g_gF&?xMGauNSxPn;BRr4x#wK1U>8q42tK{v&Famo^>ESamA!R{@>mPIxhlVyt>kzUMI<4h^rh*7T1Pik8D9%Q+s8m?Q~7 zp7P&=Az7Z|dmeHLLhH(vD;2>p75XO?n*Db1e4f7G+t| z>-9{gwARFNj8hZ^7cM-s1Vv~r);c+(JN@nE&6{|>Z!Q!0&~LNyB-qUteFN)v_rv-Kc+CN)DGL@qC|IQIO@i z8B8?=wbpbxodpf|_U>>plyt-4>EE>+9GvLu`U@dAR?09#2*G4JHB+)avno!o1mORJ z0oQf;?vtSfkSJ^AM2}Ebi&3uDf%S&{;@cwAPEizGzWh1vC)4Tlffz_fEx!M~C+=(i z!Dw_wH|ZY%@W+?mKf%D8Z~ljmA~goGbOylhUjF+>vVY{rDn$fi^1&@;sxe=H}%pNthJ{vz3MPen3+?XB^MTGt0dEU>Glg z()k(NMhWU&4#2Wn1YuyD*LZl4D4m-ucz(rp6rMQG?`?0_ELaU<6_6k1yk@~_5UYTE zkn=MbsMmAP^Ko3)IIqjG8c2cNZx-tC r^kM55z}G)*Tlcfi^;vsQH0}QfzJ;qM!`+pT00000NkvXXu0mjfU)z2} literal 0 HcmV?d00001 From 12595490c7000c35519be07e58b32662a6b89739 Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Sun, 12 Jul 2020 13:13:43 +0200 Subject: [PATCH 4/4] Heater functionality: - Heated Mixing: Mixing can now require the player to heat the basin (with either the usual fan heaters for a heat level of 1 or the blaze heater for higher heat levels) - Made mixing brass ingots from copper and zinc ingots require heating (as example) - added the blaze heater to valid fan heaters - added TE renderer for fan heater to display a blaze head always facing the player - added fueling of blaze heater with furnace fuel (onUse event, not with inventory to challenge the automation. To be discussed.) todo: - add heat requirement display to JEI - better item model for blaze heater - new special fuel for higher heat levels - fan stoking --- src/generated/resources/.cache/cache | 1 + .../data/create/tags/blocks/fan_heaters.json | 6 ++ .../com/simibubi/create/AllBlockPartials.java | 97 +++++++----------- .../java/com/simibubi/create/AllBlocks.java | 13 +-- .../com/simibubi/create/AllTileEntities.java | 12 ++- .../mixer/MechanicalMixerTileEntity.java | 14 ++- .../components/mixer/MixingRecipe.java | 4 + .../contraptions/processing/HeaterBlock.java | 55 +++++++++- .../processing/HeaterRenderer.java | 53 ++++++++++ .../processing/HeaterTileEntity.java | 91 ++++++++++++++++ .../models/block/blaze_heater/blaze/four.json | 29 ++++++ .../models/block/blaze_heater/blaze/one.json | 28 +++++ .../block/blaze_heater/blaze/three.json | 29 ++++++ .../models/block/blaze_heater/blaze/two.json | 29 ++++++ .../create/textures/block/tamed_blaze.png | Bin 0 -> 1538 bytes .../create/recipes/mixing/brass_ingot.json | 3 +- 16 files changed, 385 insertions(+), 79 deletions(-) create mode 100644 src/generated/resources/data/create/tags/blocks/fan_heaters.json create mode 100644 src/main/java/com/simibubi/create/content/contraptions/processing/HeaterRenderer.java create mode 100644 src/main/java/com/simibubi/create/content/contraptions/processing/HeaterTileEntity.java create mode 100644 src/main/resources/assets/create/models/block/blaze_heater/blaze/four.json create mode 100644 src/main/resources/assets/create/models/block/blaze_heater/blaze/one.json create mode 100644 src/main/resources/assets/create/models/block/blaze_heater/blaze/three.json create mode 100644 src/main/resources/assets/create/models/block/blaze_heater/blaze/two.json create mode 100644 src/main/resources/assets/create/textures/block/tamed_blaze.png diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index 045150eed..8d7d1c8ad 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -2479,6 +2479,7 @@ d3fdb8ece6cb072a93ddb64a0baad5ac952117a4 data\create\recipes\weathered_limestone 11667414f73bc2d00bda7c5c1a7d2934bf6e9165 data\create\recipes\weathered_limestone_pillar_from_weathered_limestone_stonecutting.json 266f08e604d229a9d2b46f7272c0b06ec270bf3d data\create\recipes\zinc_block.json 403576ae5710d4fe731144fe623b1673093076ea data\create\tags\blocks\brittle.json +06d3931993d4f61713390416f1e6fe1a0b5aaf43 data\create\tags\blocks\fan_heaters.json 081f5aa35602fc27af2ca01ea9f2fd5e7eb284dc data\create\tags\items\create_ingots.json d2dc4ff179ef7b2aa9276455c196e15d44aa95a8 data\create\tags\items\crushed_ores.json 16bcb8fcbe9170c2c11f1ca8d99d8b36cd812bbd data\forge\tags\blocks\glass\colorless.json diff --git a/src/generated/resources/data/create/tags/blocks/fan_heaters.json b/src/generated/resources/data/create/tags/blocks/fan_heaters.json new file mode 100644 index 000000000..2cf03ca08 --- /dev/null +++ b/src/generated/resources/data/create/tags/blocks/fan_heaters.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "create:blaze_heater" + ] +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllBlockPartials.java b/src/main/java/com/simibubi/create/AllBlockPartials.java index b2ad31f85..8494fd77f 100644 --- a/src/main/java/com/simibubi/create/AllBlockPartials.java +++ b/src/main/java/com/simibubi/create/AllBlockPartials.java @@ -27,78 +27,54 @@ import net.minecraftforge.client.model.ModelLoader; public class AllBlockPartials { private static List all = new ArrayList<>(); - - public static final AllBlockPartials - SCHEMATICANNON_CONNECTOR = get("schematicannon/connector"), + + public static final AllBlockPartials SCHEMATICANNON_CONNECTOR = get("schematicannon/connector"), SCHEMATICANNON_PIPE = get("schematicannon/pipe"), - SHAFTLESS_COGWHEEL = get("cogwheel_shaftless"), - BELT_PULLEY = get("belt_pulley"), + SHAFTLESS_COGWHEEL = get("cogwheel_shaftless"), BELT_PULLEY = get("belt_pulley"), SHAFT_HALF = get("shaft_half"), - ENCASED_FAN_INNER = get("encased_fan/propeller"), - HAND_CRANK_HANDLE = get("hand_crank/handle"), - MECHANICAL_PRESS_HEAD = get("mechanical_press/head"), - MECHANICAL_MIXER_POLE = get("mechanical_mixer/pole"), - MECHANICAL_MIXER_HEAD = get("mechanical_mixer/head"), + ENCASED_FAN_INNER = get("encased_fan/propeller"), HAND_CRANK_HANDLE = get("hand_crank/handle"), + MECHANICAL_PRESS_HEAD = get("mechanical_press/head"), MECHANICAL_MIXER_POLE = get("mechanical_mixer/pole"), + MECHANICAL_MIXER_HEAD = get("mechanical_mixer/head"), BLAZE_HEATER_BLAZE_ONE = get("blaze_heater/blaze/one"), + BLAZE_HEATER_BLAZE_TWO = get("blaze_heater/blaze/two"), + BLAZE_HEATER_BLAZE_THREE = get("blaze_heater/blaze/three"), + BLAZE_HEATER_BLAZE_FOUR = get("blaze_heater/blaze/four"), MECHANICAL_CRAFTER_LID = get("mechanical_crafter/lid"), MECHANICAL_CRAFTER_ARROW = get("mechanical_crafter/arrow"), MECHANICAL_CRAFTER_BELT_FRAME = get("mechanical_crafter/belt"), - MECHANICAL_CRAFTER_BELT = get("mechanical_crafter/belt_animated"), - GAUGE_DIAL = get("gauge/dial"), - GAUGE_INDICATOR = get("gauge/indicator"), - GAUGE_HEAD_SPEED = get("gauge/speedometer/head"), - GAUGE_HEAD_STRESS = get("gauge/stressometer/head"), - BEARING_TOP = get("bearing/top"), - DRILL_HEAD = get("mechanical_drill/head"), - HARVESTER_BLADE = get("mechanical_harvester/blade"), - DEPLOYER_POLE = get("deployer/pole"), - DEPLOYER_HAND_POINTING = get("deployer/hand_pointing"), - DEPLOYER_HAND_PUNCHING = get("deployer/hand_punching"), - DEPLOYER_HAND_HOLDING = get("deployer/hand_holding"), - ANALOG_LEVER_HANDLE = get("analog_lever/handle"), - ANALOG_LEVER_INDICATOR = get("analog_lever/indicator"), - BELT_FUNNEL_FLAP = get("belt_funnel/flap"), - BELT_TUNNEL_FLAP = get("belt_tunnel/flap"), - BELT_TUNNEL_INDICATOR = get("belt_tunnel/indicator"), - FLEXPEATER_INDICATOR = get("diodes/indicator"), - FLYWHEEL = get("flywheel/wheel"), - FLYWHEEL_UPPER_ROTATING = get("flywheel/upper_rotating_connector"), + MECHANICAL_CRAFTER_BELT = get("mechanical_crafter/belt_animated"), GAUGE_DIAL = get("gauge/dial"), + GAUGE_INDICATOR = get("gauge/indicator"), GAUGE_HEAD_SPEED = get("gauge/speedometer/head"), + GAUGE_HEAD_STRESS = get("gauge/stressometer/head"), BEARING_TOP = get("bearing/top"), + DRILL_HEAD = get("mechanical_drill/head"), HARVESTER_BLADE = get("mechanical_harvester/blade"), + DEPLOYER_POLE = get("deployer/pole"), DEPLOYER_HAND_POINTING = get("deployer/hand_pointing"), + DEPLOYER_HAND_PUNCHING = get("deployer/hand_punching"), DEPLOYER_HAND_HOLDING = get("deployer/hand_holding"), + ANALOG_LEVER_HANDLE = get("analog_lever/handle"), ANALOG_LEVER_INDICATOR = get("analog_lever/indicator"), + BELT_FUNNEL_FLAP = get("belt_funnel/flap"), BELT_TUNNEL_FLAP = get("belt_tunnel/flap"), + BELT_TUNNEL_INDICATOR = get("belt_tunnel/indicator"), FLEXPEATER_INDICATOR = get("diodes/indicator"), + FLYWHEEL = get("flywheel/wheel"), FLYWHEEL_UPPER_ROTATING = get("flywheel/upper_rotating_connector"), FLYWHEEL_LOWER_ROTATING = get("flywheel/lower_rotating_connector"), FLYWHEEL_UPPER_SLIDING = get("flywheel/upper_sliding_connector"), FLYWHEEL_LOWER_SLIDING = get("flywheel/lower_sliding_connector"), - FURNACE_GENERATOR_FRAME = get("furnace_engine/frame"), - CUCKOO_MINUTE_HAND = get("cuckoo_clock/minute_hand"), - CUCKOO_HOUR_HAND = get("cuckoo_clock/hour_hand"), - CUCKOO_LEFT_DOOR = get("cuckoo_clock/left_door"), - CUCKOO_RIGHT_DOOR = get("cuckoo_clock/right_door"), - CUCKOO_PIG = get("cuckoo_clock/pig"), - CUCKOO_CREEPER = get("cuckoo_clock/creeper"), - ROPE_COIL = get("rope_pulley/rope_coil"), - ROPE_HALF = get("rope_pulley/rope_half"), - ROPE_HALF_MAGNET = get("rope_pulley/rope_half_magnet"), - MILLSTONE_COG = get("millstone/inner"), - PACKAGER_SEALER = get("packager/sealer"), + FURNACE_GENERATOR_FRAME = get("furnace_engine/frame"), CUCKOO_MINUTE_HAND = get("cuckoo_clock/minute_hand"), + CUCKOO_HOUR_HAND = get("cuckoo_clock/hour_hand"), CUCKOO_LEFT_DOOR = get("cuckoo_clock/left_door"), + CUCKOO_RIGHT_DOOR = get("cuckoo_clock/right_door"), CUCKOO_PIG = get("cuckoo_clock/pig"), + CUCKOO_CREEPER = get("cuckoo_clock/creeper"), ROPE_COIL = get("rope_pulley/rope_coil"), + ROPE_HALF = get("rope_pulley/rope_half"), ROPE_HALF_MAGNET = get("rope_pulley/rope_half_magnet"), + MILLSTONE_COG = get("millstone/inner"), PACKAGER_SEALER = get("packager/sealer"), - SYMMETRY_PLANE = get("symmetry_effect/plane"), - SYMMETRY_CROSSPLANE = get("symmetry_effect/crossplane"), + SYMMETRY_PLANE = get("symmetry_effect/plane"), SYMMETRY_CROSSPLANE = get("symmetry_effect/crossplane"), SYMMETRY_TRIPLEPLANE = get("symmetry_effect/tripleplane"), - ARM_COG = get("mechanical_arm/cog"), - ARM_BASE = get("mechanical_arm/base"), - ARM_LOWER_BODY = get("mechanical_arm/lower_body"), - ARM_UPPER_BODY = get("mechanical_arm/upper_body"), - ARM_HEAD = get("mechanical_arm/head"), - ARM_CLAW_BASE = get("mechanical_arm/claw_base"), - ARM_CLAW_GRIP = get("mechanical_arm/claw_grip"), - - FLAG_SHORT_IN = get("mechanical_arm/flag/short_in"), - FLAG_SHORT_OUT = get("mechanical_arm/flag/short_out"), - FLAG_LONG_IN = get("mechanical_arm/flag/long_in"), - FLAG_LONG_OUT = get("mechanical_arm/flag/long_out"), - - MECHANICAL_PUMP_ARROW = get("mechanical_pump/arrow"), - MECHANICAL_PUMP_COG = get("mechanical_pump/cog"), + ARM_COG = get("mechanical_arm/cog"), ARM_BASE = get("mechanical_arm/base"), + ARM_LOWER_BODY = get("mechanical_arm/lower_body"), ARM_UPPER_BODY = get("mechanical_arm/upper_body"), + ARM_HEAD = get("mechanical_arm/head"), ARM_CLAW_BASE = get("mechanical_arm/claw_base"), + ARM_CLAW_GRIP = get("mechanical_arm/claw_grip"), + + FLAG_SHORT_IN = get("mechanical_arm/flag/short_in"), FLAG_SHORT_OUT = get("mechanical_arm/flag/short_out"), + FLAG_LONG_IN = get("mechanical_arm/flag/long_in"), FLAG_LONG_OUT = get("mechanical_arm/flag/long_out"), + + MECHANICAL_PUMP_ARROW = get("mechanical_pump/arrow"), MECHANICAL_PUMP_COG = get("mechanical_pump/cog"), FLUID_PIPE_CASING = get("fluid_pipe/casing"); public static final Map PIPE_RIMS = map(); @@ -114,8 +90,7 @@ public class AllBlockPartials { private ResourceLocation modelLocation; private IBakedModel bakedModel; - private AllBlockPartials() { - } + private AllBlockPartials() {} private static void populateMaps() { for (Direction d : Iterate.directions) { diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 83446624d..2cd162aa4 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -398,12 +398,13 @@ public class AllBlocks { .register(); public static final BlockEntry HEATER = REGISTRATE.block("blaze_heater", HeaterBlock::new) - .initialProperties(SharedProperties::softMetal) - .properties(p -> p.lightValue(12)) - .addLayer(() -> RenderType::getCutoutMipped) - .blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p))) - .simpleItem() - .register(); + .initialProperties(SharedProperties::softMetal) + .properties(p -> p.lightValue(12)) + .tag(AllBlockTags.FAN_HEATERS.tag) + .addLayer(() -> RenderType::getCutoutMipped) + .blockstate((c, p) -> p.simpleBlock(c.getEntry(), AssetLookup.partialBaseModel(c, p))) + .simpleItem() + .register(); public static final BlockEntry DEPOT = REGISTRATE.block("depot", DepotBlock::new) .initialProperties(SharedProperties::stone) diff --git a/src/main/java/com/simibubi/create/AllTileEntities.java b/src/main/java/com/simibubi/create/AllTileEntities.java index f7b0b865f..5ff95476b 100644 --- a/src/main/java/com/simibubi/create/AllTileEntities.java +++ b/src/main/java/com/simibubi/create/AllTileEntities.java @@ -49,8 +49,7 @@ import com.simibubi.create.content.contraptions.fluids.FluidTankRenderer; import com.simibubi.create.content.contraptions.fluids.FluidTankTileEntity; import com.simibubi.create.content.contraptions.fluids.PumpRenderer; import com.simibubi.create.content.contraptions.fluids.PumpTileEntity; -import com.simibubi.create.content.contraptions.processing.BasinRenderer; -import com.simibubi.create.content.contraptions.processing.BasinTileEntity; +import com.simibubi.create.content.contraptions.processing.*; import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerRenderer; import com.simibubi.create.content.contraptions.relays.advanced.SpeedControllerTileEntity; import com.simibubi.create.content.contraptions.relays.advanced.sequencer.SequencedGearshiftTileEntity; @@ -198,6 +197,8 @@ public class AllTileEntities { register("deployer", DeployerTileEntity::new, AllBlocks.DEPLOYER); public static final TileEntityEntry BASIN = register("basin", BasinTileEntity::new, AllBlocks.BASIN); + public static final TileEntityEntry HEATER = + register("blaze_heater", HeaterTileEntity::new, AllBlocks.HEATER); public static final TileEntityEntry MECHANICAL_CRAFTER = register("mechanical_crafter", MechanicalCrafterTileEntity::new, AllBlocks.MECHANICAL_CRAFTER); public static final TileEntityEntry SEQUENCED_GEARSHIFT = @@ -227,9 +228,9 @@ public class AllTileEntities { public static final TileEntityEntry DEPOT = register("depot", DepotTileEntity::new, AllBlocks.DEPOT); - public static final TileEntityEntry FUNNEL = register("funnel", - FunnelTileEntity::new, AllBlocks.BRASS_FUNNEL, AllBlocks.BRASS_BELT_FUNNEL, AllBlocks.BRASS_CHUTE_FUNNEL, - AllBlocks.ANDESITE_FUNNEL, AllBlocks.ANDESITE_BELT_FUNNEL, AllBlocks.ANDESITE_CHUTE_FUNNEL); + public static final TileEntityEntry FUNNEL = register("funnel", FunnelTileEntity::new, + AllBlocks.BRASS_FUNNEL, AllBlocks.BRASS_BELT_FUNNEL, AllBlocks.BRASS_CHUTE_FUNNEL, AllBlocks.ANDESITE_FUNNEL, + AllBlocks.ANDESITE_BELT_FUNNEL, AllBlocks.ANDESITE_CHUTE_FUNNEL); public static final TileEntityEntry PACKAGER = register("packager", PackagerTileEntity::new, AllBlocks.PACKAGER); @@ -297,6 +298,7 @@ public class AllTileEntities { bind(SPEEDOMETER, GaugeRenderer::speed); bind(STRESSOMETER, GaugeRenderer::stress); bind(BASIN, BasinRenderer::new); + bind(HEATER, HeaterRenderer::new); bind(DEPLOYER, DeployerRenderer::new); bind(FLYWHEEL, FlywheelRenderer::new); bind(FURNACE_ENGINE, EngineRenderer::new); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java index af4bd4f79..f74220a28 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java @@ -5,11 +5,13 @@ import java.util.LinkedList; import java.util.List; import com.simibubi.create.AllRecipeTypes; +import com.simibubi.create.AllTags; import com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity; import com.simibubi.create.content.contraptions.fluids.CombinedFluidHandler; import com.simibubi.create.content.contraptions.processing.BasinOperatingTileEntity; import com.simibubi.create.content.contraptions.processing.BasinTileEntity.BasinInventory; import com.simibubi.create.content.contraptions.processing.CombinedItemFluidList; +import com.simibubi.create.content.contraptions.processing.HeaterTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform; import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour; @@ -24,6 +26,7 @@ import net.minecraft.item.crafting.Ingredient; import net.minecraft.nbt.CompoundNBT; import net.minecraft.particles.ItemParticleData; import net.minecraft.particles.ParticleTypes; +import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction.Axis; import net.minecraft.util.NonNullList; @@ -236,7 +239,7 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { if (!(recipe instanceof MixingRecipe)) return true; - return true; + return ((MixingRecipe) recipe).getHeatLevelRequired() <= getHeatLevelApplied(); } @Override @@ -273,4 +276,13 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { return running; } + private int getHeatLevelApplied() { + if (world == null) + return 0; + TileEntity te = world.getTileEntity(pos.down(3)); + if (!(te instanceof HeaterTileEntity)) + return AllTags.AllBlockTags.FAN_HEATERS.matches(world.getBlockState(pos.down(3))) ? 1 : 0; + return ((HeaterTileEntity) te).getHeatLevel(); + } + } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java index 5b5e2d081..80aa7b53b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MixingRecipe.java @@ -94,4 +94,8 @@ public class MixingRecipe extends ProcessingRecipe { protected boolean requiresHeating() { return this.requiredHeat > 0; } + + public int getHeatLevelRequired() { + return requiredHeat; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java index 781b6fd99..b4ffbfdac 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterBlock.java @@ -1,11 +1,56 @@ package com.simibubi.create.content.contraptions.processing; - +import com.simibubi.create.AllTileEntities; +import com.simibubi.create.foundation.block.ITE; +import mcp.MethodsReturnNonnullByDefault; import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ActionResultType; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.world.IBlockReader; +import net.minecraft.world.World; -public class HeaterBlock extends Block { +import javax.annotation.Nullable; +import javax.annotation.ParametersAreNonnullByDefault; - public HeaterBlock(Properties properties) { - super(properties); - } +@MethodsReturnNonnullByDefault +@ParametersAreNonnullByDefault +public class HeaterBlock extends Block implements ITE { + + public HeaterBlock(Properties properties) { + super(properties); + } + + @Override + public boolean hasTileEntity(BlockState state) { + return true; + } + + @Nullable + @Override + public TileEntity createTileEntity(BlockState state, IBlockReader world) { + return AllTileEntities.HEATER.create(); + } + + @Override + public Class getTileEntityClass() { + return HeaterTileEntity.class; + } + + @Override + public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, + BlockRayTraceResult blockRayTraceResult) { + TileEntity te = world.getTileEntity(pos); + if (te instanceof HeaterTileEntity && ((HeaterTileEntity) te).tryUpdateFuel(player.getHeldItem(hand))) { + if (!player.isCreative()) + player.getHeldItem(hand) + .shrink(1); + return ActionResultType.SUCCESS; + } + return ActionResultType.PASS; + } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterRenderer.java new file mode 100644 index 000000000..b3bf13311 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterRenderer.java @@ -0,0 +1,53 @@ +package com.simibubi.create.content.contraptions.processing; + +import com.mojang.blaze3d.matrix.MatrixStack; +import com.simibubi.create.AllBlockPartials; +import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; +import com.simibubi.create.foundation.utility.SuperByteBuffer; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.IRenderTypeBuffer; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.Vector3f; +import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; +import net.minecraft.util.Direction; + +public class HeaterRenderer extends SafeTileEntityRenderer { + private static final Minecraft INSTANCE = Minecraft.getInstance(); + + public HeaterRenderer(TileEntityRendererDispatcher dispatcher) { + super(dispatcher); + } + + @Override + protected void renderSafe(HeaterTileEntity te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffer, + int light, int overlay) { + AllBlockPartials blazeModel; + switch (te.getHeatLevel()) { + case 2: + blazeModel = AllBlockPartials.BLAZE_HEATER_BLAZE_TWO; + break; + case 3: + blazeModel = AllBlockPartials.BLAZE_HEATER_BLAZE_THREE; + break; + case 4: + blazeModel = AllBlockPartials.BLAZE_HEATER_BLAZE_FOUR; + break; + default: + blazeModel = AllBlockPartials.BLAZE_HEATER_BLAZE_ONE; + } + Vector3f difference = new Vector3f(INSTANCE.player.getPositionVector() + .subtract(te.getPos() + .getX() + 0.5, 0, + te.getPos() + .getZ() + 0.5) + .mul(1, 0, 1)); + difference.normalize(); + + SuperByteBuffer blazeBuffer = blazeModel.renderOn(te.getBlockState()); + blazeBuffer.rotateCentered(Direction.UP, + (float) ((difference.getX() < 0 ? 1 : -1) * Math.acos(Direction.NORTH.getUnitVector() + .dot(difference)))); + blazeBuffer.renderInto(ms, buffer.getBuffer(RenderType.getSolid())); + } +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterTileEntity.java new file mode 100644 index 000000000..8cc05bae8 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/HeaterTileEntity.java @@ -0,0 +1,91 @@ +package com.simibubi.create.content.contraptions.processing; + +import java.util.List; + +import com.simibubi.create.AllItems; +import com.simibubi.create.foundation.tileEntity.SmartTileEntity; +import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompoundNBT; +import net.minecraft.tileentity.TileEntityType; +import net.minecraftforge.common.ForgeHooks; + +public class HeaterTileEntity extends SmartTileEntity { + + int fuelLevel; + private int burnTimeRemaining; + private int bufferedHeatLevel; + + public HeaterTileEntity(TileEntityType tileEntityTypeIn) { + super(tileEntityTypeIn); + fuelLevel = 0; + burnTimeRemaining = 0; + bufferedHeatLevel = 1; + } + + @Override + public void tick() { + super.tick(); + if (burnTimeRemaining > 0) { + burnTimeRemaining--; + if (burnTimeRemaining == 0 && fuelLevel > 0) { + fuelLevel--; + sendData(); + } + markDirty(); + } + } + + @Override + public void lazyTick() { + super.lazyTick(); + updateHeatLevel(); + } + + @Override + public void addBehaviours(List behaviours) {} + + @Override + public CompoundNBT write(CompoundNBT compound) { + compound.putInt("fuelLevel", fuelLevel); + compound.putInt("burnTimeRemaining", burnTimeRemaining); + return super.write(compound); + } + + @Override + public void read(CompoundNBT compound) { + fuelLevel = compound.getInt("fuelLevel"); + burnTimeRemaining = compound.getInt("burnTimeRemaining"); + super.read(compound); + if (fuelLevel == 0) { + burnTimeRemaining = 0; + markDirty(); + } + } + + boolean tryUpdateFuel(ItemStack itemStack) { + int burnTime = itemStack.getItem() + .getBurnTime(itemStack); + int newFuelLevel = 1; // todo: int newFuelLevel = itemStack.getItem() == AllItems.SUPER_SPECIAL_FUEL.get() ? 2 : 1; + if (burnTime == -1) + burnTime = ForgeHooks.getBurnTime(itemStack); + if (burnTime < burnTimeRemaining && newFuelLevel <= fuelLevel) + return false; + burnTimeRemaining = burnTime; + fuelLevel = newFuelLevel; + updateHeatLevel(); + return true; + } + + public int getHeatLevel() { + return bufferedHeatLevel; + } + + private void updateHeatLevel() { + bufferedHeatLevel = 1 + fuelLevel; + // todo: check for fan + markDirty(); + sendData(); + } +} diff --git a/src/main/resources/assets/create/models/block/blaze_heater/blaze/four.json b/src/main/resources/assets/create/models/block/blaze_heater/blaze/four.json new file mode 100644 index 000000000..cc0f8c54f --- /dev/null +++ b/src/main/resources/assets/create/models/block/blaze_heater/blaze/four.json @@ -0,0 +1,29 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "1": "create:block/tamed_blaze" + }, + "elements": [ + { + "name": "Blaze 4", + "from": [4, 6, 4], + "to": [12, 14, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 6, 6]}, + "faces": { + "north": {"uv": [12, 0, 16, 4], "texture": "#1"}, + "east": {"uv": [8, 0, 12, 4], "texture": "#1"}, + "south": {"uv": [8, 0, 12, 4], "texture": "#1"}, + "west": {"uv": [8, 0, 12, 4], "texture": "#1"}, + "up": {"uv": [8, 4, 12, 8], "texture": "#1"}, + "down": {"uv": [12, 4, 16, 8], "texture": "#1"} + } + } + ], + "groups": [ + { + "name": "Blazes", + "origin": [8, 8, 8], + "children": [15, 16, 17, 18] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/blaze_heater/blaze/one.json b/src/main/resources/assets/create/models/block/blaze_heater/blaze/one.json new file mode 100644 index 000000000..b0b318ff6 --- /dev/null +++ b/src/main/resources/assets/create/models/block/blaze_heater/blaze/one.json @@ -0,0 +1,28 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "1": "create:block/tamed_blaze" + }, + "elements": [ + { + "name": "Blaze 1", + "from": [6, 6, 6], + "to": [10, 10, 10], + "faces": { + "north": {"uv": [8, 8, 10, 10], "texture": "#1"}, + "east": {"uv": [6, 8, 8, 10], "texture": "#1"}, + "south": {"uv": [6, 8, 8, 10], "texture": "#1"}, + "west": {"uv": [6, 8, 8, 10], "texture": "#1"}, + "up": {"uv": [6, 10, 8, 12], "texture": "#1"}, + "down": {"uv": [8, 10, 10, 12], "texture": "#1"} + } + } + ], + "groups": [ + { + "name": "Blazes", + "origin": [8, 8, 8], + "children": [15, 16, 17, 18] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/blaze_heater/blaze/three.json b/src/main/resources/assets/create/models/block/blaze_heater/blaze/three.json new file mode 100644 index 000000000..a9d78104f --- /dev/null +++ b/src/main/resources/assets/create/models/block/blaze_heater/blaze/three.json @@ -0,0 +1,29 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "1": "create:block/tamed_blaze" + }, + "elements": [ + { + "name": "Blaze 3", + "from": [4, 6, 4], + "to": [12, 14, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 6, 6]}, + "faces": { + "north": {"uv": [4, 0, 8, 4], "texture": "#1"}, + "east": {"uv": [0, 0, 4, 4], "texture": "#1"}, + "south": {"uv": [0, 0, 4, 4], "texture": "#1"}, + "west": {"uv": [0, 0, 4, 4], "texture": "#1"}, + "up": {"uv": [0, 4, 4, 8], "texture": "#1"}, + "down": {"uv": [4, 4, 8, 8], "texture": "#1"} + } + } + ], + "groups": [ + { + "name": "Blazes", + "origin": [8, 8, 8], + "children": [15, 16, 17, 18] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/models/block/blaze_heater/blaze/two.json b/src/main/resources/assets/create/models/block/blaze_heater/blaze/two.json new file mode 100644 index 000000000..ab5e5aea4 --- /dev/null +++ b/src/main/resources/assets/create/models/block/blaze_heater/blaze/two.json @@ -0,0 +1,29 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "1": "create:block/tamed_blaze" + }, + "elements": [ + { + "name": "Blaze 2", + "from": [5, 6, 5], + "to": [11, 12, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 7, 7]}, + "faces": { + "north": {"uv": [3, 8, 6, 11], "texture": "#1"}, + "east": {"uv": [0, 8, 3, 11], "texture": "#1"}, + "south": {"uv": [0, 8, 3, 11], "texture": "#1"}, + "west": {"uv": [0, 8, 3, 11], "texture": "#1"}, + "up": {"uv": [0, 11, 3, 14], "texture": "#1"}, + "down": {"uv": [3, 11, 6, 14], "texture": "#1"} + } + } + ], + "groups": [ + { + "name": "Blazes", + "origin": [8, 8, 8], + "children": [15, 16, 17, 18] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/create/textures/block/tamed_blaze.png b/src/main/resources/assets/create/textures/block/tamed_blaze.png new file mode 100644 index 0000000000000000000000000000000000000000..ba3918be145e2182eb34d9d6bd83ff70a464cd91 GIT binary patch literal 1538 zcmV+d2L1VoP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00nAEL_t(o!|j$`Y!p=#$A5Qr zyQSOKO3OxQnoe!8DNx#^Vu_(^6-bGanD9b)K*jjvgAXJoYC_PM_@I*TK%!BCCI*ZT zCd3CmBnT-D62Mei+DgARol;6=Eg#)>3)7vwKFr=bGhKNS!;9zT-gEAq`Ty_#oO5S{ zyuU?K7$;y4x(LJ`bOqNXWHVVPY~z&+dx^(_%UwwVv92U}md$2qTLwb*H%RJC4cPm^ z9-2Pd0;3kxneOg~5R`p~Sv~OwX4C`RbF7ywtxZ^IFr#klVFVA4NkrxgWdArcz1D!! zc?|%+A8K#FPcWdysDcgJdQTynI&@s_2vPD( z3vGwGvC?q;ofc+?yAeM)h|kvvsX#49Vuplf*s)mxFysj8L*9Jb(~|yicfNhRr zA!4RiDoq_Ov71B474_cyxot4fkGMHR7~tT~km`Zb=A1N+B-JATLCs4rb{0AvG`XV) zI!{Z?5U>jPU%aK|MHI_C@8e7od@tD_Y{yRV>EjI-@CDbU3N};+jM_|YV{V3gd39&cqCPpbA)lTaLtx z!cH>?7>~IzGm0y@uSiwybrB+cx10Z#d(f4qg5Uh4)am`VTvsw*g}~<|N6N?!TS!Mj zt(gyAXX=9U11dshNMOxnkx~YVP=T9K?@sWmpp}T37)HHYfZ6Z{q$82(bAdWgDNrO7 z5jC2{2JskdsBnp#yCnm4pi-bnC?Z+`MlHnP5e(6u0t^Hh0OJFJz&(m9KVxLSn=wS|LbJOKMj} z0GPV7pnT!?0lgAW0`Axg9Jpff-liJT(~<*MEVx3ze|<$2QxyvU{C;C5?~LN)u4m=C>N4K_u9qDz zx{|M}E(2iM$7hh%ZWu`-HXY`#y&HM;z#zp-7MQzV5O|R_7fG z9avwiK)5Ut#*z8;cX2HDVjnSp~TN24zUu@wEC$_^% z-(Ta1d!4=c)=5-q*4LD4LJD-T%=(0P?`i+)Z2tOU^P0D~6@NP>Y@38_lboE@DOg`q zu3Jl4c|;O6(v(Lew{4*TGubFJnfbi+JOx-8b5E`Qiki2=+@(P7RSFWe&9|3_18@0| ze`oH;$bad~UD9dr=RQ_h!hc}~0$BYrI1*+q=52^omS}L*rjM4uND}Pdf<>4sN(HQx o(4FxJO-LzuoM!Nt?SBG)1L0owHDjIeo&W#<07*qoM6N<$f{Fdb_5c6? literal 0 HcmV?d00001 diff --git a/src/main/resources/data/create/recipes/mixing/brass_ingot.json b/src/main/resources/data/create/recipes/mixing/brass_ingot.json index cf03e301b..6b06a9e03 100644 --- a/src/main/resources/data/create/recipes/mixing/brass_ingot.json +++ b/src/main/resources/data/create/recipes/mixing/brass_ingot.json @@ -16,5 +16,6 @@ "item": "create:brass_ingot", "count": 2 } - ] + ], + "requiredHeat": 1 } \ No newline at end of file