This commit is contained in:
Anuken
2020-06-07 09:58:29 -04:00
parent bf125c92d3
commit 737e32e447
8 changed files with 117 additions and 55 deletions

View File

@@ -44,6 +44,11 @@ public class LaserTurret extends PowerTurret{
Bulletc bullet;
float bulletLife;
@Override
protected void updateCooling(){
//do nothing, cooling is irrelevant here
}
@Override
public void updateTile(){
super.updateTile();

View File

@@ -174,7 +174,7 @@ public class PayloadConveyor extends Block{
@Override
public boolean acceptPayload(Tilec source, Payload payload){
//accepting payloads from units isn't supported
return this.item == null && progress <= 5f && source != this;
return this.item == null && progress <= 5f && source != this && payload.fits();
}
@Override

View File

@@ -33,6 +33,11 @@ public class BlockPayload implements Payload{
tile.setBlock(entity.block(), entity.team(), rotation, () -> entity);
}
@Override
public boolean fits(){
return entity.block().size < 3;
}
@Override
public void write(Writes write){
write.b(payloadBlock);

View File

@@ -22,6 +22,11 @@ public interface Payload{
return false;
}
/** @return whether this payload fits on a standard 3x3 conveyor. */
default boolean fits(){
return true;
}
/** writes the payload for saving. */
void write(Writes write);

View File

@@ -15,6 +15,11 @@ 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);