Name fixes
This commit is contained in:
@@ -10,7 +10,7 @@ import mindustry.entities.*;
|
||||
import mindustry.game.EventType.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.world.blocks.*;
|
||||
import mindustry.world.blocks.BuildBlock.*;
|
||||
import mindustry.world.blocks.ConstructBlock.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@@ -32,10 +32,10 @@ public class Build{
|
||||
|
||||
int rotation = tile.build != null ? tile.build.rotation : 0;
|
||||
Block previous = tile.block();
|
||||
Block sub = BuildBlock.get(previous.size);
|
||||
Block sub = ConstructBlock.get(previous.size);
|
||||
|
||||
tile.setBlock(sub, team, rotation);
|
||||
tile.<BuildEntity>bc().setDeconstruct(previous);
|
||||
tile.<ConstructBuild>bc().setDeconstruct(previous);
|
||||
tile.build.health(tile.build.maxHealth() * prevPercent);
|
||||
|
||||
Core.app.post(() -> Events.fire(new BlockBuildBeginEvent(tile, team, true)));
|
||||
@@ -54,12 +54,12 @@ public class Build{
|
||||
if(tile == null) return;
|
||||
|
||||
Block previous = tile.block();
|
||||
Block sub = BuildBlock.get(result.size);
|
||||
Block sub = ConstructBlock.get(result.size);
|
||||
|
||||
result.beforePlaceBegan(tile, previous);
|
||||
|
||||
tile.setBlock(sub, team, rotation);
|
||||
tile.<BuildEntity>bc().setConstruct(previous, result);
|
||||
tile.<ConstructBuild>bc().setConstruct(previous, result);
|
||||
|
||||
result.placeBegan(tile, previous);
|
||||
|
||||
@@ -91,7 +91,7 @@ public class Build{
|
||||
}
|
||||
|
||||
if(type.isMultiblock()){
|
||||
if((type.canReplace(tile.block()) || (tile.block instanceof BuildBlock && tile.<BuildEntity>bc().cblock == type)) &&
|
||||
if((type.canReplace(tile.block()) || (tile.block instanceof ConstructBlock && tile.<ConstructBuild>bc().cblock == type)) &&
|
||||
type.canPlaceOn(tile, team) && tile.interactable(team)){
|
||||
|
||||
//if the block can be replaced but the sizes differ, check all the spaces around the block to make sure it can fit
|
||||
@@ -145,7 +145,7 @@ public class Build{
|
||||
&& (!tile.floor().isDeep() || type.floating || type.requiresWater || type.placeableLiquid)
|
||||
&& tile.floor().placeableOn
|
||||
&& (!type.requiresWater || tile.floor().liquidDrop == Liquids.water)
|
||||
&& (((type.canReplace(tile.block()) || (tile.block instanceof BuildBlock && tile.<BuildEntity>bc().cblock == type))
|
||||
&& (((type.canReplace(tile.block()) || (tile.block instanceof ConstructBlock && tile.<ConstructBuild>bc().cblock == type))
|
||||
&& !(type == tile.block() && (tile.build != null && rotation == tile.build.rotation) && type.rotate)) || tile.block().alwaysReplace || tile.block() == Blocks.air)
|
||||
&& tile.block().isMultiblock() == type.isMultiblock() && type.canPlaceOn(tile, team);
|
||||
}
|
||||
|
||||
@@ -23,28 +23,29 @@ import mindustry.world.modules.*;
|
||||
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class BuildBlock extends Block{
|
||||
/** A block in the process of construction. */
|
||||
public class ConstructBlock extends Block{
|
||||
public static final int maxSize = 16;
|
||||
private static final BuildBlock[] buildBlocks = new BuildBlock[maxSize];
|
||||
private static final ConstructBlock[] consBlocks = new ConstructBlock[maxSize];
|
||||
|
||||
private static long lastTime = 0;
|
||||
private static int pitchSeq = 0;
|
||||
private static long lastPlayed;
|
||||
|
||||
public BuildBlock(int size){
|
||||
public ConstructBlock(int size){
|
||||
super("build" + size);
|
||||
this.size = size;
|
||||
update = true;
|
||||
health = 20;
|
||||
consumesTap = true;
|
||||
solidifes = true;
|
||||
buildBlocks[size - 1] = this;
|
||||
consBlocks[size - 1] = this;
|
||||
}
|
||||
|
||||
/** Returns a BuildBlock by size. */
|
||||
public static BuildBlock get(int size){
|
||||
if(size > maxSize) throw new IllegalArgumentException("No. Don't place BuildBlocks of size greater than " + maxSize);
|
||||
return buildBlocks[size - 1];
|
||||
public static ConstructBlock get(int size){
|
||||
if(size > maxSize) throw new IllegalArgumentException("No. Don't place ConstructBlock of size greater than " + maxSize);
|
||||
return consBlocks[size - 1];
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
@@ -117,7 +118,7 @@ public class BuildBlock extends Block{
|
||||
return true;
|
||||
}
|
||||
|
||||
public class BuildEntity extends Building{
|
||||
public class ConstructBuild extends Building{
|
||||
/**
|
||||
* The recipe of the block that is being constructed.
|
||||
* If there is no recipe for this block, as is the case with rocks, 'previous' is used.
|
||||
@@ -60,7 +60,7 @@ public class PointDefenseTurret extends Block{
|
||||
stats.add(BlockStat.reload, 60f / reloadTime, StatUnit.none);
|
||||
}
|
||||
|
||||
public class PointDefenseEntity extends Building{
|
||||
public class PointDefenseBuild extends Building{
|
||||
public float rotation = 90, reload;
|
||||
public @Nullable Bullet target;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ShockMine extends Block{
|
||||
rebuildable = false;
|
||||
}
|
||||
|
||||
public class ShockMineEntity extends Building{
|
||||
public class ShockMineBuild extends Building{
|
||||
|
||||
@Override
|
||||
public void drawTeam(){
|
||||
|
||||
@@ -61,7 +61,7 @@ public class TractorBeamTurret extends Block{
|
||||
stats.add(BlockStat.damage, damage * 60f, StatUnit.perSecond);
|
||||
}
|
||||
|
||||
public class TractorBeamEntity extends Building{
|
||||
public class TractorBeamBuild extends Building{
|
||||
public float rotation = 90;
|
||||
public @Nullable Unit target;
|
||||
public float lastX, lastY, strength;
|
||||
|
||||
@@ -11,7 +11,7 @@ public class LiquidRouter extends LiquidBlock{
|
||||
noUpdateDisabled = true;
|
||||
}
|
||||
|
||||
public class LiquidRouterEntity extends LiquidBuild{
|
||||
public class LiquidRouterBuild extends LiquidBuild{
|
||||
@Override
|
||||
public void updateTile(){
|
||||
if(liquids.total() > 0.01f){
|
||||
|
||||
@@ -16,7 +16,7 @@ import mindustry.logic.LAssembler.*;
|
||||
import mindustry.logic.LExecutor.*;
|
||||
import mindustry.ui.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.BuildBlock.*;
|
||||
import mindustry.world.blocks.ConstructBlock.*;
|
||||
import mindustry.world.meta.*;
|
||||
|
||||
import java.io.*;
|
||||
@@ -413,7 +413,7 @@ public class LogicBlock extends Block{
|
||||
}
|
||||
|
||||
public boolean validLink(Building other){
|
||||
return other != null && other.isValid() && other.team == team && other.within(this, range + other.block.size*tilesize/2f) && !(other instanceof BuildEntity);
|
||||
return other != null && other.isValid() && other.team == team && other.within(this, range + other.block.size*tilesize/2f) && !(other instanceof ConstructBuild);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -39,11 +39,6 @@ public class BlockPayload implements Payload{
|
||||
return entity.block.size * tilesize;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fits(){
|
||||
return entity.block().size < 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(Writes write){
|
||||
write.b(payloadBlock);
|
||||
|
||||
@@ -6,7 +6,7 @@ import mindustry.game.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
import static mindustry.Vars.content;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public interface Payload{
|
||||
int payloadUnit = 0, payloadBlock = 1;
|
||||
@@ -27,7 +27,7 @@ public interface Payload{
|
||||
|
||||
/** @return whether this payload fits on a standard 3x3 conveyor. */
|
||||
default boolean fits(){
|
||||
return true;
|
||||
return size() / tilesize <= 2.4f;
|
||||
}
|
||||
|
||||
/** writes the payload for saving. */
|
||||
|
||||
@@ -15,11 +15,6 @@ public class UnitPayload implements Payload{
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fits(){
|
||||
return unit.hitSize <= 16f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(Writes write){
|
||||
write.b(payloadUnit);
|
||||
|
||||
Reference in New Issue
Block a user