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