From 1b5a2e0ccd8c4ebc337ba4f24224d6da312ca9e5 Mon Sep 17 00:00:00 2001 From: makeo Date: Sun, 15 Nov 2015 16:32:06 +0100 Subject: [PATCH] fixed block protector bug --- .../common/blocks/tiles/TileBlockProtector.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileBlockProtector.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileBlockProtector.java index 4b5d812..2037c50 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileBlockProtector.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileBlockProtector.java @@ -53,14 +53,14 @@ public class TileBlockProtector extends TileJarFillable { public void readCustomNBT(NBTTagCompound compound) { super.readCustomNBT(compound); aspectFilter = ASPECT; - range = compound.getInteger("range"); + range = compound.getInteger("ProtectRange"); } @Override public void writeCustomNBT(NBTTagCompound compound) { super.writeCustomNBT(compound); compound.removeTag("AspectFilter"); - compound.setInteger("range", range); + compound.setInteger("ProtectRange", range); } @Override @@ -75,6 +75,10 @@ public class TileBlockProtector extends TileJarFillable { } if (count % UPDATE_TICKS == 0) { + if(range == 0) { + saturation = 0; + } + if (saturation > 0) { saturation--; return; @@ -98,7 +102,7 @@ public class TileBlockProtector extends TileJarFillable { } } - if (executeDecrease) { + if (executeDecrease && range > 0) { range--; markDirty(); worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);