From 3a40edd7a0f6a7da46f649134557c330af3510da Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 18 Dec 2016 11:58:39 +0100 Subject: [PATCH] Fluid placer/collector comparator output Closes #487 --- .../mod/tile/TileEntityFluidCollector.java | 13 +++++++++++++ .../assets/actuallyadditions/lang/en_US.lang | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java index b5d664de7..76ae1a97a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityFluidCollector.java @@ -45,6 +45,7 @@ public class TileEntityFluidCollector extends TileEntityBase implements ISharing }; private int lastTankAmount; private int currentTime; + private int lastCompare; public TileEntityFluidCollector(String name){ super(name); @@ -121,6 +122,12 @@ public class TileEntityFluidCollector extends TileEntityBase implements ISharing } } + @Override + public int getComparatorStrength(){ + float calc = ((float)this.tank.getFluidAmount()/(float)this.tank.getCapacity())*15F; + return (int)calc; + } + @Override public IFluidHandler getFluidHandler(EnumFacing facing){ return this.tank; @@ -160,6 +167,12 @@ public class TileEntityFluidCollector extends TileEntityBase implements ISharing } } + if(this.lastCompare != this.getComparatorStrength()){ + this.lastCompare = this.getComparatorStrength(); + + this.markDirty(); + } + if(this.lastTankAmount != this.tank.getFluidAmount() && this.sendUpdateWithInterval()){ this.lastTankAmount = this.tank.getFluidAmount(); } diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 40a1bb302..acbe113fc 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -810,8 +810,8 @@ booklet.actuallyadditions.chapter.treasureChest.text.2=Treasure Chests booklet.actuallyadditions.chapter.breaker.name=Breakers and Placers booklet.actuallyadditions.chapter.breaker.text.1=The Breaker breaks blocks in front of it. It can be oriented in every direction. When right-clicking it with a Redstone Torch in hand, it will change between a mode where it gets deactivated by Redstone and a mode where it responds to pulses. booklet.actuallyadditions.chapter.breaker.text.2=The Placer places blocks in front of it. It can be oriented in every direction. When right-clicking it with a Redstone Torch in hand, it will change between a mode where it gets deactivated by Redstone and a mode where it responds to pulses. -booklet.actuallyadditions.chapter.breaker.text.3=The Fluid Placer places liquids you supply it with. It needs 1000mB to place one block. When right-clicking it with a Redstone Torch in hand, it will change between a mode where it gets deactivated by Redstone and a mode where it responds to pulses. -booklet.actuallyadditions.chapter.breaker.text.4=The Fluid Collector will collect 1000mB of liquids in front of it, that's a filled bucket. When right-clicking it with a Redstone Torch in hand, it will change between a mode where it gets deactivated by Redstone and a mode where it responds to pulses. +booklet.actuallyadditions.chapter.breaker.text.3=The Fluid Placer places liquids you supply it with. It needs 1000mB to place one block. When right-clicking it with a Redstone Torch in hand, it will change between a mode where it gets deactivated by Redstone and a mode where it responds to pulses. A Comparator will mesaure its Fluid Amount. +booklet.actuallyadditions.chapter.breaker.text.4=The Fluid Collector will collect 1000mB of liquids in front of it, that's a filled bucket. When right-clicking it with a Redstone Torch in hand, it will change between a mode where it gets deactivated by Redstone and a mode where it responds to pulses. A Comparator will mesaure its Fluid Amount. booklet.actuallyadditions.chapter.phantomfaces.name=Phantomfaces booklet.actuallyadditions.chapter.phantomfaces.text.1=Phantomfaces are a simple way to connect inventories together, they have a very important twist however: Instead of just connecting two inventories, a Phantomface simulates the inventory it is connected to, meaning you can put items into and pull out of the Phantomface itself. A Phantomface has a default range of blocks, but it can be upgraded with a Phantom Booster. Phantomfaces are connected by right-clicking an inventory with a Phantom Connector and then right-clicking the Phantomface.