🗜 Pressure conduit (#949)
* Suggest pressure conduit
* Revert "Suggest pressure conduit"
This reverts commit 721dd9255e.
* Increase pulse conduit output pressure
* Remove `tile.block().`
This commit is contained in:
committed by
Anuken
parent
f81f7e1d2a
commit
836e72119c
@@ -1010,6 +1010,7 @@ public class Blocks implements ContentList{
|
|||||||
pulseConduit = new Conduit("pulse-conduit"){{
|
pulseConduit = new Conduit("pulse-conduit"){{
|
||||||
requirements(Category.liquid, ItemStack.with(Items.titanium, 2, Items.metaglass, 1));
|
requirements(Category.liquid, ItemStack.with(Items.titanium, 2, Items.metaglass, 1));
|
||||||
liquidCapacity = 16f;
|
liquidCapacity = 16f;
|
||||||
|
liquidPressure = 1.025f;
|
||||||
health = 90;
|
health = 90;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
|
|
||||||
public int itemCapacity = 10;
|
public int itemCapacity = 10;
|
||||||
public float liquidCapacity = 10f;
|
public float liquidCapacity = 10f;
|
||||||
|
public float liquidPressure = 1f;
|
||||||
|
|
||||||
public final BlockStats stats = new BlockStats();
|
public final BlockStats stats = new BlockStats();
|
||||||
public final BlockBars bars = new BlockBars();
|
public final BlockBars bars = new BlockBars();
|
||||||
@@ -150,7 +151,7 @@ public abstract class BlockStorage extends UnlockableContent{
|
|||||||
|
|
||||||
if(next.block().acceptLiquid(next, tile, liquid, 0f)){
|
if(next.block().acceptLiquid(next, tile, liquid, 0f)){
|
||||||
float ofract = next.entity.liquids.get(liquid) / next.block().liquidCapacity;
|
float ofract = next.entity.liquids.get(liquid) / next.block().liquidCapacity;
|
||||||
float fract = tile.entity.liquids.get(liquid) / liquidCapacity;
|
float fract = tile.entity.liquids.get(liquid) / liquidCapacity * liquidPressure;
|
||||||
float flow = Math.min(Mathf.clamp((fract - ofract) * (1f)) * (liquidCapacity), tile.entity.liquids.get(liquid));
|
float flow = Math.min(Mathf.clamp((fract - ofract) * (1f)) * (liquidCapacity), tile.entity.liquids.get(liquid));
|
||||||
flow = Math.min(flow, next.block().liquidCapacity - next.entity.liquids.get(liquid) - 0.001f);
|
flow = Math.min(flow, next.block().liquidCapacity - next.entity.liquids.get(liquid) - 0.001f);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user