diff --git a/src/generated/resources/.cache/cache b/src/generated/resources/.cache/cache index b3ffbb399..15c1a03d0 100644 --- a/src/generated/resources/.cache/cache +++ b/src/generated/resources/.cache/cache @@ -130,7 +130,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 -3d97226b5e8d8f70ed08e45e78db1faf78d5e28b assets/create/blockstates/fluid_pipe.json +fe9169716dd21a81a3710a89f0a9b7ea4dcd4d51 assets/create/blockstates/fluid_pipe.json f0eaab18e16c4f3f65ebf3b55b08f0dc445720fe assets/create/blockstates/fluid_tank.json e9da1794b6ece7f9aa8bcb43d42c23a55446133b assets/create/blockstates/flywheel.json ac00d40e1ef50a37041c0481afa1a23a14dea78e assets/create/blockstates/framed_glass.json @@ -2711,6 +2711,7 @@ bd355332d17adcb0460b1d43146ca288efb78395 data/create/recipes/fancy_weathered_lim d2ab9ce73636773165564506580f2ec13bd1fc50 data/create/recipes/fancy_weathered_limestone_bricks_stairs_from_fancy_weathered_limestone_bricks_stonecutting.json 36947f27d2b2e57b00440fd5acd06a7554e5a387 data/create/recipes/fancy_weathered_limestone_bricks_wall.json 1d0e41ca98e48073c72adf4077610c96e592f9a5 data/create/recipes/fancy_weathered_limestone_bricks_wall_from_fancy_weathered_limestone_bricks_stonecutting.json +3196d3eda9e67771e86e9af7026d4388765a8a73 data/create/recipes/filling/water_bottle.json 5b8bbde7f8b270ab75fac18d6858f2fadbc0efa3 data/create/recipes/framed_glass_from_glass_colorless_stonecutting.json d697de0c9b706ca4e18da7a2d769e7e5fe8d769d data/create/recipes/framed_glass_pane.json a0dae50faaa1b7142bb4309675e3084c68daa547 data/create/recipes/gabbro_bricks_from_gabbro_stonecutting.json diff --git a/src/generated/resources/assets/create/blockstates/fluid_pipe.json b/src/generated/resources/assets/create/blockstates/fluid_pipe.json index a4cffcde7..3b646b920 100644 --- a/src/generated/resources/assets/create/blockstates/fluid_pipe.json +++ b/src/generated/resources/assets/create/blockstates/fluid_pipe.json @@ -303,8 +303,8 @@ { "when": { "west": "false", - "down": "false", "east": "true", + "down": "false", "up": "true" }, "apply": { @@ -314,8 +314,8 @@ { "when": { "west": "true", - "down": "false", "east": "false", + "down": "false", "up": "true" }, "apply": { @@ -325,8 +325,8 @@ { "when": { "west": "false", - "down": "true", "east": "true", + "down": "true", "up": "false" }, "apply": { @@ -336,8 +336,8 @@ { "when": { "west": "true", - "down": "true", "east": "false", + "down": "true", "up": "false" }, "apply": { @@ -347,8 +347,8 @@ { "when": { "west": "false", - "down": "true", "east": "false", + "down": "true", "up": "true" }, "apply": { @@ -358,8 +358,8 @@ { "when": { "west": "false", - "down": "false", "east": "false", + "down": "false", "up": "true" }, "apply": { @@ -369,8 +369,8 @@ { "when": { "west": "false", - "down": "true", "east": "false", + "down": "true", "up": "false" }, "apply": { @@ -380,8 +380,8 @@ { "when": { "west": "true", - "down": "false", "east": "true", + "down": "false", "up": "false" }, "apply": { @@ -391,8 +391,8 @@ { "when": { "west": "false", - "down": "false", "east": "true", + "down": "false", "up": "false" }, "apply": { @@ -402,8 +402,8 @@ { "when": { "west": "true", - "down": "false", "east": "false", + "down": "false", "up": "false" }, "apply": { @@ -413,8 +413,8 @@ { "when": { "west": "false", - "down": "false", "east": "false", + "down": "false", "up": "false" }, "apply": { diff --git a/src/generated/resources/data/create/recipes/filling/water_bottle.json b/src/generated/resources/data/create/recipes/filling/water_bottle.json new file mode 100644 index 000000000..4f99990bd --- /dev/null +++ b/src/generated/resources/data/create/recipes/filling/water_bottle.json @@ -0,0 +1,21 @@ +{ + "type": "create:filling", + "ingredients": [ + { + "item": "minecraft:glass_bottle" + }, + { + "fluidTag": "minecraft:water", + "amount": 250 + } + ], + "results": [ + { + "item": "minecraft:potion", + "count": 1, + "nbt": { + "Potion": "minecraft:water" + } + } + ] +} \ No newline at end of file diff --git a/src/main/java/com/simibubi/create/AllRecipeTypes.java b/src/main/java/com/simibubi/create/AllRecipeTypes.java index ffaaa4e9b..2e2e6515e 100644 --- a/src/main/java/com/simibubi/create/AllRecipeTypes.java +++ b/src/main/java/com/simibubi/create/AllRecipeTypes.java @@ -10,6 +10,7 @@ import com.simibubi.create.content.contraptions.components.millstone.MillingReci import com.simibubi.create.content.contraptions.components.mixer.MixingRecipe; import com.simibubi.create.content.contraptions.components.press.PressingRecipe; import com.simibubi.create.content.contraptions.components.saw.CuttingRecipe; +import com.simibubi.create.content.contraptions.fluids.actors.FillingRecipe; import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; import com.simibubi.create.content.contraptions.processing.ProcessingRecipeBuilder.ProcessingRecipeFactory; import com.simibubi.create.content.contraptions.processing.ProcessingRecipeSerializer; @@ -39,6 +40,7 @@ public enum AllRecipeTypes { PRESSING(processingSerializer(PressingRecipe::new)), SANDPAPER_POLISHING(processingSerializer(SandPaperPolishingRecipe::new)), SPLASHING(processingSerializer(SplashingRecipe::new)), + FILLING(processingSerializer(FillingRecipe::new)), ; diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FillingBySpout.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FillingBySpout.java index ab53fbba2..59a3b3ada 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FillingBySpout.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FillingBySpout.java @@ -1,22 +1,32 @@ package com.simibubi.create.content.contraptions.fluids.actors; -import net.minecraft.fluid.Fluids; +import java.util.List; +import java.util.Optional; + +import com.simibubi.create.AllRecipeTypes; +import com.simibubi.create.foundation.fluid.FluidIngredient; + import net.minecraft.item.ItemStack; -import net.minecraft.item.Items; -import net.minecraft.potion.PotionUtils; -import net.minecraft.potion.Potions; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.world.World; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; import net.minecraftforge.fluids.capability.IFluidHandler.FluidAction; import net.minecraftforge.fluids.capability.IFluidHandlerItem; import net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper; +import net.minecraftforge.items.ItemStackHandler; +import net.minecraftforge.items.wrapper.RecipeWrapper; public class FillingBySpout { - public static boolean canItemBeFilled(ItemStack stack) { - // FIXME: Spout recipe type - if (stack.getItem() == Items.GLASS_BOTTLE) + static RecipeWrapper wrapper = new RecipeWrapper(new ItemStackHandler(1)); + + public static boolean canItemBeFilled(World world, ItemStack stack) { + wrapper.setInventorySlotContents(0, stack); + if (world.getRecipeManager() + .getRecipe(AllRecipeTypes.FILLING.getType(), wrapper, world) + .isPresent()) return true; LazyOptional capability = @@ -32,10 +42,16 @@ public class FillingBySpout { return false; } - public static int getRequiredAmountForItem(ItemStack stack, FluidStack availableFluid) { - // FIXME: Spout recipe type - if (stack.getItem() == Items.GLASS_BOTTLE && availableFluid.getFluid() == Fluids.WATER) - return 250; + public static int getRequiredAmountForItem(World world, ItemStack stack, FluidStack availableFluid) { + wrapper.setInventorySlotContents(0, stack); + Optional> recipe = world.getRecipeManager() + .getRecipe(AllRecipeTypes.FILLING.getType(), wrapper, world); + if (recipe.isPresent()) { + FillingRecipe fillingRecipe = (FillingRecipe) recipe.get(); + FluidIngredient requiredFluid = fillingRecipe.getRequiredFluid(); + if (requiredFluid.test(availableFluid)) + return requiredFluid.getRequiredAmount(); + } LazyOptional capability = stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY); @@ -49,15 +65,22 @@ public class FillingBySpout { return filled == 0 ? -1 : filled; } - public static ItemStack fillItem(int requiredAmount, ItemStack stack, FluidStack availableFluid) { + public static ItemStack fillItem(World world, int requiredAmount, ItemStack stack, FluidStack availableFluid) { FluidStack toFill = availableFluid.copy(); toFill.setAmount(requiredAmount); availableFluid.shrink(requiredAmount); - // FIXME: Spout recipe type - if (stack.getItem() == Items.GLASS_BOTTLE && availableFluid.getFluid() == Fluids.WATER) { - stack.shrink(1); - return PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), Potions.WATER); + wrapper.setInventorySlotContents(0, stack); + Optional> recipe = world.getRecipeManager() + .getRecipe(AllRecipeTypes.FILLING.getType(), wrapper, world); + if (recipe.isPresent()) { + FillingRecipe fillingRecipe = (FillingRecipe) recipe.get(); + FluidIngredient requiredFluid = fillingRecipe.getRequiredFluid(); + if (requiredFluid.test(toFill)) { + List results = fillingRecipe.rollResults(); + stack.shrink(1); + return results.isEmpty() ? ItemStack.EMPTY : results.get(0); + } } ItemStack split = stack.copy(); @@ -68,7 +91,8 @@ public class FillingBySpout { if (tank == null) return ItemStack.EMPTY; tank.fill(toFill, FluidAction.EXECUTE); - ItemStack container = tank.getContainer().copy(); + ItemStack container = tank.getContainer() + .copy(); stack.shrink(1); return container; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FillingRecipe.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FillingRecipe.java new file mode 100644 index 000000000..7a085f03a --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/FillingRecipe.java @@ -0,0 +1,43 @@ +package com.simibubi.create.content.contraptions.fluids.actors; + +import com.simibubi.create.AllRecipeTypes; +import com.simibubi.create.content.contraptions.processing.ProcessingRecipe; +import com.simibubi.create.content.contraptions.processing.ProcessingRecipeBuilder.ProcessingRecipeParams; +import com.simibubi.create.foundation.fluid.FluidIngredient; + +import net.minecraft.world.World; +import net.minecraftforge.items.wrapper.RecipeWrapper; + +public class FillingRecipe extends ProcessingRecipe { + + public FillingRecipe(ProcessingRecipeParams params) { + super(AllRecipeTypes.FILLING, params); + } + + @Override + public boolean matches(RecipeWrapper inv, World p_77569_2_) { + return ingredients.get(0).test(inv.getStackInSlot(0)); + } + + @Override + protected int getMaxInputCount() { + return 1; + } + + @Override + protected int getMaxOutputCount() { + return 1; + } + + @Override + protected int getMaxFluidInputCount() { + return 1; + } + + public FluidIngredient getRequiredFluid() { + if (fluidIngredients.isEmpty()) + throw new IllegalStateException("Filling Recipe: " + id.toString() + " has no fluid ingredient!"); + return fluidIngredients.get(0); + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutRenderer.java index 6208ded58..a97ee37b3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutRenderer.java @@ -45,24 +45,31 @@ public class SpoutRenderer extends SafeTileEntityRenderer { int processingTicks = te.processingTicks; float processingPT = te.processingTicks - partialTicks; - + float processingProgress = 1 - (processingPT - 5) / 10; + processingProgress = MathHelper.clamp(processingProgress, 0, 1); float radius = 0; + if (processingTicks != -1) { - float processingProgress = 1 - (processingPT - 5) / 10; - processingProgress = MathHelper.clamp(processingProgress, 0, 1); - radius = (float) (Math.pow(((2 * processingProgress) - 1), 2) - 1) / 32f; - AxisAlignedBB bb = new AxisAlignedBB(0.5, .5, 0.5, 0.5, -1.2, 0.5).grow(radius); + radius = (float) (Math.pow(((2 * processingProgress) - 1), 2) - 1); + AxisAlignedBB bb = new AxisAlignedBB(0.5, .5, 0.5, 0.5, -1.2, 0.5).grow(radius / 32f); FluidRenderer.renderTiledFluidBB(fluidStack, (float) bb.minX, (float) bb.minY, (float) bb.minZ, (float) bb.maxX, (float) bb.maxY, (float) bb.maxZ, buffer, ms, light, true); - } + float squeeze = radius; + if (processingPT < 0) + squeeze = 0; + else if (processingPT < 2) + squeeze = MathHelper.lerp(processingPT / 2f, 0, -1); + else if (processingPT < 10) + squeeze = -1; + ms.push(); for (AllBlockPartials bit : BITS) { bit.renderOn(te.getBlockState()) .light(light) .renderInto(ms, buffer.getBuffer(RenderType.getSolid())); - ms.translate(0, -3 * radius, 0); + ms.translate(0, -3 * squeeze / 32f, 0); } ms.pop(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java index 90894c248..b723a4849 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java @@ -13,6 +13,7 @@ import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.BeltProcessingBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.BeltProcessingBehaviour.ProcessingResult; import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour.TransportedResult; import com.simibubi.create.foundation.utility.LerpedFloat; import com.simibubi.create.foundation.utility.LerpedFloat.Chaser; import com.simibubi.create.foundation.utility.Pair; @@ -97,25 +98,25 @@ public class SpoutTileEntity extends SmartTileEntity { protected ProcessingResult onItemReceived(TransportedItemStack transported, TransportedItemStackHandlerBehaviour handler) { - if (!FillingBySpout.canItemBeFilled(transported.stack)) + if (!FillingBySpout.canItemBeFilled(world, transported.stack)) return PASS; if (tank.isEmpty()) return HOLD; - if (FillingBySpout.getRequiredAmountForItem(transported.stack, tank.getFluid()) == -1) + if (FillingBySpout.getRequiredAmountForItem(world, transported.stack, tank.getFluid()) == -1) return PASS; return HOLD; } protected ProcessingResult whenItemHeld(TransportedItemStack transported, TransportedItemStackHandlerBehaviour handler) { - if (processingTicks > 0) + if (processingTicks != -1 && processingTicks != 5) return HOLD; - if (!FillingBySpout.canItemBeFilled(transported.stack)) + if (!FillingBySpout.canItemBeFilled(world, transported.stack)) return PASS; if (tank.isEmpty()) return HOLD; FluidStack fluid = tank.getFluid(); - int requiredAmountForItem = FillingBySpout.getRequiredAmountForItem(transported.stack, fluid.copy()); + int requiredAmountForItem = FillingBySpout.getRequiredAmountForItem(world, transported.stack, fluid.copy()); if (requiredAmountForItem == -1) return PASS; if (requiredAmountForItem > fluid.getAmount()) @@ -129,19 +130,18 @@ public class SpoutTileEntity extends SmartTileEntity { } // Process finished - - processingTicks = -1; - ItemStack out = FillingBySpout.fillItem(requiredAmountForItem, transported.stack, fluid); + ItemStack out = FillingBySpout.fillItem(world, requiredAmountForItem, transported.stack, fluid); if (!out.isEmpty()) { List outList = new ArrayList<>(); - TransportedItemStack similar = transported.copy(); - similar.stack = out; - // FIXME: original stack keeps waiting + TransportedItemStack held = null; + TransportedItemStack result = transported.copy(); + result.stack = out; if (!transported.stack.isEmpty()) - outList.add(transported.copy()); - outList.add(similar); - handler.handleProcessingOnItem(transported, outList); + held = transported.copy(); + outList.add(result); + handler.handleProcessingOnItem(transported, TransportedResult.convertToAndLeaveHeld(outList, held)); } + tank.setFluid(fluid); sendSplash = true; markDirty(); @@ -173,14 +173,14 @@ public class SpoutTileEntity extends SmartTileEntity { tank.readFromNBT(compound.getCompound("TankContent")); fluidLevel.readNBT(compound.getCompound("Level"), clientPacket); processingTicks = compound.getInt("ProcessingTicks"); + if (!tank.getFluid() + .isEmpty()) + renderedFluid = tank.getFluid(); if (!clientPacket) return; if (compound.contains("Splash")) spawnSplash(renderedFluid); - if (!tank.getFluid() - .isEmpty()) - renderedFluid = tank.getFluid(); } @Override @@ -203,9 +203,9 @@ public class SpoutTileEntity extends SmartTileEntity { @Override public void tick() { super.tick(); - if (processingTicks > 0) + if (processingTicks >= 0) processingTicks--; - if (processingTicks >= 0 && world.isRemote) + if (processingTicks >= 8 && world.isRemote) spawnProcessingParticles(renderedFluid); if (syncCooldown > 0) { syncCooldown--; 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 67fcb47ac..b0c1d85b1 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 @@ -4,6 +4,7 @@ import java.util.Random; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.simibubi.create.Create; @@ -41,7 +42,11 @@ public class ProcessingOutput { for (int roll = 0; roll < stack.getCount(); roll++) if (r.nextFloat() > chance) outputAmount--; - return outputAmount > 0 ? new ItemStack(stack.getItem(), outputAmount) : ItemStack.EMPTY; + if (outputAmount == 0) + return ItemStack.EMPTY; + ItemStack out = stack.copy(); + out.setCount(outputAmount); + return out; } public JsonElement serialize() { @@ -51,8 +56,7 @@ public class ProcessingOutput { .toString()); json.addProperty("count", stack.getCount()); if (stack.hasTag()) - json.addProperty("nbt", stack.getTag() - .toString()); + json.add("nbt", new JsonParser().parse(stack.getTag().toString())); if (chance != 1) json.addProperty("chance", chance); return json; diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeBuilder.java b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeBuilder.java index 51d2f1d8b..d33278705 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeBuilder.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/ProcessingRecipeBuilder.java @@ -145,6 +145,10 @@ public class ProcessingRecipeBuilder> { return output(chance, new ItemStack(item, amount)); } + public ProcessingRecipeBuilder output(ItemStack output) { + return output(1, output); + } + public ProcessingRecipeBuilder output(float chance, ItemStack output) { params.results.add(new ProcessingOutput(output, chance)); return this; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java index f5adeb459..7e6c28f9e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltBlock.java @@ -1,7 +1,6 @@ package com.simibubi.create.content.contraptions.relays.belt; import java.util.ArrayList; -import java.util.Collections; import java.util.LinkedList; import java.util.List; @@ -17,6 +16,7 @@ import com.simibubi.create.content.schematics.ISpecialBlockItemRequirement; import com.simibubi.create.content.schematics.ItemRequirement; import com.simibubi.create.content.schematics.ItemRequirement.ItemUseType; import com.simibubi.create.foundation.block.ITE; +import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour.TransportedResult; import com.simibubi.create.foundation.utility.BlockHelper; import com.simibubi.create.foundation.utility.Iterate; @@ -248,7 +248,7 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE { player.inventory.placeItemBackInInventory(world, transportedItemStack.stack); - return Collections.emptyList(); + return TransportedResult.removeItem(); }); } @@ -464,17 +464,19 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE { textureIndex += cycleLength; beltBuffer.shiftUVtoSheet(spriteShift, (textureIndex % 4) / 4f, (textureIndex / 4) / 4f, 4); - } + } beltBuffer.renderInto(ms, vb); @@ -213,7 +213,7 @@ public class BeltRenderer extends SafeTileEntityRenderer { .add(alongX ? sideOffset : 0, .39, alongX ? 0 : sideOffset)); ShadowRenderHelper.renderShadow(ms, buffer, shadowPos, .75f, blockItem ? .2f : .2f); } - + if (renderUpright) { Entity renderViewEntity = Minecraft.getInstance().renderViewEntity; if (renderViewEntity != null) { @@ -223,11 +223,11 @@ public class BeltRenderer extends SafeTileEntityRenderer { float yRot = (float) MathHelper.atan2(diff.z, -diff.x); ms.multiply(Vector3f.POSITIVE_Y.getRadialQuaternion((float) (yRot + Math.PI / 2))); } - ms.translate(0, 3/32d, 1/16f); + ms.translate(0, 3 / 32d, 1 / 16f); } - if (!renderUpright) + if (!renderUpright) ms.multiply(new Vector3f(slopeAlongX ? 0 : 1, 0, slopeAlongX ? 1 : 0).getDegreesQuaternion(slopeAngle)); - + if (onSlope) ms.translate(0, 1 / 8f, 0); @@ -248,9 +248,12 @@ public class BeltRenderer extends SafeTileEntityRenderer { itemRenderer.renderItem(transported.stack, TransformType.FIXED, light, overlay, ms, buffer); ms.pop(); - if (!blockItem) - ms.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(10)); - ms.translate(0, blockItem ? 1 / 64d : 1 / 16d, 0); + if (!renderUpright) { + if (!blockItem) + ms.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(10)); + ms.translate(0, blockItem ? 1 / 64d : 1 / 16d, 0); + } else + ms.translate(0, 0, -1 / 16f); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java index d19ce518d..6528e2316 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java @@ -23,6 +23,7 @@ import com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileE import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour.TransportedResult; import com.simibubi.create.foundation.utility.ColorHelper; import com.simibubi.create.foundation.utility.NBTHelper; @@ -356,7 +357,7 @@ public class BeltTileEntity extends KineticTileEntity { } private void applyToAllItems(float maxDistanceFromCenter, - Function> processFunction) { + Function processFunction) { BeltTileEntity controller = getControllerTE(); if (controller != null) controller.getInventory() diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltInventory.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltInventory.java index 14ec10785..415feccdc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltInventory.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/transport/BeltInventory.java @@ -2,7 +2,6 @@ package com.simibubi.create.content.contraptions.relays.belt.transport; import static com.simibubi.create.content.contraptions.relays.belt.transport.BeltTunnelInteractionHandler.flapTunnel; -import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; @@ -12,13 +11,14 @@ import java.util.function.Function; import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.relays.belt.BeltBlock; import com.simibubi.create.content.contraptions.relays.belt.BeltHelper; -import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity; import com.simibubi.create.content.contraptions.relays.belt.BeltSlope; +import com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.BeltProcessingBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.BeltProcessingBehaviour.ProcessingResult; import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour.TransportedResult; import com.simibubi.create.foundation.utility.ServerSpeedProvider; import net.minecraft.block.Block; @@ -37,6 +37,7 @@ public class BeltInventory { final BeltTileEntity belt; private final List items; final List toInsert; + final List toRemove; boolean beltMovementPositive; final float SEGMENT_WINDOW = .75f; @@ -44,6 +45,7 @@ public class BeltInventory { this.belt = te; items = new LinkedList<>(); toInsert = new LinkedList<>(); + toRemove = new LinkedList<>(); } public void tick() { @@ -56,10 +58,12 @@ public class BeltInventory { belt.sendData(); } - // Add items from previous cycle - if (!toInsert.isEmpty()) { + // Added/Removed items from previous cycle + if (!toInsert.isEmpty() || !toRemove.isEmpty()) { toInsert.forEach(this::insert); toInsert.clear(); + items.removeAll(toRemove); + toRemove.clear(); belt.markDirty(); belt.sendData(); } @@ -248,7 +252,7 @@ public class BeltInventory { return true; if (result == ProcessingResult.HOLD) { - currentItem.beltPosition = segment + .5f + (beltMovementPositive ? 1 / 64f : -1 / 64f); + currentItem.beltPosition = segment + .5f + (beltMovementPositive ? 1 / 512f : -1 / 512f); currentItem.locked = true; belt.sendData(); return false; @@ -400,24 +404,25 @@ public class BeltInventory { } public void applyToEachWithin(float position, float maxDistanceToPosition, - Function> processFunction) { - List toBeAdded = new ArrayList<>(); + Function processFunction) { boolean dirty = false; - for (Iterator iterator = items.iterator(); iterator.hasNext();) { - TransportedItemStack transportedItemStack = iterator.next(); - ItemStack stackBefore = transportedItemStack.stack.copy(); - if (Math.abs(position - transportedItemStack.beltPosition) < maxDistanceToPosition) { - List apply = processFunction.apply(transportedItemStack); - if (apply == null) - continue; - if (apply.size() == 1 && apply.get(0).stack.equals(stackBefore, false)) - continue; - dirty = true; - toBeAdded.addAll(apply); - iterator.remove(); + for (TransportedItemStack transforted : items) { + ItemStack stackBefore = transforted.stack.copy(); + if (Math.abs(position - transforted.beltPosition) >= maxDistanceToPosition) + continue; + TransportedResult result = processFunction.apply(transforted); + if (result.didntChangeFrom(stackBefore)) + continue; + + dirty = true; + if (result.hasHeldOutput()) { + TransportedItemStack held = result.getHeldOutput(); + held.beltPosition = ((int) position) + .5f - (beltMovementPositive ? 1 / 512f : -1 / 512f); + toInsert.add(held); } + toInsert.addAll(result.getOutputs()); + toRemove.add(transforted); } - toBeAdded.forEach(toInsert::add); if (dirty) { belt.markDirty(); belt.sendData(); 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 8ef188758..ca60ccfd3 100644 --- a/src/main/java/com/simibubi/create/content/logistics/InWorldProcessing.java +++ b/src/main/java/com/simibubi/create/content/logistics/InWorldProcessing.java @@ -14,6 +14,7 @@ import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlo import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.item.ItemHelper; +import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour.TransportedResult; import com.simibubi.create.foundation.utility.ColorHelper; import net.minecraft.block.BlockState; @@ -142,7 +143,8 @@ public class InWorldProcessing { } } - public static List applyProcessing(TransportedItemStack transported, World world, Type type) { + public static TransportedResult applyProcessing(TransportedItemStack transported, World world, Type type) { + TransportedResult ignore = TransportedResult.doNothing(); if (transported.processedBy != type) { transported.processedBy = type; int timeModifierForStackSize = ((transported.stack.getCount() - 1) / 16) + 1; @@ -151,16 +153,16 @@ public class InWorldProcessing { transported.processingTime = processingTime; if (!canProcess(transported.stack, type, world)) transported.processingTime = -1; - return null; + return ignore; } if (transported.processingTime == -1) - return null; + return ignore; if (transported.processingTime-- > 0) - return null; + return ignore; List stacks = process(transported.stack, type, world); if (stacks == null) - return null; + return ignore; List transportedStacks = new ArrayList<>(); for (ItemStack additional : stacks) { @@ -168,7 +170,7 @@ public class InWorldProcessing { newTransported.stack = additional.copy(); transportedStacks.add(newTransported); } - return transportedStacks; + return TransportedResult.convertTo(transportedStacks); } private static List process(ItemStack stack, Type type, World world) { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotRenderer.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotRenderer.java index 43dd60afd..98c8626f8 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotRenderer.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotRenderer.java @@ -95,34 +95,42 @@ public class DepotRenderer extends SafeTileEntityRenderer { boolean renderUpright = BeltHelper.isItemUpright(itemStack); boolean blockItem = itemRenderer.getItemModelWithOverrides(itemStack, null, null) .isGui3d(); + + ms.push(); + msr.rotateY(angle); + if (!blockItem && !renderUpright) { + ms.translate(0, -.09375, 0); + msr.rotateX(90); + } + if (renderUpright) { + Entity renderViewEntity = Minecraft.getInstance().renderViewEntity; + if (renderViewEntity != null) { + Vec3d positionVec = renderViewEntity.getPositionVec(); + Vec3d vectorForOffset = itemPosition; + Vec3d diff = vectorForOffset.subtract(positionVec); + float yRot = (float) MathHelper.atan2(diff.z, -diff.x); + ms.multiply(Vector3f.POSITIVE_Y.getRadialQuaternion((float) (yRot - Math.PI / 2))); + } + ms.translate(0, 3 / 32d, 1/16f); + } + for (int i = 0; i <= count; i++) { ms.push(); - msr.rotateY(angle); - if (!blockItem && !renderUpright) { - ms.translate(0, -.09375, 0); - msr.rotateX(90); - } - if (renderUpright) { - Entity renderViewEntity = Minecraft.getInstance().renderViewEntity; - if (renderViewEntity != null) { - Vec3d positionVec = renderViewEntity.getPositionVec(); - Vec3d vectorForOffset = itemPosition; - Vec3d diff = vectorForOffset.subtract(positionVec); - float yRot = (float) MathHelper.atan2(diff.z, -diff.x); - ms.multiply(Vector3f.POSITIVE_Y.getRadialQuaternion((float) (yRot + Math.PI / 2))); - } - ms.translate(0, 3 / 32d, 0); - } if (blockItem) ms.translate(r.nextFloat() * .0625f * i, 0, r.nextFloat() * .0625f * i); ms.scale(.5f, .5f, .5f); itemRenderer.renderItem(itemStack, TransformType.FIXED, light, overlay, ms, buffer); ms.pop(); - if (!blockItem) - msr.rotateY(10); - ms.translate(0, blockItem ? 1 / 64d : 1 / 16d, 0); + if (!renderUpright) { + if (!blockItem) + msr.rotateY(10); + ms.translate(0, blockItem ? 1 / 64d : 1 / 16d, 0); + } else + ms.translate(0, 0, -1 / 16f); } + + ms.pop(); } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java index be7633544..900f4d45d 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java @@ -1,6 +1,5 @@ package com.simibubi.create.content.logistics.block.depot; -import java.util.ArrayList; import java.util.List; import java.util.function.Function; @@ -12,7 +11,10 @@ import com.simibubi.create.foundation.tileEntity.behaviour.belt.BeltProcessingBe import com.simibubi.create.foundation.tileEntity.behaviour.belt.BeltProcessingBehaviour.ProcessingResult; import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour.TransportedResult; +import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; @@ -21,6 +23,7 @@ import net.minecraft.util.math.Vec3d; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.ItemStackHandler; public class DepotTileEntity extends SmartTileEntity { @@ -85,7 +88,7 @@ public class DepotTileEntity extends SmartTileEntity { if (heldItem.locked != wasLocked || !previousItem.equals(heldItem.stack, false)) sendData(); } - + @Override public void remove() { super.remove(); @@ -125,6 +128,12 @@ public class DepotTileEntity extends SmartTileEntity { this.heldItem = heldItem; } + public void setCenteredHeldItem(TransportedItemStack heldItem) { + this.heldItem = heldItem; + this.heldItem.beltPosition = 0.5f; + this.heldItem.prevBeltPosition = 0.5f; + } + @Override public LazyOptional getCapability(Capability cap, Direction side) { if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) @@ -157,40 +166,32 @@ public class DepotTileEntity extends SmartTileEntity { } private void applyToAllItems(float maxDistanceFromCentre, - Function> processFunction) { + Function processFunction) { if (heldItem == null) return; if (.5f - heldItem.beltPosition > maxDistanceFromCentre) return; boolean dirty = false; - List toBeAdded = new ArrayList<>(); TransportedItemStack transportedItemStack = heldItem; ItemStack stackBefore = transportedItemStack.stack.copy(); - List apply = processFunction.apply(transportedItemStack); - - if (apply == null) - return; - if (apply.size() == 1 && apply.get(0).stack.equals(stackBefore, false)) + TransportedResult result = processFunction.apply(transportedItemStack); + if (result.didntChangeFrom(stackBefore)) return; dirty = true; heldItem = null; - toBeAdded.addAll(apply); - for (TransportedItemStack added : toBeAdded) { - if (heldItem == null) { - heldItem = added; - heldItem.beltPosition = 0.5f; - heldItem.prevBeltPosition = 0.5f; + if (result.hasHeldOutput()) + setCenteredHeldItem(result.getHeldOutput()); + + for (TransportedItemStack added : result.getOutputs()) { + if (getHeldItemStack().isEmpty()) { + setCenteredHeldItem(added); continue; } - for (int i = 0; i < processingOutputBuffer.getSlots(); i++) { - ItemStack stackInSlot = processingOutputBuffer.getStackInSlot(i); - if (!stackInSlot.isEmpty()) - continue; - processingOutputBuffer.setStackInSlot(i, added.stack); - break; - } + ItemStack remainder = ItemHandlerHelper.insertItemStacked(processingOutputBuffer, added.stack, false); + Vec3d vec = VecHelper.getCenterOf(pos); + InventoryHelper.spawnItemStack(world, vec.x, vec.y + .5f, vec.z, remainder); } if (dirty) { diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java index d369d0468..0c66a98a5 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java @@ -1,6 +1,5 @@ package com.simibubi.create.content.logistics.block.funnel; -import java.util.ArrayList; import java.util.List; import java.util.function.Supplier; @@ -15,6 +14,7 @@ import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour; +import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour.TransportedResult; import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.inventory.ExtractingBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.inventory.InsertingBehaviour; @@ -148,21 +148,22 @@ public class FunnelTileEntity extends SmartTileEntity { extracting.extract(); } - private List collectFromHandler(TransportedItemStack stack) { + private TransportedResult collectFromHandler(TransportedItemStack stack) { + TransportedResult ignore = TransportedResult.doNothing(); ItemStack toInsert = stack.stack.copy(); if (!filtering.test(toInsert)) - return null; + return ignore; ItemStack remainder = inserting.insert(toInsert, false); if (remainder.equals(stack.stack, false)) - return null; - List list = new ArrayList<>(); + return ignore; + flap(true); + if (remainder.isEmpty()) - return list; + return TransportedResult.removeItem(); TransportedItemStack changed = stack.copy(); changed.stack = remainder; - list.add(changed); - return list; + return TransportedResult.convertTo(changed); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/data/recipe/CreateRecipeProvider.java b/src/main/java/com/simibubi/create/foundation/data/recipe/CreateRecipeProvider.java index 386f7c64d..22ba2e61e 100644 --- a/src/main/java/com/simibubi/create/foundation/data/recipe/CreateRecipeProvider.java +++ b/src/main/java/com/simibubi/create/foundation/data/recipe/CreateRecipeProvider.java @@ -28,14 +28,14 @@ public abstract class CreateRecipeProvider extends RecipeProvider { @Override protected void registerRecipes(Consumer p_200404_1_) { all.forEach(c -> c.register(p_200404_1_)); - Create.logger.info(getName() + " registered " + all.size() + " recipes"); + Create.logger.info(getName() + " registered " + all.size() + " recipe" + (all.size() == 1 ? "" : "s")); } @FunctionalInterface interface GeneratedRecipe { void register(Consumer consumer); } - + protected GeneratedRecipe register(GeneratedRecipe recipe) { all.add(recipe); return recipe; @@ -53,7 +53,7 @@ public abstract class CreateRecipeProvider extends RecipeProvider { static Tag gold() { return AllTags.forgeItemTag("ingots/gold"); } - + static Tag goldSheet() { return AllTags.forgeItemTag("plates/gold"); } diff --git a/src/main/java/com/simibubi/create/foundation/data/recipe/FillingRecipeGen.java b/src/main/java/com/simibubi/create/foundation/data/recipe/FillingRecipeGen.java new file mode 100644 index 000000000..1f2a26e01 --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/data/recipe/FillingRecipeGen.java @@ -0,0 +1,31 @@ +package com.simibubi.create.foundation.data.recipe; + +import com.simibubi.create.AllRecipeTypes; + +import net.minecraft.data.DataGenerator; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; +import net.minecraft.potion.PotionUtils; +import net.minecraft.potion.Potions; +import net.minecraft.tags.FluidTags; + +public class FillingRecipeGen extends ProcessingRecipeGen { + + GeneratedRecipe + + WATER_BOTTLE = create("water_bottle", b -> b.require(Items.GLASS_BOTTLE) + .require(FluidTags.WATER, 250) + .output(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), Potions.WATER))) + + ; + + public FillingRecipeGen(DataGenerator p_i48262_1_) { + super(p_i48262_1_); + } + + @Override + protected AllRecipeTypes getRecipeType() { + return AllRecipeTypes.FILLING; + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/data/recipe/ProcessingRecipeGen.java b/src/main/java/com/simibubi/create/foundation/data/recipe/ProcessingRecipeGen.java index 06e567116..a5daca809 100644 --- a/src/main/java/com/simibubi/create/foundation/data/recipe/ProcessingRecipeGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/recipe/ProcessingRecipeGen.java @@ -1,5 +1,8 @@ package com.simibubi.create.foundation.data.recipe; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; import java.util.function.Supplier; import java.util.function.UnaryOperator; @@ -10,23 +13,46 @@ import com.simibubi.create.content.contraptions.processing.ProcessingRecipeBuild import com.simibubi.create.content.contraptions.processing.ProcessingRecipeSerializer; import net.minecraft.data.DataGenerator; +import net.minecraft.data.DirectoryCache; +import net.minecraft.data.IDataProvider; import net.minecraft.item.crafting.Ingredient; import net.minecraft.util.IItemProvider; import net.minecraftforge.fluids.FluidAttributes; public abstract class ProcessingRecipeGen extends CreateRecipeProvider { + protected static List generators = new ArrayList<>(); protected static final int BUCKET = FluidAttributes.BUCKET_VOLUME; protected static final int BOTTLE = 250; public static void registerAll(DataGenerator gen) { - gen.addProvider(new CrushingRecipeGen(gen)); - gen.addProvider(new MillingRecipeGen(gen)); - gen.addProvider(new CuttingRecipeGen(gen)); - gen.addProvider(new WashingRecipeGen(gen)); - gen.addProvider(new PolishingRecipeGen(gen)); - gen.addProvider(new MixingRecipeGen(gen)); - gen.addProvider(new PressingRecipeGen(gen)); + generators.add(new CrushingRecipeGen(gen)); + generators.add(new MillingRecipeGen(gen)); + generators.add(new CuttingRecipeGen(gen)); + generators.add(new WashingRecipeGen(gen)); + generators.add(new PolishingRecipeGen(gen)); + generators.add(new MixingRecipeGen(gen)); + generators.add(new PressingRecipeGen(gen)); + generators.add(new FillingRecipeGen(gen)); + + gen.addProvider(new IDataProvider() { + + @Override + public String getName() { + return "Create's Processing Recipes"; + } + + @Override + public void act(DirectoryCache dc) throws IOException { + generators.forEach(g -> { + try { + g.act(dc); + } catch (IOException e) { + e.printStackTrace(); + } + }); + } + }); } public ProcessingRecipeGen(DataGenerator p_i48262_1_) { diff --git a/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java b/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java index 2a1d6cab4..6e097a0e4 100644 --- a/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java +++ b/src/main/java/com/simibubi/create/foundation/fluid/FluidIngredient.java @@ -7,6 +7,7 @@ import javax.annotation.Nullable; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; import net.minecraft.fluid.Fluid; @@ -28,14 +29,14 @@ public abstract class FluidIngredient implements Predicate { ingredient.amountRequired = amount; return ingredient; } - + public static FluidIngredient fromFluid(Fluid fluid, int amount) { FluidStackIngredient ingredient = new FluidStackIngredient(); ingredient.fluid = fluid; ingredient.amountRequired = amount; return ingredient; } - + protected int amountRequired; protected abstract boolean testInternal(FluidStack t); @@ -111,7 +112,7 @@ public abstract class FluidIngredient implements Predicate { protected Fluid fluid; protected CompoundNBT tagToMatch; - + public FluidStackIngredient() { tagToMatch = new CompoundNBT(); } @@ -150,7 +151,7 @@ public abstract class FluidIngredient implements Predicate { protected void writeInternal(JsonObject json) { json.addProperty("fluid", fluid.getRegistryName() .toString()); - json.addProperty("nbt", tagToMatch.toString()); + json.add("nbt", new JsonParser().parse(tagToMatch.toString())); } } diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/belt/TransportedItemStackHandlerBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/belt/TransportedItemStackHandlerBehaviour.java index d7c9c154d..b0cfab7b4 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/belt/TransportedItemStackHandlerBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/belt/TransportedItemStackHandlerBehaviour.java @@ -3,12 +3,16 @@ package com.simibubi.create.foundation.tileEntity.behaviour.belt; import java.util.List; import java.util.function.Function; +import javax.annotation.Nullable; + +import com.google.common.collect.ImmutableList; import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack; import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.BehaviourType; import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.item.ItemStack; import net.minecraft.util.math.Vec3d; public class TransportedItemStackHandlerBehaviour extends TileEntityBehaviour { @@ -17,6 +21,68 @@ public class TransportedItemStackHandlerBehaviour extends TileEntityBehaviour { private ProcessingCallback processingCallback; private PositionGetter positionGetter; + public static class TransportedResult { + List outputs; + TransportedItemStack heldOutput; + + private static final TransportedResult DO_NOTHING = new TransportedResult(null, null); + private static final TransportedResult REMOVE_ITEM = new TransportedResult(ImmutableList.of(), null); + + public static TransportedResult doNothing() { + return DO_NOTHING; + } + + public static TransportedResult removeItem() { + return REMOVE_ITEM; + } + + public static TransportedResult convertTo(TransportedItemStack output) { + return new TransportedResult(ImmutableList.of(output), null); + } + + public static TransportedResult convertTo(List outputs) { + return new TransportedResult(outputs, null); + } + + public static TransportedResult convertToAndLeaveHeld(List outputs, + TransportedItemStack heldOutput) { + return new TransportedResult(outputs, heldOutput); + } + + private TransportedResult(List outputs, TransportedItemStack heldOutput) { + this.outputs = outputs; + this.heldOutput = heldOutput; + } + + public boolean doesNothing() { + return outputs == null; + } + + public boolean didntChangeFrom(ItemStack stackBefore) { + return doesNothing() + || outputs.size() == 1 && outputs.get(0).stack.equals(stackBefore, false) && !hasHeldOutput(); + } + + public List getOutputs() { + if (outputs == null) + throw new IllegalStateException("Do not call getOutputs() on a Result that doesNothing()."); + return outputs; + } + + public boolean hasHeldOutput() { + return heldOutput != null; + } + + @Nullable + public TransportedItemStack getHeldOutput() { + if (heldOutput == null) + throw new IllegalStateException( + "Do not call getHeldOutput() on a Result with hasHeldOutput() == false."); + return heldOutput; + } + + } + public TransportedItemStackHandlerBehaviour(SmartTileEntity te, ProcessingCallback processingCallback) { super(te); this.processingCallback = processingCallback; @@ -28,11 +94,11 @@ public class TransportedItemStackHandlerBehaviour extends TileEntityBehaviour { return this; } - public void handleProcessingOnAllItems(Function> processFunction) { + public void handleProcessingOnAllItems(Function processFunction) { handleCenteredProcessingOnAllItems(.51f, processFunction); } - - public void handleProcessingOnItem(TransportedItemStack item, List processOutput) { + + public void handleProcessingOnItem(TransportedItemStack item, TransportedResult processOutput) { handleCenteredProcessingOnAllItems(.51f, t -> { if (t == item) return processOutput; @@ -41,7 +107,7 @@ public class TransportedItemStackHandlerBehaviour extends TileEntityBehaviour { } public void handleCenteredProcessingOnAllItems(float maxDistanceFromCenter, - Function> processFunction) { + Function processFunction) { this.processingCallback.applyToAllItems(maxDistanceFromCenter, processFunction); } @@ -57,7 +123,7 @@ public class TransportedItemStackHandlerBehaviour extends TileEntityBehaviour { @FunctionalInterface public interface ProcessingCallback { public void applyToAllItems(float maxDistanceFromCenter, - Function> processFunction); + Function processFunction); } @FunctionalInterface diff --git a/src/main/resources/assets/create/models/block/spout/block.json b/src/main/resources/assets/create/models/block/spout/block.json index f431e3989..6244a12c0 100644 --- a/src/main/resources/assets/create/models/block/spout/block.json +++ b/src/main/resources/assets/create/models/block/spout/block.json @@ -12,10 +12,10 @@ "to": [14, 16, 14], "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, -23]}, "faces": { - "north": {"uv": [1, 0, 7, 1], "texture": "#0", "cullface": "north"}, - "east": {"uv": [1, 0, 7, 1], "texture": "#0", "cullface": "east"}, - "south": {"uv": [1, 0, 7, 1], "texture": "#0", "cullface": "south"}, - "west": {"uv": [1, 0, 7, 1], "texture": "#0", "cullface": "west"}, + "north": {"uv": [1, 0, 7, 1], "texture": "#0"}, + "east": {"uv": [1, 0, 7, 1], "texture": "#0"}, + "south": {"uv": [1, 0, 7, 1], "texture": "#0"}, + "west": {"uv": [1, 0, 7, 1], "texture": "#0"}, "up": {"uv": [1, 9, 7, 15], "texture": "#0"} } }, @@ -25,12 +25,12 @@ "to": [15, 14, 15], "rotation": {"angle": 0, "axis": "y", "origin": [7, 6, -24]}, "faces": { - "north": {"uv": [0.5, 1, 7.5, 2], "texture": "#0", "cullface": "north"}, - "east": {"uv": [0.5, 1, 7.5, 2], "texture": "#0", "cullface": "east"}, - "south": {"uv": [0.5, 1, 7.5, 2], "texture": "#0", "cullface": "south"}, - "west": {"uv": [0.5, 1, 7.5, 2], "texture": "#0", "cullface": "west"}, + "north": {"uv": [0.5, 1, 7.5, 2], "texture": "#0"}, + "east": {"uv": [0.5, 1, 7.5, 2], "texture": "#0"}, + "south": {"uv": [0.5, 1, 7.5, 2], "texture": "#0"}, + "west": {"uv": [0.5, 1, 7.5, 2], "texture": "#0"}, "up": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#0"}, - "down": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#0", "cullface": "down"} + "down": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#0"} } }, { @@ -39,11 +39,11 @@ "to": [14, 2, 14], "rotation": {"angle": 0, "axis": "y", "origin": [8, 8, -23]}, "faces": { - "north": {"uv": [1, 7, 7, 8], "texture": "#0", "cullface": "north"}, - "east": {"uv": [1, 7, 7, 8], "texture": "#0", "cullface": "east"}, - "south": {"uv": [1, 7, 7, 8], "texture": "#0", "cullface": "south"}, - "west": {"uv": [1, 7, 7, 8], "texture": "#0", "cullface": "west"}, - "down": {"uv": [9, 9, 15, 15], "texture": "#0", "cullface": "down"} + "north": {"uv": [1, 7, 7, 8], "texture": "#0"}, + "east": {"uv": [1, 7, 7, 8], "texture": "#0"}, + "south": {"uv": [1, 7, 7, 8], "texture": "#0"}, + "west": {"uv": [1, 7, 7, 8], "texture": "#0"}, + "down": {"uv": [9, 9, 15, 15], "texture": "#0"} } }, { @@ -52,12 +52,12 @@ "to": [15, 4, 15], "rotation": {"angle": 0, "axis": "y", "origin": [7, -4, -24]}, "faces": { - "north": {"uv": [0.5, 6, 7.5, 7], "texture": "#0", "cullface": "north"}, - "east": {"uv": [1, 6, 7.5, 7], "texture": "#0", "cullface": "east"}, - "south": {"uv": [0.5, 6, 7.5, 7], "texture": "#0", "cullface": "south"}, - "west": {"uv": [0.5, 6, 7.5, 7], "texture": "#0", "cullface": "west"}, + "north": {"uv": [0.5, 6, 7.5, 7], "texture": "#0"}, + "east": {"uv": [1, 6, 7.5, 7], "texture": "#0"}, + "south": {"uv": [0.5, 6, 7.5, 7], "texture": "#0"}, + "west": {"uv": [0.5, 6, 7.5, 7], "texture": "#0"}, "up": {"uv": [8.5, 8.5, 15.5, 15.5], "texture": "#0"}, - "down": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#0", "cullface": "down"} + "down": {"uv": [0.5, 8.5, 7.5, 15.5], "texture": "#0"} } }, { @@ -66,9 +66,9 @@ "to": [2, 12, 10], "faces": { "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "east": {"uv": [9, 0, 11, 4], "texture": "#0", "cullface": "west"}, + "east": {"uv": [9, 0, 11, 4], "texture": "#0"}, "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, - "west": {"uv": [9, 0, 11, 4], "texture": "#0", "cullface": "west"}, + "west": {"uv": [9, 0, 11, 4], "texture": "#0"}, "up": {"uv": [0, 0, 0, 0], "texture": "#0"}, "down": {"uv": [0, 0, 0, 0], "texture": "#0"} } @@ -78,10 +78,10 @@ "from": [6, 4, 2], "to": [10, 12, 2], "faces": { - "north": {"uv": [9, 0, 11, 4], "texture": "#0", "cullface": "west"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0", "cullface": "west"}, - "south": {"uv": [9, 0, 11, 4], "texture": "#0", "cullface": "west"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0", "cullface": "west"}, + "north": {"uv": [9, 0, 11, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [9, 0, 11, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, "up": {"uv": [0, 0, 0, 0], "rotation": 90, "texture": "#0"}, "down": {"uv": [0, 0, 0, 0], "rotation": 270, "texture": "#0"} } @@ -91,10 +91,10 @@ "from": [14, 4, 6], "to": [14, 12, 10], "faces": { - "north": {"uv": [0, 0, 0, 0], "texture": "#0", "cullface": "west"}, - "east": {"uv": [9, 0, 11, 4], "texture": "#0", "cullface": "west"}, - "south": {"uv": [0, 0, 0, 0], "texture": "#0", "cullface": "west"}, - "west": {"uv": [9, 0, 11, 4], "texture": "#0", "cullface": "west"}, + "north": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [9, 0, 11, 4], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [9, 0, 11, 4], "texture": "#0"}, "up": {"uv": [0, 0, 0, 0], "rotation": 180, "texture": "#0"}, "down": {"uv": [0, 0, 0, 0], "rotation": 180, "texture": "#0"} } @@ -104,10 +104,10 @@ "from": [6, 4, 14], "to": [10, 12, 14], "faces": { - "north": {"uv": [9, 0, 11, 4], "texture": "#0", "cullface": "west"}, - "east": {"uv": [0, 0, 0, 0], "texture": "#0", "cullface": "west"}, - "south": {"uv": [9, 0, 11, 4], "texture": "#0", "cullface": "west"}, - "west": {"uv": [0, 0, 0, 0], "texture": "#0", "cullface": "west"}, + "north": {"uv": [9, 0, 11, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [9, 0, 11, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 0], "texture": "#0"}, "up": {"uv": [0, 0, 0, 0], "rotation": 270, "texture": "#0"}, "down": {"uv": [0, 0, 0, 0], "rotation": 90, "texture": "#0"} } @@ -117,9 +117,9 @@ "from": [1, 4, 1], "to": [2, 12, 6], "faces": { - "east": {"uv": [5, 2, 7.5, 6], "texture": "#0", "cullface": "west"}, - "south": {"uv": [7, 4.5, 7.5, 5], "texture": "#0", "cullface": "west"}, - "west": {"uv": [0.5, 2, 3, 6], "texture": "#0", "cullface": "west"} + "east": {"uv": [5, 2, 7.5, 6], "texture": "#0"}, + "south": {"uv": [7, 4.5, 7.5, 5], "texture": "#0"}, + "west": {"uv": [0.5, 2, 3, 6], "texture": "#0"} } }, { @@ -127,9 +127,9 @@ "from": [10, 4, 1], "to": [15, 12, 2], "faces": { - "north": {"uv": [0.5, 2, 3, 6], "texture": "#0", "cullface": "west"}, - "south": {"uv": [5, 2, 7.5, 6], "texture": "#0", "cullface": "west"}, - "west": {"uv": [7, 4.5, 7.5, 5], "texture": "#0", "cullface": "west"} + "north": {"uv": [0.5, 2, 3, 6], "texture": "#0"}, + "south": {"uv": [5, 2, 7.5, 6], "texture": "#0"}, + "west": {"uv": [7, 4.5, 7.5, 5], "texture": "#0"} } }, { @@ -137,9 +137,9 @@ "from": [14, 4, 10], "to": [15, 12, 15], "faces": { - "north": {"uv": [7, 4.5, 7.5, 5], "texture": "#0", "cullface": "west"}, - "east": {"uv": [0.5, 2, 3, 6], "texture": "#0", "cullface": "west"}, - "west": {"uv": [5, 2, 7.5, 6], "texture": "#0", "cullface": "west"} + "north": {"uv": [7, 4.5, 7.5, 5], "texture": "#0"}, + "east": {"uv": [0.5, 2, 3, 6], "texture": "#0"}, + "west": {"uv": [5, 2, 7.5, 6], "texture": "#0"} } }, { @@ -147,9 +147,9 @@ "from": [1, 4, 14], "to": [6, 12, 15], "faces": { - "north": {"uv": [5, 2, 7.5, 6], "texture": "#0", "cullface": "west"}, - "east": {"uv": [7, 4.5, 7.5, 5], "texture": "#0", "cullface": "west"}, - "south": {"uv": [0.5, 2, 3, 6], "texture": "#0", "cullface": "west"} + "north": {"uv": [5, 2, 7.5, 6], "texture": "#0"}, + "east": {"uv": [7, 4.5, 7.5, 5], "texture": "#0"}, + "south": {"uv": [0.5, 2, 3, 6], "texture": "#0"} } }, { @@ -157,9 +157,9 @@ "from": [1, 4, 10], "to": [2, 12, 15], "faces": { - "north": {"uv": [7, 3.5, 7.5, 4], "texture": "#0", "cullface": "west"}, - "east": {"uv": [0.5, 2, 3, 6], "texture": "#0", "cullface": "west"}, - "west": {"uv": [5, 2, 7.5, 6], "texture": "#0", "cullface": "west"} + "north": {"uv": [7, 3.5, 7.5, 4], "texture": "#0"}, + "east": {"uv": [0.5, 2, 3, 6], "texture": "#0"}, + "west": {"uv": [5, 2, 7.5, 6], "texture": "#0"} } }, { @@ -167,9 +167,9 @@ "from": [1, 4, 1], "to": [6, 12, 2], "faces": { - "north": {"uv": [5, 2, 7.5, 6], "texture": "#0", "cullface": "west"}, - "east": {"uv": [7, 3.5, 7.5, 4], "texture": "#0", "cullface": "west"}, - "south": {"uv": [0.5, 2, 3, 6], "texture": "#0", "cullface": "west"} + "north": {"uv": [5, 2, 7.5, 6], "texture": "#0"}, + "east": {"uv": [7, 3.5, 7.5, 4], "texture": "#0"}, + "south": {"uv": [0.5, 2, 3, 6], "texture": "#0"} } }, { @@ -177,9 +177,9 @@ "from": [14, 4, 1], "to": [15, 12, 6], "faces": { - "east": {"uv": [5, 2, 7.5, 6], "texture": "#0", "cullface": "west"}, - "south": {"uv": [7, 3.5, 7.5, 4], "texture": "#0", "cullface": "west"}, - "west": {"uv": [0.5, 2, 3, 6], "texture": "#0", "cullface": "west"} + "east": {"uv": [5, 2, 7.5, 6], "texture": "#0"}, + "south": {"uv": [7, 3.5, 7.5, 4], "texture": "#0"}, + "west": {"uv": [0.5, 2, 3, 6], "texture": "#0"} } }, { @@ -187,9 +187,9 @@ "from": [10, 4, 14], "to": [15, 12, 15], "faces": { - "north": {"uv": [0.5, 2, 3, 6], "texture": "#0", "cullface": "west"}, - "south": {"uv": [5, 2, 7.5, 6], "texture": "#0", "cullface": "west"}, - "west": {"uv": [7, 3.5, 7.5, 4], "texture": "#0", "cullface": "west"} + "north": {"uv": [0.5, 2, 3, 6], "texture": "#0"}, + "south": {"uv": [5, 2, 7.5, 6], "texture": "#0"}, + "west": {"uv": [7, 3.5, 7.5, 4], "texture": "#0"} } } ] diff --git a/src/main/resources/assets/create/models/block/spout/spout.bbmodel b/src/main/resources/assets/create/models/block/spout/spout.bbmodel deleted file mode 100644 index 29769c088..000000000 --- a/src/main/resources/assets/create/models/block/spout/spout.bbmodel +++ /dev/null @@ -1 +0,0 @@ -{"meta":{"format_version":"3.2","model_format":"java_block","box_uv":false},"name":"block","parent":"block/block","ambientocclusion":true,"front_gui_light":false,"resolution":{"width":16,"height":16},"elements":[{"name":"Window","from":[2,4,6],"to":[2,12,10],"autouv":0,"color":0,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[0,0,0,0],"texture":0},"east":{"uv":[9,0,11,4],"texture":0,"cullface":"west"},"south":{"uv":[0,0,0,0],"texture":0},"west":{"uv":[9,0,11,4],"texture":0,"cullface":"west"},"up":{"uv":[0,0,0,0],"texture":0},"down":{"uv":[0,0,0,0],"texture":0}},"uuid":"a73deada-bd1e-f0c1-1c22-429226a34bad"},{"name":"Bottom","from":[2,0,2],"to":[14,2,14],"autouv":0,"color":3,"locked":false,"origin":[8,8,-23],"faces":{"north":{"uv":[1,7,7,8],"texture":0,"cullface":"north"},"east":{"uv":[1,7,7,8],"texture":0,"cullface":"east"},"south":{"uv":[1,7,7,8],"texture":0,"cullface":"south"},"west":{"uv":[1,7,7,8],"texture":0,"cullface":"west"},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[9,9,15,15],"texture":0,"cullface":"down"}},"uuid":"ed1e57df-cc92-953e-0e22-7dd4116d7f33"},{"name":"Top 1","from":[2,14,2],"to":[14,16,14],"autouv":0,"color":3,"locked":false,"origin":[8,8,-23],"faces":{"north":{"uv":[1,0,7,1],"texture":0,"cullface":"north"},"east":{"uv":[1,0,7,1],"texture":0,"cullface":"east"},"south":{"uv":[1,0,7,1],"texture":0,"cullface":"south"},"west":{"uv":[1,0,7,1],"texture":0,"cullface":"west"},"up":{"uv":[1,9,7,15],"texture":0},"down":{"uv":[0,0,0,0],"texture":null,"cullface":"down"}},"uuid":"b317e546-21fe-b729-b355-6b66255c301e"},{"name":"Top 2","from":[1,12,1],"to":[15,14,15],"autouv":0,"color":3,"locked":false,"origin":[7,6,-24],"faces":{"north":{"uv":[0.5,1,7.5,2],"texture":0,"cullface":"north"},"east":{"uv":[0.5,1,7.5,2],"texture":0,"cullface":"east"},"south":{"uv":[0.5,1,7.5,2],"texture":0,"cullface":"south"},"west":{"uv":[0.5,1,7.5,2],"texture":0,"cullface":"west"},"up":{"uv":[0.5,8.5,7.5,15.5],"texture":0},"down":{"uv":[0.5,8.5,7.5,15.5],"texture":0,"cullface":"down"}},"uuid":"046b3d4e-ce48-9726-c098-51fd237ebb1e"},{"name":"Bottom 2","from":[1,2,1],"to":[15,4,15],"autouv":0,"color":3,"locked":false,"origin":[7,-4,-24],"faces":{"north":{"uv":[0.5,6,7.5,7],"texture":0,"cullface":"north"},"east":{"uv":[1,6,7.5,7],"texture":0,"cullface":"east"},"south":{"uv":[0.5,6,7.5,7],"texture":0,"cullface":"south"},"west":{"uv":[0.5,6,7.5,7],"texture":0,"cullface":"west"},"up":{"uv":[8.5,8.5,15.5,15.5],"texture":0},"down":{"uv":[0.5,8.5,7.5,15.5],"texture":0,"cullface":"down"}},"uuid":"f2793602-5903-28d5-a736-e3370d9bef9e"},{"name":"SideLeft","from":[1,4,1],"to":[2,12,6],"autouv":0,"color":0,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[0,0,0,0],"texture":null,"cullface":"west"},"east":{"uv":[5,2,7.5,6],"texture":0,"cullface":"west"},"south":{"uv":[7,4.5,7.5,5],"texture":0,"cullface":"west"},"west":{"uv":[0.5,2,3,6],"texture":0,"cullface":"west"},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"844e2696-f087-b1bb-62c7-8e4e5f48b7b1"},{"name":"SideRight","from":[1,4,10],"to":[2,12,15],"autouv":0,"color":7,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[7,3.5,7.5,4],"texture":0,"cullface":"west"},"east":{"uv":[0.5,2,3,6],"texture":0,"cullface":"west"},"south":{"uv":[0,0,0,0],"texture":null,"cullface":"west"},"west":{"uv":[5,2,7.5,6],"texture":0,"cullface":"west"},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[0,0,0,0],"texture":null}},"uuid":"2d635929-3cd2-ac14-523d-32a7f1ecde44"},{"name":"Window","from":[6,4,2],"to":[10,12,2],"autouv":0,"color":0,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[9,0,11,4],"texture":0,"cullface":"west"},"east":{"uv":[0,0,0,0],"texture":0,"cullface":"west"},"south":{"uv":[9,0,11,4],"texture":0,"cullface":"west"},"west":{"uv":[0,0,0,0],"texture":0,"cullface":"west"},"up":{"uv":[0,0,0,0],"rotation":90,"texture":0},"down":{"uv":[0,0,0,0],"rotation":270,"texture":0}},"uuid":"7edd91a4-4dca-394c-8b71-d02f0945f987"},{"name":"SideLeft","from":[10,4,1],"to":[15,12,2],"autouv":0,"color":0,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[0.5,2,3,6],"texture":0,"cullface":"west"},"east":{"uv":[0,0,0,0],"texture":null,"cullface":"west"},"south":{"uv":[5,2,7.5,6],"texture":0,"cullface":"west"},"west":{"uv":[7,4.5,7.5,5],"texture":0,"cullface":"west"},"up":{"uv":[0,0,0,0],"rotation":90,"texture":null},"down":{"uv":[0,0,0,0],"rotation":270,"texture":null}},"uuid":"a7d5e4c4-a1c0-2b48-56dc-f5f2ebb9bf44"},{"name":"SideRight","from":[1,4,1],"to":[6,12,2],"autouv":0,"color":7,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[5,2,7.5,6],"texture":0,"cullface":"west"},"east":{"uv":[7,3.5,7.5,4],"texture":0,"cullface":"west"},"south":{"uv":[0.5,2,3,6],"texture":0,"cullface":"west"},"west":{"uv":[0,0,0,0],"texture":null,"cullface":"west"},"up":{"uv":[0,0,0,0],"rotation":90,"texture":null},"down":{"uv":[0,0,0,0],"rotation":270,"texture":null}},"uuid":"255e2f2e-8472-c5d8-9c28-9c3b82ed8d4e"},{"name":"Window","from":[14,4,6],"to":[14,12,10],"autouv":0,"color":0,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[0,0,0,0],"texture":0,"cullface":"west"},"east":{"uv":[9,0,11,4],"texture":0,"cullface":"west"},"south":{"uv":[0,0,0,0],"texture":0,"cullface":"west"},"west":{"uv":[9,0,11,4],"texture":0,"cullface":"west"},"up":{"uv":[0,0,0,0],"rotation":180,"texture":0},"down":{"uv":[0,0,0,0],"rotation":180,"texture":0}},"uuid":"5bedaf99-8d4b-f97f-40c6-9233dd0f7871"},{"name":"SideLeft","from":[14,4,10],"to":[15,12,15],"autouv":0,"color":0,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[7,4.5,7.5,5],"texture":0,"cullface":"west"},"east":{"uv":[0.5,2,3,6],"texture":0,"cullface":"west"},"south":{"uv":[0,0,0,0],"texture":null,"cullface":"west"},"west":{"uv":[5,2,7.5,6],"texture":0,"cullface":"west"},"up":{"uv":[0,0,0,0],"rotation":180,"texture":null},"down":{"uv":[0,0,0,0],"rotation":180,"texture":null}},"uuid":"152c3e26-c5e0-cab0-9e98-636905590b2d"},{"name":"SideRight","from":[14,4,1],"to":[15,12,6],"autouv":0,"color":7,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[0,0,0,0],"texture":null,"cullface":"west"},"east":{"uv":[5,2,7.5,6],"texture":0,"cullface":"west"},"south":{"uv":[7,3.5,7.5,4],"texture":0,"cullface":"west"},"west":{"uv":[0.5,2,3,6],"texture":0,"cullface":"west"},"up":{"uv":[0,0,0,0],"rotation":180,"texture":null},"down":{"uv":[0,0,0,0],"rotation":180,"texture":null}},"uuid":"7de3f17f-c83b-54f4-cd8f-da48829ec093"},{"name":"Window","from":[6,4,14],"to":[10,12,14],"autouv":0,"color":0,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[9,0,11,4],"texture":0,"cullface":"west"},"east":{"uv":[0,0,0,0],"texture":0,"cullface":"west"},"south":{"uv":[9,0,11,4],"texture":0,"cullface":"west"},"west":{"uv":[0,0,0,0],"texture":0,"cullface":"west"},"up":{"uv":[0,0,0,0],"rotation":270,"texture":0},"down":{"uv":[0,0,0,0],"rotation":90,"texture":0}},"uuid":"2e0bb10a-c034-8edc-86f0-9812120b3e71"},{"name":"SideLeft","from":[1,4,14],"to":[6,12,15],"autouv":0,"color":0,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[5,2,7.5,6],"texture":0,"cullface":"west"},"east":{"uv":[7,4.5,7.5,5],"texture":0,"cullface":"west"},"south":{"uv":[0.5,2,3,6],"texture":0,"cullface":"west"},"west":{"uv":[0,0,0,0],"texture":null,"cullface":"west"},"up":{"uv":[0,0,0,0],"rotation":270,"texture":null},"down":{"uv":[0,0,0,0],"rotation":90,"texture":null}},"uuid":"c4ce090d-cfad-8b59-cdbd-9992a65fa7e4"},{"name":"SideRight","from":[10,4,14],"to":[15,12,15],"autouv":0,"color":7,"locked":false,"origin":[8,8,8],"faces":{"north":{"uv":[0.5,2,3,6],"texture":0,"cullface":"west"},"east":{"uv":[0,0,0,0],"texture":null,"cullface":"west"},"south":{"uv":[5,2,7.5,6],"texture":0,"cullface":"west"},"west":{"uv":[7,3.5,7.5,4],"texture":0,"cullface":"west"},"up":{"uv":[0,0,0,0],"rotation":270,"texture":null},"down":{"uv":[0,0,0,0],"rotation":90,"texture":null}},"uuid":"5d8ebdaf-3ee4-d5f0-d91e-1793cab0a874"},{"name":"cube","from":[4,-2,4],"to":[12,0,12],"autouv":0,"color":6,"locked":false,"origin":[15.5,5.5,15.5],"faces":{"north":{"uv":[12,6,16,7],"texture":0},"east":{"uv":[12,6,16,7],"texture":0},"south":{"uv":[12,6,16,7],"texture":0},"west":{"uv":[12,6,16,7],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[12,2,16,6],"texture":0}},"uuid":"8509bb1f-d9b5-51a1-5aa8-2961f815e4fc"},{"name":"cube","from":[5,-4,5],"to":[11,-2,11],"autouv":0,"color":6,"locked":false,"origin":[16.5,3.5,16.5],"faces":{"north":{"uv":[12.5,7,15.5,8],"texture":0},"east":{"uv":[12.5,7,15.5,8],"texture":0},"south":{"uv":[12.5,7,15.5,8],"texture":0},"west":{"uv":[12.5,7,15.5,8],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[12.5,2.5,15.5,5.5],"texture":0}},"uuid":"d13b2ce6-cfa1-212a-0c58-73e5e21c44a1"},{"name":"cube","from":[6,-7,6],"to":[10,-4,10],"autouv":0,"color":6,"locked":false,"origin":[16.5,3.5,16.5],"faces":{"north":{"uv":[12,0.5,14,2],"texture":0},"east":{"uv":[12,0.5,14,2],"texture":0},"south":{"uv":[12,0.5,14,2],"texture":0},"west":{"uv":[12,0.5,14,2],"texture":0},"up":{"uv":[0,0,0,0],"texture":null},"down":{"uv":[14,0,16,2],"texture":0}},"uuid":"844b3f6d-13db-53df-bb83-b82e836e4669"}],"outliner":[{"name":"tank","uuid":"16cd71e5-1490-89a8-0d35-1e5cb06011e2","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"origin":[8,8,-23],"children":[{"name":"Top+Bottom","uuid":"1f201699-622f-6306-1b37-4d996492f36e","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"origin":[8,8,-23],"children":[{"name":"Top","uuid":"614d55b1-69ce-3d4e-3fe8-f21ca5ec2e99","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"origin":[8,8,-23],"children":["b317e546-21fe-b729-b355-6b66255c301e","046b3d4e-ce48-9726-c098-51fd237ebb1e"]},{"name":"Bottom","uuid":"572e5ce4-3d39-987f-c4b7-5b58608c7f95","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"origin":[8,8,-23],"children":["ed1e57df-cc92-953e-0e22-7dd4116d7f33","f2793602-5903-28d5-a736-e3370d9bef9e"]}]},{"name":"Sides","uuid":"1457c56a-8901-25b5-9b0b-4b19e5397baf","export":true,"isOpen":true,"locked":false,"visibility":true,"autouv":0,"origin":[8,8,-23],"children":["a73deada-bd1e-f0c1-1c22-429226a34bad","7edd91a4-4dca-394c-8b71-d02f0945f987","5bedaf99-8d4b-f97f-40c6-9233dd0f7871","2e0bb10a-c034-8edc-86f0-9812120b3e71","844e2696-f087-b1bb-62c7-8e4e5f48b7b1","a7d5e4c4-a1c0-2b48-56dc-f5f2ebb9bf44","152c3e26-c5e0-cab0-9e98-636905590b2d","c4ce090d-cfad-8b59-cdbd-9992a65fa7e4","2d635929-3cd2-ac14-523d-32a7f1ecde44","255e2f2e-8472-c5d8-9c28-9c3b82ed8d4e","7de3f17f-c83b-54f4-cd8f-da48829ec093","5d8ebdaf-3ee4-d5f0-d91e-1793cab0a874"]},"8509bb1f-d9b5-51a1-5aa8-2961f815e4fc","d13b2ce6-cfa1-212a-0c58-73e5e21c44a1","844b3f6d-13db-53df-bb83-b82e836e4669"]}],"textures":[{"path":"C:\\Users\\simon\\Desktop\\Forgespace 1.15\\Create\\src\\main\\resources\\assets\\create\\textures\\block\\spout.png","name":"spout.png","folder":"block","namespace":"create","id":"0","particle":false,"mode":"bitmap","saved":true,"uuid":"683ef638-658b-18dc-24d6-2f2069b65684","source":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAEcElEQVRYR8WXX2hbVRzHf2nS9LZNYtqkf1brrNJhZFpDy6C0aMsmCj44q+KQgeDDiggKPtg+OWEK0oIIIj50glDYw0StigyUbWzKSmFuxs1u1bVbOmPtn6TNmjS9+bcr39/dubu3TbyZSdnv5Z57c875fc7v74mFiOjbV55V4tkMNThtVGW3ktVdTnKqnCR7Gj9r42w0TYlUlhZiGXJYbbR39DvLkf3PKJiz86PPea6Qybde5eGNdSJ/cwWPA6Ek3euwUZ3byu9L0SxZMPj0eXUT/FhdpW4BECjDE4IxZC1B9Hc8w+PXvz6mAcz1v0dv93TwfoHFBUUAABQKcaj5oMzjro/HeP34m30qQH9/v+J2u6m9vYNmZ4NU3+CiSqmW1uVlnqgfX750jTweD83MzNDIyIgpACyAg6UkKy2Fk2yNTQB9fX1KXV0dKwMIBEr0EolE+DUajarmW1qisbExU4CNFsDaTS449NRuxeuQ6J5KYt/CDd5Dhw0A4YMH2PyIFZwqHJfp4I8nTQE+OP8n2ctthr3ESyqduR0DeuXOeol+2jNo8GnykzcotigbIAqJgQ8vXiUoAoRUUc665WRa+6YFoR4Ak359+V0DQOL91zgQ9VYoFCDn8W99zAnwfy2gV9Q08g6/wgI4OU6tF/GtaID/Oh1+a2/zKXcMcCcuKARgS11QCIBpEG5Mw8YWNQv08sSJIa5kG9PQDOCRh1sV0zQsphIWCiBSUMwXqchBWEwlNAPo7fYrbpeDoqtxwpOr6a0xnoYsQDdEnqMS5mtGohPCFfuPHOP1ZiLcsLEQ/X552mLohvpilAtAFCEoRDlGITJTjt+7dj2q2O1WgwVSqSyNn72oAtxNKUkMFBND2n2gZy2U80bU4HXQ7FySb0f6G9Hp6ma+D8B6yCJ/OESSVSFPpdpw8klkPU1y1kIBr7pe2+ClsnnttoNWm0vQssWt6YubjQaAzpW/WLm4UeUDQBwBYqLmvtsAAwMDynPyFb6zQfljjWq6QPQbjl+NEyBwq/lG2kHDw8N8AKzvnp/S5iJTcgmyDAKIM40+Xq9t8IIUpB8mwqz8SjRBj/truf9D0B1/DizTi09up9Hvg/R0p5e+kltyAkA5MuRaJE5nM6u8fpfNRQ94HHzhEaluABgaGlI6Vy7Q6fP/UNeDDlYo/I1xq38bxUIxmpteoeNTN6infRtN1LTR4OAgHwDrfZNn2AIACITidGJl0WCEPTX15G92aABTO7t5vbZB79o5tgAARA2AcgTh9KWw9u3cfIJ622rpVHVHXoDDwTlajRnjyOWU6EBLU36AfZV/sHnhAlEJm1pr6LdfwvwuYI6evE77dm+no+sPlRYALpiYWiCfq0oLJlGWhXJns5M+G52kTl9DaV2AKEYQnrqwzAAIwh1uFUQo//L4dQ5CWAAuKGkQ6tMwdjPFCuD7hXCcnzg5BKd3ltlLn4aoZPpCBAhOvzL7pnTekkIEgFyl+P6mCraC+KO6ZaW4mGYCExWz/q63438Bs83DShgXVAUAAAAASUVORK5CYII="}]} \ No newline at end of file