the errors are back
This commit is contained in:
@@ -424,7 +424,7 @@ public class UnitTypes implements ContentList{
|
||||
public void update(Playerc player){
|
||||
if(player.timer.get(Playerc.timerAbility, healReload)){
|
||||
if(indexer.eachBlock(player, healRange, other -> other.entity.damaged(), other -> {
|
||||
other.entity.healBy(other.entity.maxHealth() * healPercent / 100f);
|
||||
other.entity.heal(other.entity.maxHealth() * healPercent / 100f);
|
||||
Fx.healBlockFull.at(other.drawx(), other.drawy(), other.block().size, Pal.heal);
|
||||
})){
|
||||
Fx.healWave.at(player);
|
||||
@@ -468,7 +468,7 @@ public class UnitTypes implements ContentList{
|
||||
|
||||
@Override
|
||||
public void update(Playerc player){
|
||||
player.healBy(Time.delta() * 0.09f);
|
||||
player.heal(Time.delta() * 0.09f);
|
||||
}
|
||||
|
||||
};
|
||||
@@ -546,7 +546,7 @@ public class UnitTypes implements ContentList{
|
||||
Fx.heal.at(unit);
|
||||
wasHealed = true;
|
||||
}
|
||||
unit.healBy(healAmount);
|
||||
unit.heal(healAmount);
|
||||
});
|
||||
|
||||
if(wasHealed){
|
||||
|
||||
@@ -8,7 +8,7 @@ class EntityDefs{
|
||||
@EntityDef({BulletComp.class, VelComp.class, TimedComp.class})
|
||||
class BulletDef{}
|
||||
|
||||
@EntityDef({TileComp.class})
|
||||
@EntityDef(value = {TileComp.class}, isFinal = false)
|
||||
class TileDef{}
|
||||
|
||||
@EntityDef({EffectComp.class})
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package mindustry.io.versions;
|
||||
|
||||
import arc.func.Prov;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.entities.type.base.*;
|
||||
|
||||
/*
|
||||
Latest data: [build 81]
|
||||
|
||||
@@ -75,7 +71,7 @@ public class LegacyTypeTable{
|
||||
11 = Wraith
|
||||
12 = Ghoul
|
||||
13 = Revenant
|
||||
*/
|
||||
|
||||
private static final Prov[] build81Table = {
|
||||
Playerc::new,
|
||||
Fire::new,
|
||||
@@ -139,5 +135,5 @@ public class LegacyTypeTable{
|
||||
}else{
|
||||
return build79Table;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ import arc.util.pooling.*;
|
||||
import mindustry.annotations.Annotations.*;
|
||||
import mindustry.ctype.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
@@ -143,7 +142,7 @@ public class Block extends BlockStorage{
|
||||
|
||||
protected TextureRegion[] cacheRegions = {};
|
||||
protected Array<String> cacheRegionStrings = new Array<>();
|
||||
protected Prov<TileData> entityType = TileData::new;
|
||||
protected Prov<Tilec> entityType = TileEntity::create;
|
||||
|
||||
protected Array<Tile> tempTiles = new Array<>();
|
||||
protected TextureRegion[] generatedIcons;
|
||||
@@ -631,7 +630,8 @@ public class Block extends BlockStorage{
|
||||
Time.run(i / 2f, () -> {
|
||||
Tile other = world.tile(tile.x + Mathf.range(size / 2), tile.y + Mathf.range(size / 2));
|
||||
if(other != null){
|
||||
Puddle.deposit(other, liquid, splash);
|
||||
//TODO puddle
|
||||
//Puddle.deposit(other, liquid, splash);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -640,7 +640,8 @@ public class Block extends BlockStorage{
|
||||
|
||||
Damage.dynamicExplosion(x, y, flammability, explosiveness * 3.5f, power, tilesize * size / 2f, Pal.darkFlame);
|
||||
if(!tile.floor().solid && !tile.floor().isLiquid){
|
||||
RubbleDecal.create(tile.drawx(), tile.drawy(), size);
|
||||
//TODO rubble decal
|
||||
//RubbleDecal.create(tile.drawx(), tile.drawy(), size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -855,7 +856,7 @@ public class Block extends BlockStorage{
|
||||
return destructible || update;
|
||||
}
|
||||
|
||||
public final TileData newData(){
|
||||
public final Tilec newEntity(){
|
||||
return entityType.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +176,8 @@ public abstract class BlockStorage extends UnlockableContent{
|
||||
}
|
||||
}else if(leakResistance != 100f && !next.block().solid && !next.block().hasLiquids){
|
||||
float leakAmount = tile.entity.liquids().get(liquid) / leakResistance;
|
||||
Puddle.deposit(next, tile, liquid, leakAmount);
|
||||
//TODO deposit puddle
|
||||
//Puddle.deposit(next, tile, liquid, leakAmount);
|
||||
tile.entity.liquids().remove(liquid, leakAmount);
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -102,7 +102,7 @@ public class Tile implements Position{
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends Tilec> T ent(){
|
||||
public <T extends TileEntity> T ent(){
|
||||
return (T)entity;
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ public class Tile implements Position{
|
||||
|
||||
if(block.hasEntity()){
|
||||
//TODO assign data and don't use new entity
|
||||
//entity = block.newEntity().init(this, block.update);
|
||||
entity = block.newEntity().init(this, block.update);
|
||||
entity.cons(new ConsumeModule(entity));
|
||||
if(block.hasItems) entity.items(new ItemModule());
|
||||
if(block.hasLiquids) entity.liquids(new LiquidModule());
|
||||
|
||||
@@ -196,7 +196,7 @@ public class BuildBlock extends Block{
|
||||
}
|
||||
}
|
||||
|
||||
public class BuildEntity extends Tilec{
|
||||
public class BuildEntity extends TileEntity{
|
||||
/**
|
||||
* 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.
|
||||
@@ -364,8 +364,8 @@ public class BuildBlock extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
progress = stream.readFloat();
|
||||
short pid = stream.readShort();
|
||||
short rid = stream.readShort();
|
||||
|
||||
@@ -5,6 +5,7 @@ import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.util.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
import static mindustry.Vars.tilesize;
|
||||
@@ -40,17 +41,18 @@ public class DeflectorWall extends Wall{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleBulletHit(Tilec entity, Bullet bullet){
|
||||
public void handleBulletHit(Tilec entity, Bulletc bullet){
|
||||
super.handleBulletHit(entity, bullet);
|
||||
|
||||
//TODO fix and test
|
||||
//doesn't reflect powerful bullets
|
||||
if(bullet.damage() > maxDamageDeflect || bullet.isDeflected()) return;
|
||||
if(bullet.damage() > maxDamageDeflect) return;
|
||||
|
||||
float penX = Math.abs(entity.getX() - bullet.x), penY = Math.abs(entity.getY() - bullet.y);
|
||||
float penX = Math.abs(entity.getX() - bullet.x()), penY = Math.abs(entity.getY() - bullet.y());
|
||||
|
||||
bullet.hitbox(rect2);
|
||||
|
||||
Vec2 position = Geometry.raycastRect(bullet.x - bullet.vel().x*Time.delta(), bullet.y - bullet.vel().y*Time.delta(), bullet.x + bullet.vel().x*Time.delta(), bullet.y + bullet.vel().y*Time.delta(),
|
||||
Vec2 position = Geometry.raycastRect(bullet.x() - bullet.vel().x*Time.delta(), bullet.y() - bullet.vel().y*Time.delta(), bullet.x() + bullet.vel().x*Time.delta(), bullet.y() + bullet.vel().y*Time.delta(),
|
||||
rect.setSize(size * tilesize + rect2.width*2 + rect2.height*2).setCenter(entity.getX(), entity.getY()));
|
||||
|
||||
if(position != null){
|
||||
@@ -64,14 +66,16 @@ public class DeflectorWall extends Wall{
|
||||
}
|
||||
|
||||
//bullet.updateVelocity();
|
||||
bullet.resetOwner(entity, entity.team());
|
||||
bullet.scaleTime(1f);
|
||||
bullet.deflect();
|
||||
bullet.owner(entity);
|
||||
bullet.team(entity.team());
|
||||
bullet.time(bullet.time() + 1f);
|
||||
//TODO deflect
|
||||
//bullet.deflect();
|
||||
|
||||
((DeflectorEntity)entity).hit = 1f;
|
||||
}
|
||||
|
||||
public static class DeflectorEntity extends Tilec{
|
||||
public static class DeflectorEntity extends TileEntity{
|
||||
public float hit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class Door extends Wall{
|
||||
Call.onDoorToggle(null, tile, !entity.open);
|
||||
}
|
||||
|
||||
public class DoorEntity extends Tilec{
|
||||
public class DoorEntity extends TileEntity{
|
||||
public boolean open = false;
|
||||
|
||||
@Override
|
||||
@@ -99,8 +99,8 @@ public class Door extends Wall{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
open = stream.readBoolean();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ import arc.math.*;
|
||||
import arc.math.geom.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.*;
|
||||
@@ -90,8 +89,9 @@ public class ForceProjector extends Block{
|
||||
ForceEntity entity = tile.ent();
|
||||
|
||||
if(entity.shield == null){
|
||||
entity.shield = new ShieldEntity(tile);
|
||||
entity.shield.add();
|
||||
//TODO implement
|
||||
//entity.shield = new ShieldEntity(tile);
|
||||
//entity.shield.add();
|
||||
}
|
||||
|
||||
boolean phaseValid = consumes.get(ConsumeType.item).valid(tile.entity);
|
||||
@@ -115,7 +115,7 @@ public class ForceProjector extends Block{
|
||||
ConsumeLiquidFilter cons = consumes.get(ConsumeType.liquid);
|
||||
if(cons.valid(entity)){
|
||||
cons.update(entity);
|
||||
scale *= (cooldownLiquid * (1f + (entity.getLiquids().current().heatCapacity - 0.4f) * 0.9f));
|
||||
scale *= (cooldownLiquid * (1f + (entity.liquids().current().heatCapacity - 0.4f) * 0.9f));
|
||||
}
|
||||
|
||||
entity.buildup -= Time.delta() * scale;
|
||||
@@ -140,7 +140,8 @@ public class ForceProjector extends Block{
|
||||
paramTile = tile;
|
||||
paramEntity = entity;
|
||||
paramBlock = this;
|
||||
bulletGroup.intersect(tile.drawx() - realRadius, tile.drawy() - realRadius, realRadius*2f, realRadius * 2f, shieldConsumer);
|
||||
//TODO fix
|
||||
//bulletGroup.intersect(tile.drawx() - realRadius, tile.drawy() - realRadius, realRadius*2f, realRadius * 2f, shieldConsumer);
|
||||
}
|
||||
|
||||
float realRadius(ForceEntity entity){
|
||||
@@ -161,7 +162,7 @@ public class ForceProjector extends Block{
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
class ForceEntity extends Tilec{
|
||||
class ForceEntity extends TileEntity{
|
||||
ShieldEntity shield;
|
||||
boolean broken = true;
|
||||
float buildup = 0f;
|
||||
@@ -181,8 +182,8 @@ public class ForceProjector extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
broken = stream.readBoolean();
|
||||
buildup = stream.readFloat();
|
||||
radscl = stream.readFloat();
|
||||
@@ -191,6 +192,14 @@ public class ForceProjector extends Block{
|
||||
}
|
||||
}
|
||||
|
||||
//TODO fix
|
||||
class ShieldEntity{
|
||||
|
||||
}
|
||||
/*
|
||||
//@EntityDef({Drawc.class})
|
||||
//class ShieldDef{}
|
||||
|
||||
public class ShieldEntity extends BaseEntity implements DrawTrait{
|
||||
final ForceEntity entity;
|
||||
|
||||
@@ -245,5 +254,5 @@ public class ForceProjector extends Block{
|
||||
public EntityGroup targetGroup(){
|
||||
return shieldGroup;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -67,9 +67,9 @@ public class MendProjector extends Block{
|
||||
entity.heat = Mathf.lerpDelta(entity.heat, entity.consValid() || tile.isEnemyCheat() ? 1f : 0f, 0.08f);
|
||||
entity.charge += entity.heat * entity.delta();
|
||||
|
||||
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, Mathf.num(entity.cons.optionalValid()), 0.1f);
|
||||
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, Mathf.num(entity.cons().optionalValid()), 0.1f);
|
||||
|
||||
if(entity.cons.optionalValid() && entity.timer(timerUse, useTime) && entity.efficiency() > 0){
|
||||
if(entity.cons().optionalValid() && entity.timer(timerUse, useTime) && entity.efficiency() > 0){
|
||||
entity.consume();
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class MendProjector extends Block{
|
||||
entity.charge = 0f;
|
||||
|
||||
indexer.eachBlock(entity, realRange, other -> other.entity.damaged(), other -> {
|
||||
other.entity.healBy(other.entity.maxHealth() * (healPercent + entity.phaseHeat * phaseBoost) / 100f * entity.efficiency());
|
||||
other.entity.heal(other.entity.maxHealth() * (healPercent + entity.phaseHeat * phaseBoost) / 100f * entity.efficiency());
|
||||
Fx.healBlockFull.at(other.drawx(), other.drawy(), other.block().size, Tmp.c1.set(baseColor).lerp(phaseColor, entity.phaseHeat));
|
||||
});
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public class MendProjector extends Block{
|
||||
renderer.lights.add(tile.drawx(), tile.drawy(), 50f * tile.entity.efficiency(), baseColor, 0.7f * tile.entity.efficiency());
|
||||
}
|
||||
|
||||
class MendEntity extends Tilec{
|
||||
class MendEntity extends TileEntity{
|
||||
float heat;
|
||||
float charge = Mathf.random(reload);
|
||||
float phaseHeat;
|
||||
@@ -133,8 +133,8 @@ public class MendProjector extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
heat = stream.readFloat();
|
||||
phaseHeat = stream.readFloat();
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class OverdriveProjector extends Block{
|
||||
entity.heat = Mathf.lerpDelta(entity.heat, entity.consValid() ? 1f : 0f, 0.08f);
|
||||
entity.charge += entity.heat * Time.delta();
|
||||
|
||||
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, Mathf.num(entity.cons.optionalValid()), 0.1f);
|
||||
entity.phaseHeat = Mathf.lerpDelta(entity.phaseHeat, Mathf.num(entity.cons().optionalValid()), 0.1f);
|
||||
|
||||
if(entity.timer(timerUse, useTime) && entity.efficiency() > 0){
|
||||
entity.consume();
|
||||
@@ -118,7 +118,7 @@ public class OverdriveProjector extends Block{
|
||||
Draw.reset();
|
||||
}
|
||||
|
||||
class OverdriveEntity extends Tilec{
|
||||
class OverdriveEntity extends TileEntity{
|
||||
float heat;
|
||||
float charge = Mathf.random(reload);
|
||||
float phaseHeat;
|
||||
@@ -131,8 +131,8 @@ public class OverdriveProjector extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
heat = stream.readFloat();
|
||||
phaseHeat = stream.readFloat();
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package mindustry.world.blocks.defense;
|
||||
|
||||
import arc.graphics.g2d.Draw;
|
||||
import arc.graphics.g2d.Fill;
|
||||
import arc.math.Mathf;
|
||||
import mindustry.entities.effect.Lightning;
|
||||
import mindustry.graphics.Layer;
|
||||
import mindustry.graphics.Pal;
|
||||
import mindustry.world.Block;
|
||||
import mindustry.world.Tile;
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import mindustry.entities.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
public class ShockMine extends Block{
|
||||
public final int timerDamage = timers++;
|
||||
|
||||
@@ -162,8 +162,8 @@ public class ItemTurret extends CooledTurret{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
byte amount = stream.readByte();
|
||||
for(int i = 0; i < amount; i++){
|
||||
Item item = Vars.content.item(stream.readByte());
|
||||
|
||||
@@ -309,7 +309,7 @@ public abstract class Turret extends Block{
|
||||
public abstract BulletType type();
|
||||
}
|
||||
|
||||
public static class TurretEntity extends Tilec{
|
||||
public static class TurretEntity extends TileEntity{
|
||||
public Array<AmmoEntry> ammo = new Array<>();
|
||||
public int totalAmmo;
|
||||
public float reload;
|
||||
@@ -327,8 +327,8 @@ public abstract class Turret extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
if(revision == 1){
|
||||
reload = stream.readFloat();
|
||||
rotation = stream.readFloat();
|
||||
|
||||
@@ -47,8 +47,8 @@ public class BufferedItemBridge extends ExtendingItemBridge{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
buffer.read(stream);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
return;
|
||||
}
|
||||
|
||||
float nextMax = e.nextc != null && tile.rotation() == e.nextc.tile.rotation() ? 1f - Math.max(itemSpace - e.nextc.minitem, 0) : 1f;
|
||||
float nextMax = e.nextc != null && tile.rotation() == e.nextc.tile().rotation() ? 1f - Math.max(itemSpace - e.nextc.minitem, 0) : 1f;
|
||||
|
||||
for(int i = e.len - 1; i >= 0; i--){
|
||||
float nextpos = (i == e.len - 1 ? 100f : e.ys[i + 1]) - itemSpace;
|
||||
@@ -197,7 +197,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
e.nextc.xs[e.nextc.lastInserted] = e.xs[i];
|
||||
}
|
||||
//remove last item
|
||||
e.items.remove(e.ids[i], e.len - i);
|
||||
e.items().remove(e.ids[i], e.len - i);
|
||||
e.len = Math.min(i, e.len);
|
||||
}else if(e.ys[i] < e.minitem){
|
||||
e.minitem = e.ys[i];
|
||||
@@ -244,7 +244,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
}
|
||||
}
|
||||
|
||||
e.items.remove(item, removed);
|
||||
e.items().remove(item, removed);
|
||||
|
||||
return removed;
|
||||
}
|
||||
@@ -255,13 +255,13 @@ public class Conveyor extends Block implements Autotiler{
|
||||
}
|
||||
|
||||
@Override
|
||||
public int acceptStack(Item item, int amount, Tile tile, Unitc source){
|
||||
public int acceptStack(Item item, int amount, Tile tile, Teamc source){
|
||||
ConveyorEntity entity = tile.ent();
|
||||
return Math.min((int)(entity.minitem / itemSpace), amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleStack(Item item, int amount, Tile tile, Unitc source){
|
||||
public void handleStack(Item item, int amount, Tile tile, Teamc source){
|
||||
ConveyorEntity e = tile.ent();
|
||||
|
||||
for(int i = amount - 1; i >= 0; i--){
|
||||
@@ -269,7 +269,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
e.xs[0] = 0;
|
||||
e.ys[0] = i * itemSpace;
|
||||
e.ids[0] = item;
|
||||
e.items.add(item, 1);
|
||||
e.items().add(item, 1);
|
||||
}
|
||||
|
||||
e.noSleep();
|
||||
@@ -293,7 +293,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
float x = (ang == -1 || ang == 3) ? 1 : (ang == 1 || ang == -3) ? -1 : 0;
|
||||
|
||||
e.noSleep();
|
||||
e.items.add(item, 1);
|
||||
e.items().add(item, 1);
|
||||
|
||||
if(Math.abs(source.relativeTo(tile.x, tile.y) - r) == 0){ //idx = 0
|
||||
e.add(0);
|
||||
@@ -308,7 +308,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
}
|
||||
}
|
||||
|
||||
public static class ConveyorEntity extends Tilec{
|
||||
public static class ConveyorEntity extends TileEntity{
|
||||
//parallel array data
|
||||
Item[] ids = new Item[capacity];
|
||||
float[] xs = new float[capacity];
|
||||
@@ -360,8 +360,8 @@ public class Conveyor extends Block implements Autotiler{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
int amount = stream.readInt();
|
||||
len = Math.min(amount, capacity);
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@ public class ItemBridge extends Block{
|
||||
return other.block() == this && (!checkDouble || other.<ItemBridgeEntity>ent().link != tile.pos());
|
||||
}
|
||||
|
||||
public static class ItemBridgeEntity extends Tilec{
|
||||
public static class ItemBridgeEntity extends TileEntity{
|
||||
public int link = Pos.invalid;
|
||||
public IntSet incoming = new IntSet();
|
||||
public float uptime;
|
||||
@@ -389,8 +389,8 @@ public class ItemBridge extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
link = stream.readInt();
|
||||
uptime = stream.readFloat();
|
||||
byte links = stream.readByte();
|
||||
|
||||
@@ -86,7 +86,7 @@ public class Junction extends Block{
|
||||
return to != null && to.link().entity != null && to.team() == tile.team();
|
||||
}
|
||||
|
||||
class JunctionEntity extends Tilec{
|
||||
class JunctionEntity extends TileEntity{
|
||||
DirectionalItemBuffer buffer = new DirectionalItemBuffer(capacity, speed);
|
||||
|
||||
@Override
|
||||
@@ -96,8 +96,8 @@ public class Junction extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
buffer.read(stream);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +311,7 @@ public class MassDriver extends Block{
|
||||
}
|
||||
}
|
||||
|
||||
public class MassDriverEntity extends Tilec{
|
||||
public class MassDriverEntity extends TileEntity{
|
||||
int link = -1;
|
||||
float rotation = 90;
|
||||
float reload = 0f;
|
||||
@@ -340,8 +340,8 @@ public class MassDriver extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
link = stream.readInt();
|
||||
rotation = stream.readFloat();
|
||||
state = DriverState.values()[stream.readByte()];
|
||||
|
||||
@@ -113,7 +113,7 @@ public class OverflowGate extends Block{
|
||||
return to;
|
||||
}
|
||||
|
||||
public class OverflowGateEntity extends Tilec{
|
||||
public class OverflowGateEntity extends TileEntity{
|
||||
Item lastItem;
|
||||
Tile lastInput;
|
||||
float time;
|
||||
@@ -129,8 +129,8 @@ public class OverflowGate extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
if(revision == 1){
|
||||
new DirectionalItemBuffer(25, 50f).read(stream);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class Router extends Block{
|
||||
return result;
|
||||
}
|
||||
|
||||
public class RouterEntity extends Tilec{
|
||||
public class RouterEntity extends TileEntity{
|
||||
Item lastItem;
|
||||
Tile lastInput;
|
||||
float time;
|
||||
|
||||
@@ -139,7 +139,7 @@ public class Sorter extends Block{
|
||||
});
|
||||
}
|
||||
|
||||
public class SorterEntity extends Tilec{
|
||||
public class SorterEntity extends TileEntity{
|
||||
@Nullable Item sortItem;
|
||||
|
||||
@Override
|
||||
@@ -159,8 +159,8 @@ public class Sorter extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
sortItem = content.item(stream.readShort());
|
||||
if(revision == 1){
|
||||
new DirectionalItemBuffer(20, 45f).read(stream);
|
||||
|
||||
@@ -9,6 +9,7 @@ import arc.struct.*;
|
||||
import arc.util.*;
|
||||
import mindustry.content.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.world.*;
|
||||
import mindustry.world.blocks.*;
|
||||
@@ -128,7 +129,7 @@ public class Conduit extends LiquidBlock implements Autotiler{
|
||||
&& ((source.absoluteRelativeTo(tile.x, tile.y) + 2) % 4 != tile.rotation());
|
||||
}
|
||||
|
||||
public static class ConduitEntity extends Tilec{
|
||||
public static class ConduitEntity extends TileEntity{
|
||||
public float smoothLiquid;
|
||||
|
||||
int blendbits;
|
||||
|
||||
@@ -146,7 +146,7 @@ public class MessageBlock extends Block{
|
||||
table.setPosition(pos.x, pos.y, Align.bottom);
|
||||
}
|
||||
|
||||
public class MessageBlockEntity extends Tilec{
|
||||
public class MessageBlockEntity extends TileEntity{
|
||||
public String message = "";
|
||||
public String[] lines = {""};
|
||||
|
||||
@@ -157,8 +157,8 @@ public class MessageBlock extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
message = stream.readUTF();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,8 +171,8 @@ public class ImpactReactor extends PowerGenerator{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
warmup = stream.readFloat();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public class LightBlock extends Block{
|
||||
renderer.lights.add(tile.drawx(), tile.drawy(), radius, Tmp.c1.set(entity.color), brightness * tile.entity.efficiency());
|
||||
}
|
||||
|
||||
public class LightEntity extends Tilec{
|
||||
public class LightEntity extends TileEntity{
|
||||
public int color = Pal.accent.rgba();
|
||||
|
||||
@Override
|
||||
@@ -87,8 +87,8 @@ public class LightBlock extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
color = stream.readInt();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,8 +192,8 @@ public class NuclearReactor extends PowerGenerator{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
heat = stream.readFloat();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class PowerGenerator extends PowerDistributor{
|
||||
return false;
|
||||
}
|
||||
|
||||
public static class GeneratorEntity extends Tilec{
|
||||
public static class GeneratorEntity extends TileEntity{
|
||||
public float generateTime;
|
||||
/** The efficiency of the producer. An efficiency of 1.0 means 100% */
|
||||
public float productionEfficiency = 0.0f;
|
||||
@@ -65,8 +65,8 @@ public class PowerGenerator extends PowerDistributor{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
productionEfficiency = stream.readFloat();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,8 +126,8 @@ public class Cultivator extends GenericCrafter{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
warmup = stream.readFloat();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ public class Drill extends Block{
|
||||
return drops != null && drops.hardness <= tier;
|
||||
}
|
||||
|
||||
public static class DrillEntity extends Tilec{
|
||||
public static class DrillEntity extends TileEntity{
|
||||
float progress;
|
||||
int index;
|
||||
float warmup;
|
||||
|
||||
@@ -145,7 +145,7 @@ public class GenericCrafter extends Block{
|
||||
return itemCapacity;
|
||||
}
|
||||
|
||||
public static class GenericCrafterEntity extends Tilec{
|
||||
public static class GenericCrafterEntity extends TileEntity{
|
||||
public float progress;
|
||||
public float totalProgress;
|
||||
public float warmup;
|
||||
@@ -158,8 +158,8 @@ public class GenericCrafter extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
progress = stream.readFloat();
|
||||
warmup = stream.readFloat();
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class Incinerator extends Block{
|
||||
return entity.heat > 0.5f;
|
||||
}
|
||||
|
||||
public static class IncineratorEntity extends Tilec{
|
||||
public static class IncineratorEntity extends TileEntity{
|
||||
public float heat;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public class SolidPump extends Pump{
|
||||
return tile.entity.liquids().total();
|
||||
}
|
||||
|
||||
public static class SolidPumpEntity extends Tilec{
|
||||
public static class SolidPumpEntity extends TileEntity{
|
||||
public float warmup;
|
||||
public float pumpTime;
|
||||
public float boost;
|
||||
|
||||
@@ -92,7 +92,7 @@ public class ItemSource extends Block{
|
||||
return false;
|
||||
}
|
||||
|
||||
public class ItemSourceEntity extends Tilec{
|
||||
public class ItemSourceEntity extends TileEntity{
|
||||
Item outputItem;
|
||||
|
||||
@Override
|
||||
@@ -107,8 +107,8 @@ public class ItemSource extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
outputItem = content.item(stream.readShort());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class LiquidSource extends Block{
|
||||
tile.<LiquidSourceEntity>ent().source = value == -1 ? null : content.liquid(value);
|
||||
}
|
||||
|
||||
class LiquidSourceEntity extends Tilec{
|
||||
class LiquidSourceEntity extends TileEntity{
|
||||
public @Nullable Liquid source = null;
|
||||
|
||||
@Override
|
||||
@@ -127,8 +127,8 @@ public class LiquidSource extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
byte id = stream.readByte();
|
||||
source = id == -1 ? null : content.liquid(id);
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ public class CoreBlock extends StorageBlock{
|
||||
return entity.spawnPlayer != null;
|
||||
}
|
||||
|
||||
public class CoreEntity extends Tilec{
|
||||
public class CoreEntity extends TileEntity{
|
||||
protected Playerc spawnPlayer;
|
||||
protected float progress;
|
||||
protected float time;
|
||||
|
||||
@@ -70,7 +70,7 @@ public abstract class StorageBlock extends Block{
|
||||
}
|
||||
}
|
||||
|
||||
public class StorageBlockEntity extends Tilec{
|
||||
public class StorageBlockEntity extends TileEntity{
|
||||
protected @Nullable
|
||||
Tile linkedCore;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class Unloader extends Block{
|
||||
});
|
||||
}
|
||||
|
||||
public static class UnloaderEntity extends Tilec{
|
||||
public static class UnloaderEntity extends TileEntity{
|
||||
public Item sortItem = null;
|
||||
|
||||
@Override
|
||||
@@ -144,8 +144,8 @@ public class Unloader extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
byte id = stream.readByte();
|
||||
sortItem = id == -1 ? null : content.items().get(id);
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public class CommandCenter extends Block{
|
||||
Events.fire(new CommandIssueEvent(tile, command));
|
||||
}
|
||||
|
||||
public class CommandCenterEntity extends Tilec{
|
||||
public class CommandCenterEntity extends TileEntity{
|
||||
public UnitCommand command = UnitCommand.attack;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -133,29 +133,13 @@ public class MechPad extends Block{
|
||||
}
|
||||
}
|
||||
|
||||
public class MechFactoryEntity extends Tilec implements SpawnerTrait{
|
||||
public class MechFactoryEntity extends TileEntity{
|
||||
Playerc player;
|
||||
boolean sameMech;
|
||||
float progress;
|
||||
float time;
|
||||
float heat;
|
||||
|
||||
@Override
|
||||
public boolean hasUnit(Unitc unit){
|
||||
return unit == player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSpawning(Playerc unit){
|
||||
if(player == null){
|
||||
progress = 0f;
|
||||
player = unit;
|
||||
sameMech = true;
|
||||
|
||||
player.beginRespawning(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutput stream) throws IOException{
|
||||
super.write(stream);
|
||||
@@ -165,8 +149,8 @@ public class MechPad extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
progress = stream.readFloat();
|
||||
time = stream.readFloat();
|
||||
heat = stream.readFloat();
|
||||
|
||||
@@ -139,7 +139,7 @@ public class RepairPoint extends Block{
|
||||
return entity.target != null;
|
||||
}
|
||||
|
||||
public class RepairPointEntity extends Tilec{
|
||||
public class RepairPointEntity extends TileEntity{
|
||||
public Unitc target;
|
||||
public float strength, rotation = 90;
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public class UnitFactory extends Block{
|
||||
return entity.spawned < maxSpawn;
|
||||
}
|
||||
|
||||
public static class UnitFactoryEntity extends Tilec{
|
||||
public static class UnitFactoryEntity extends TileEntity{
|
||||
float buildTime;
|
||||
float time;
|
||||
float speedScl;
|
||||
@@ -198,8 +198,8 @@ public class UnitFactory extends Block{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(DataInput stream, byte revision) throws IOException{
|
||||
super.read(stream, revision);
|
||||
public void read(DataInput stream) throws IOException{
|
||||
super.read(stream);
|
||||
buildTime = stream.readFloat();
|
||||
spawned = stream.readInt();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user