Fixed liquid blocks not accepting liquids
This commit is contained in:
@@ -48,6 +48,7 @@ public class Minimap extends Container<Element>{
|
|||||||
margin(margin);
|
margin(margin);
|
||||||
|
|
||||||
addListener(new InputListener(){
|
addListener(new InputListener(){
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean scrolled(InputEvent event, float x, float y, float amountx, float amounty){
|
public boolean scrolled(InputEvent event, float x, float y, float amountx, float amounty){
|
||||||
renderer.minimap.zoomBy(amounty);
|
renderer.minimap.zoomBy(amounty);
|
||||||
@@ -68,15 +69,30 @@ public class Minimap extends Container<Element>{
|
|||||||
});
|
});
|
||||||
|
|
||||||
addListener(new ClickListener(){
|
addListener(new ClickListener(){
|
||||||
|
{
|
||||||
|
tapSquareSize = Unit.dp.scl(11f);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){
|
public void touchUp(InputEvent event, float x, float y, int pointer, KeyCode button){
|
||||||
float tapSquareSize = Unit.dp.scl(14f);
|
if(inTapSquare()){
|
||||||
if(Math.abs(x - touchDownX) < tapSquareSize && Math.abs(y - touchDownY) < tapSquareSize){
|
|
||||||
super.touchUp(event, x, y, pointer, button);
|
super.touchUp(event, x, y, pointer, button);
|
||||||
|
}else{
|
||||||
|
pressed = false;
|
||||||
|
pressedPointer = -1;
|
||||||
|
pressedButton = null;
|
||||||
|
cancelled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void touchDragged(InputEvent event, float x, float y, int pointer){
|
||||||
|
if(!inTapSquare(x, y)){
|
||||||
|
invalidateTapSquare();
|
||||||
|
}
|
||||||
|
super.touchDragged(event, x, y, pointer);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clicked(InputEvent event, float x, float y){
|
public void clicked(InputEvent event, float x, float y){
|
||||||
ui.minimap.show();
|
ui.minimap.show();
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class Conduit extends LiquidBlock{
|
|||||||
@Override
|
@Override
|
||||||
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||||
tile.entity.noSleep();
|
tile.entity.noSleep();
|
||||||
return super.acceptLiquid(tile, source, liquid, amount) && ((2 + source.relativeTo(tile.x, tile.y)) % 4 != tile.getRotation());
|
return tile.entity.liquids.get(liquid) + amount < liquidCapacity && (tile.entity.liquids.current() == liquid || tile.entity.liquids.get(tile.entity.liquids.current()) < 0.2f) && ((2 + source.relativeTo(tile.x, tile.y)) % 4 != tile.getRotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ public class LiquidBridge extends ItemBridge{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||||
|
return tile.entity.liquids.get(liquid) + amount < liquidCapacity && (tile.entity.liquids.current() == liquid || tile.entity.liquids.get(tile.entity.liquids.current()) < 0.2f);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDumpLiquid(Tile tile, Tile to, Liquid liquid){
|
public boolean canDumpLiquid(Tile tile, Tile to, Liquid liquid){
|
||||||
ItemBridgeEntity entity = tile.entity();
|
ItemBridgeEntity entity = tile.entity();
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package io.anuke.mindustry.world.blocks.distribution;
|
package io.anuke.mindustry.world.blocks.distribution;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.LiquidBlock;
|
import io.anuke.mindustry.world.blocks.LiquidBlock;
|
||||||
|
|
||||||
@@ -17,4 +18,8 @@ public class LiquidRouter extends LiquidBlock{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||||
|
return tile.entity.liquids.get(liquid) + amount < liquidCapacity && (tile.entity.liquids.current() == liquid || tile.entity.liquids.get(tile.entity.liquids.current()) < 0.2f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class Fracker extends SolidPump{
|
|||||||
public void update(Tile tile){
|
public void update(Tile tile){
|
||||||
FrackerEntity entity = tile.entity();
|
FrackerEntity entity = tile.entity();
|
||||||
|
|
||||||
if(entity.cons.valid() && entity.accumulator < itemUseTime){
|
if(entity.cons.valid()){
|
||||||
if(entity.accumulator >= itemUseTime){
|
if(entity.accumulator >= itemUseTime){
|
||||||
entity.cons.trigger();
|
entity.cons.trigger();
|
||||||
entity.accumulator -= itemUseTime;
|
entity.accumulator -= itemUseTime;
|
||||||
|
|||||||
Reference in New Issue
Block a user