Fluid placer/collector comparator output

Closes #487
This commit is contained in:
Ellpeck 2016-12-18 11:58:39 +01:00
parent 0953c0e906
commit 3a40edd7a0
2 changed files with 15 additions and 2 deletions

View file

@ -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();
}

View file

@ -810,8 +810,8 @@ booklet.actuallyadditions.chapter.treasureChest.text.2=<item>Treasure Chests<r>
booklet.actuallyadditions.chapter.breaker.name=Breakers and Placers
booklet.actuallyadditions.chapter.breaker.text.1=The <item>Breaker<r> breaks blocks in front of it. It can be oriented in every direction. <n>When right-clicking it with a <item>Redstone Torch<r> in hand, it will change between a mode where it <imp>gets deactivated by Redstone<r> and a mode where it <imp>responds to pulses<r>.
booklet.actuallyadditions.chapter.breaker.text.2=The <item>Placer<r> places blocks in front of it. It can be oriented in every direction. <n>When right-clicking it with a <item>Redstone Torch<r> in hand, it will change between a mode where it <imp>gets deactivated by Redstone<r> and a mode where it <imp>responds to pulses<r>.
booklet.actuallyadditions.chapter.breaker.text.3=The <item>Fluid Placer<r> places liquids you supply it with. It needs <imp>1000mB<r> to place one block. When right-clicking it with a <item>Redstone Torch<r> in hand, it will change between a mode where it <imp>gets deactivated by Redstone<r> and a mode where it <imp>responds to pulses<r>.
booklet.actuallyadditions.chapter.breaker.text.4=The <item>Fluid Collector<r> will collect <imp>1000mB<r> of liquids in front of it, that's a filled bucket. When right-clicking it with a <item>Redstone Torch<r> in hand, it will change between a mode where it <imp>gets deactivated by Redstone<r> and a mode where it <imp>responds to pulses<r>.
booklet.actuallyadditions.chapter.breaker.text.3=The <item>Fluid Placer<r> places liquids you supply it with. It needs <imp>1000mB<r> to place one block. When right-clicking it with a <item>Redstone Torch<r> in hand, it will change between a mode where it <imp>gets deactivated by Redstone<r> and a mode where it <imp>responds to pulses<r>. A Comparator will mesaure its <imp>Fluid Amount<r>.
booklet.actuallyadditions.chapter.breaker.text.4=The <item>Fluid Collector<r> will collect <imp>1000mB<r> of liquids in front of it, that's a filled bucket. When right-clicking it with a <item>Redstone Torch<r> in hand, it will change between a mode where it <imp>gets deactivated by Redstone<r> and a mode where it <imp>responds to pulses<r>. A Comparator will mesaure its <imp>Fluid Amount<r>.
booklet.actuallyadditions.chapter.phantomfaces.name=Phantomfaces
booklet.actuallyadditions.chapter.phantomfaces.text.1=<item>Phantomfaces<r> are a simple way to <imp>connect inventories together<r>, they have a very important twist however: Instead of just connecting two inventories, a <item>Phantomface<r> <imp>simulates the inventory it is connected to<r>, meaning you can put items into and pull out of the Phantomface itself. A <item>Phantomface<r> has a <imp>default range of <range> blocks<r>, but it can be upgraded with a <item>Phantom Booster<r>. <item>Phantomfaces<r> are connected by <imp>right-clicking<r> an inventory with a <item>Phantom Connector<r> and then <imp>right-clicking<r> the <item>Phantomface.