Name fixes

This commit is contained in:
Anuken
2020-09-06 19:09:41 -04:00
parent 1d191f1914
commit 010a1594fa
22 changed files with 51 additions and 60 deletions
@@ -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);