Made conduits and power blocks replace-upgradeable
This commit is contained in:
@@ -262,6 +262,7 @@ public class NetServer extends Module{
|
||||
sync();
|
||||
}else if(!closing){
|
||||
closing = true;
|
||||
weapons.clear();
|
||||
Vars.ui.loadfrag.show("$text.server.closing");
|
||||
Timers.runTask(5f, () -> {
|
||||
Net.closeServer();
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
package io.anuke.mindustry.world.blocks;
|
||||
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
||||
import io.anuke.mindustry.world.blocks.types.distribution.*;
|
||||
|
||||
public class DistributionBlocks{
|
||||
|
||||
public static final Block
|
||||
|
||||
conduit = new LiquidBlock("conduit"){{
|
||||
conduit = new Conduit("conduit"){{
|
||||
health = 45;
|
||||
}},
|
||||
|
||||
pulseconduit = new LiquidBlock("pulseconduit"){{
|
||||
pulseconduit = new Conduit("pulseconduit"){{
|
||||
liquidCapacity = 16f;
|
||||
flowfactor = 4.9f;
|
||||
health = 65;
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package io.anuke.mindustry.world.blocks.types.distribution;
|
||||
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
||||
|
||||
public class Conduit extends LiquidBlock {
|
||||
|
||||
public Conduit(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canReplace(Block other) {
|
||||
return other instanceof Conduit && other != this;
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
||||
import io.anuke.ucore.core.Draw;
|
||||
|
||||
public class LiquidJunction extends LiquidBlock{
|
||||
public class LiquidJunction extends Conduit{
|
||||
|
||||
public LiquidJunction(String name) {
|
||||
super(name);
|
||||
|
||||
@@ -2,10 +2,9 @@ package io.anuke.mindustry.world.blocks.types.distribution;
|
||||
|
||||
import io.anuke.mindustry.resource.Liquid;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.types.LiquidBlock;
|
||||
import io.anuke.ucore.core.Draw;
|
||||
|
||||
public class LiquidRouter extends LiquidBlock{
|
||||
public class LiquidRouter extends Conduit{
|
||||
protected final int timerDump = timers++;
|
||||
|
||||
public LiquidRouter(String name) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package io.anuke.mindustry.world.blocks.types.distribution;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.blocks.types.production.Generator;
|
||||
|
||||
@@ -15,7 +16,12 @@ public class PowerLaser extends Generator{
|
||||
laserDirections = 1;
|
||||
health = 50;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canReplace(Block other) {
|
||||
return other instanceof PowerLaser && other != this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Tile tile){
|
||||
distributeLaserPower(tile);
|
||||
|
||||
Reference in New Issue
Block a user