From 493cad13d0c1ecad253b89b6ebeacfc17704d224 Mon Sep 17 00:00:00 2001 From: Daniel Amberson Date: Thu, 17 Dec 2020 15:32:52 -0600 Subject: [PATCH 1/2] i am Indecisive yea * brass block got a texture that isn't garbage * added a prototype brass block that might get used later --- .../textures/block/brass_storage_block.png | Bin 394 -> 406 bytes .../create/textures/block/brass_tiles.png | Bin 0 -> 444 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/resources/assets/create/textures/block/brass_tiles.png diff --git a/src/main/resources/assets/create/textures/block/brass_storage_block.png b/src/main/resources/assets/create/textures/block/brass_storage_block.png index 7cc2fff4c53f17d2b895f00146199b6535a633da..502c69f66934458fa104bda2af9f62acd344862d 100644 GIT binary patch delta 342 zcmV-c0jd6q1C|4jNq@os01mR_4)L_B==4$KkbqbLr>AbA)7 z8-NV>I61)h)At`>3<4ZntYG%5x1Yg$WPoA-NFxZqG=lgb&3`bBFnMHv;R2XuF=1Y? z<{#gFgZVJSVEm6SK7eVgUI1wZ0gz&lfiRo-B?Q1UGC(l^WCI9;6ryVuR}y7-dG9rt z4FkVEd}3fi4p9&QX$C2Tc?Cp+3`G`024EM+3kiWa=$b(Q%bJGC=VHKF#R1 z!@>h=Ai^+AGf&7?kYTXEMFvc-K7E6yM361mFen`$V`RYCkz)4W+glaNMZ_-*V2e5! oSikfv17neoHrd&kfq{Vm0FHTa-y2!J%d zy!RT+{`CC^9K!&N&%wnC6@dV_0Uuv{0Mp2t_&7PhG)zoPn12^+5i)=qfDAwyVVYq8 zrWs}t3}6@lQV4SRfnOg!K@5-=5&{dr z0urVW+TJz%(*|$sq$!EHD=NXp^0t c85kHC08H?v)Hmpa8UO$Q07*qoM6N<$f}kRQ{{R30 diff --git a/src/main/resources/assets/create/textures/block/brass_tiles.png b/src/main/resources/assets/create/textures/block/brass_tiles.png new file mode 100644 index 0000000000000000000000000000000000000000..86e4bb3a66a0921ba10ffa7aed1baed893ed7cde GIT binary patch literal 444 zcmV;t0YmPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!T Date: Thu, 17 Dec 2020 23:29:33 +0100 Subject: [PATCH 2/2] Bug Fixes - Snownee's basin render fix - Fixed milk fluid exchange between vanilla items and the create fluid infrastructure --- .../fluids/actors/GenericItemFilling.java | 20 ++++++++++++++++++- .../fluids/particle/BasinFluidParticle.java | 2 +- .../processing/BasinRenderer.java | 2 +- .../processing/BasinTileEntity.java | 9 ++++----- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/GenericItemFilling.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/GenericItemFilling.java index 4f6ebb553..427c5e2c5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/GenericItemFilling.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/GenericItemFilling.java @@ -23,6 +23,8 @@ public class GenericItemFilling { public static boolean canItemBeFilled(World world, ItemStack stack) { if (stack.getItem() == Items.GLASS_BOTTLE) return true; + if (stack.getItem() == Items.MILK_BUCKET) + return false; LazyOptional capability = stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY); @@ -40,6 +42,8 @@ public class GenericItemFilling { public static int getRequiredAmountForItem(World world, ItemStack stack, FluidStack availableFluid) { if (stack.getItem() == Items.GLASS_BOTTLE && canFillGlassBottleInternally(availableFluid)) return PotionFluidHandler.getRequiredAmountForFilledBottle(stack, availableFluid); + if (stack.getItem() == Items.BUCKET && canFillBucketInternally(availableFluid)) + return 1000; LazyOptional capability = stack.getCapability(CapabilityFluidHandler.FLUID_HANDLER_ITEM_CAPABILITY); @@ -51,6 +55,9 @@ public class GenericItemFilling { .getFilledBucket(); if (filledBucket == null || filledBucket == Items.AIR) return -1; + if (!((FluidBucketWrapper) tank).getFluid() + .isEmpty()) + return -1; return 1000; } @@ -65,6 +72,11 @@ public class GenericItemFilling { .isEquivalentTo(AllFluids.POTION.get()); } + private static boolean canFillBucketInternally(FluidStack availableFluid) { + return availableFluid.getFluid() + .isEquivalentTo(AllFluids.MILK.get().getFlowingFluid()); + } + public static ItemStack fillItem(World world, int requiredAmount, ItemStack stack, FluidStack availableFluid) { FluidStack toFill = availableFluid.copy(); toFill.setAmount(requiredAmount); @@ -79,7 +91,13 @@ public class GenericItemFilling { stack.shrink(1); return fillBottle; } - + + if (stack.getItem() == Items.BUCKET && canFillBucketInternally(toFill)) { + ItemStack filledBucket = new ItemStack(Items.MILK_BUCKET); + stack.shrink(1); + return filledBucket; + } + ItemStack split = stack.copy(); split.setCount(1); LazyOptional capability = diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/particle/BasinFluidParticle.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/particle/BasinFluidParticle.java index 44c1bafab..86f8e4fef 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/particle/BasinFluidParticle.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/particle/BasinFluidParticle.java @@ -63,7 +63,7 @@ public class BasinFluidParticle extends FluidStackParticle { TileEntity tileEntity = world.getTileEntity(basinPos); if (tileEntity instanceof BasinTileEntity) { - float totalUnits = ((BasinTileEntity) tileEntity).getTotalFluidUnits(); + float totalUnits = ((BasinTileEntity) tileEntity).getTotalFluidUnits(0); if (totalUnits < 1) totalUnits = 0; float fluidLevel = MathHelper.clamp(totalUnits / 2000, 0, 1); diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java index adbcc814f..e05fb6ee0 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinRenderer.java @@ -141,7 +141,7 @@ public class BasinRenderer extends SmartTileEntityRenderer { SmartFluidTankBehaviour inputFluids = basin.getBehaviour(SmartFluidTankBehaviour.INPUT); SmartFluidTankBehaviour outputFluids = basin.getBehaviour(SmartFluidTankBehaviour.OUTPUT); SmartFluidTankBehaviour[] tanks = { inputFluids, outputFluids }; - float totalUnits = basin.getTotalFluidUnits(); + float totalUnits = basin.getTotalFluidUnits(partialTicks); if (totalUnits < 1) return 0; 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 f6429ab37..0f37c2939 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 @@ -39,7 +39,6 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.ListNBT; import net.minecraft.nbt.StringNBT; import net.minecraft.particles.IParticleData; -import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; @@ -62,7 +61,7 @@ import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemHandlerHelper; import net.minecraftforge.items.wrapper.CombinedInvWrapper; -public class BasinTileEntity extends SmartTileEntity implements ITickableTileEntity { +public class BasinTileEntity extends SmartTileEntity { private boolean areFluidsMoving; LerpedFloat ingredientRotationSpeed; @@ -285,7 +284,7 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt } } - public float getTotalFluidUnits() { + public float getTotalFluidUnits(float partialTicks) { int renderedFluids = 0; float totalUnits = 0; @@ -296,7 +295,7 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt if (tankSegment.getRenderedFluid() .isEmpty()) continue; - float units = tankSegment.getTotalUnits(0); + float units = tankSegment.getTotalUnits(partialTicks); if (units < 1) continue; totalUnits += units; @@ -454,7 +453,7 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt if (segments < 2) return; - float totalUnits = getTotalFluidUnits(); + float totalUnits = getTotalFluidUnits(0); if (totalUnits == 0) return; float fluidLevel = MathHelper.clamp(totalUnits / 2000, 0, 1);