From c89d6941aed688521a54c2a5b2e94af01dc7eb29 Mon Sep 17 00:00:00 2001 From: Justin Vitale <4002351+justinvvitale@users.noreply.github.com> Date: Thu, 9 Jul 2020 20:23:06 +1000 Subject: [PATCH] Get state from blockstate instead of saving it as NBT resin basin --- .../machine/tier1/ResinBasinBlockEntity.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java index 68dc98e8d..500f6e0d3 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/ResinBasinBlockEntity.java @@ -74,7 +74,7 @@ public class ResinBasinBlockEntity extends MachineBaseBlockEntity { world.playSound(null, pos, ModSounds.SAP_EXTRACT, SoundCategory.BLOCKS, 1F, 1F); } - if (pouringTimer == 0) { + if (pouringTimer <= 0) { isPouring = false; isFull = true; shouldUpdateState = true; @@ -143,7 +143,6 @@ public class ResinBasinBlockEntity extends MachineBaseBlockEntity { @Override public CompoundTag toTag(CompoundTag tagCompound) { super.toTag(tagCompound); - tagCompound.putBoolean("isFull", isFull); return tagCompound; } @@ -152,8 +151,11 @@ public class ResinBasinBlockEntity extends MachineBaseBlockEntity { public void fromTag(BlockState blockState, CompoundTag tagCompound) { super.fromTag(blockState, tagCompound); - if (tagCompound.contains("isFull")) { - this.isFull = tagCompound.getBoolean("isFull"); + this.isFull = blockState.get(ResinBasinBlock.FULL); + + if(blockState.get(ResinBasinBlock.POURING)){ + this.isPouring = true; + pouringTimer = TechRebornConfig.sapTimeTicks; } }