More minor bugfixes and tweaks to junctions/tunnels
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 257 B After Width: | Height: | Size: 256 B |
Binary file not shown.
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 81 KiB |
@@ -1,7 +1,7 @@
|
|||||||
#Autogenerated file. Do not modify.
|
#Autogenerated file. Do not modify.
|
||||||
#Fri Feb 09 00:15:08 EST 2018
|
#Fri Feb 09 10:08:05 EST 2018
|
||||||
version=beta
|
version=beta
|
||||||
androidBuildCode=131
|
androidBuildCode=135
|
||||||
name=Mindustry
|
name=Mindustry
|
||||||
code=3.3
|
code=3.3
|
||||||
build=custom build
|
build=20
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.world.blocks.types.distribution;
|
|||||||
import io.anuke.mindustry.resource.Liquid;
|
import io.anuke.mindustry.resource.Liquid;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
||||||
|
import io.anuke.ucore.core.Timers;
|
||||||
import io.anuke.ucore.graphics.Draw;
|
import io.anuke.ucore.graphics.Draw;
|
||||||
|
|
||||||
public class LiquidJunction extends Conduit{
|
public class LiquidJunction extends Conduit{
|
||||||
@@ -25,8 +26,10 @@ public class LiquidJunction extends Conduit{
|
|||||||
dir = (dir+4)%4;
|
dir = (dir+4)%4;
|
||||||
Tile to = tile.getNearby(dir);
|
Tile to = tile.getNearby(dir);
|
||||||
|
|
||||||
((LiquidBlock)to.block()).handleLiquid(to, tile, liquid, amount);
|
Timers.run(20f, () -> {
|
||||||
|
if(to.block() instanceof LiquidBlock && ((LiquidBlock)to.block()).acceptLiquid(to, tile, liquid, amount))
|
||||||
|
((LiquidBlock)to.block()).handleLiquid(to, tile, liquid, amount);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -34,7 +37,7 @@ public class LiquidJunction extends Conduit{
|
|||||||
int dir = source.relativeTo(dest.x, dest.y);
|
int dir = source.relativeTo(dest.x, dest.y);
|
||||||
dir = (dir+4)%4;
|
dir = (dir+4)%4;
|
||||||
Tile to = dest.getNearby(dir);
|
Tile to = dest.getNearby(dir);
|
||||||
return to != null && to.block() != this && to.block() instanceof LiquidBlock &&
|
return to != null && to.block() instanceof LiquidBlock &&
|
||||||
((LiquidBlock)to.block()).acceptLiquid(to, dest, liquid, amount);
|
((LiquidBlock)to.block()).acceptLiquid(to, dest, liquid, amount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import io.anuke.ucore.util.Bits;
|
|||||||
|
|
||||||
public class TunnelConveyor extends Block{
|
public class TunnelConveyor extends Block{
|
||||||
protected int maxdist = 3;
|
protected int maxdist = 3;
|
||||||
protected float speed = 50; //frames taken to go through this tunnel
|
protected float speed = 53; //frames taken to go through this tunnel
|
||||||
protected int capacity = 32;
|
protected int capacity = 32;
|
||||||
|
|
||||||
protected TunnelConveyor(String name) {
|
protected TunnelConveyor(String name) {
|
||||||
@@ -78,7 +78,7 @@ public class TunnelConveyor extends Block{
|
|||||||
|
|
||||||
if(tunnel != null){
|
if(tunnel != null){
|
||||||
Tile to = tunnel.getNearby(tunnel.getRotation());
|
Tile to = tunnel.getNearby(tunnel.getRotation());
|
||||||
return to != null && !(to.block() instanceof TunnelConveyor) && to.block().acceptItem(item, to, tunnel);
|
return to != null && to.block().acceptItem(item, to, tunnel);
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user