Bugfixes
This commit is contained in:
@@ -88,6 +88,11 @@ public class PayloadConveyor extends Block{
|
||||
blocked = (next != null && next.solid()) || (this.next != null && (this.next.rotation() + 2)%4 == rotation());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Payload getPayload(){
|
||||
return item;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTile(){
|
||||
progress = Time.time() % moveTime;
|
||||
|
||||
@@ -33,6 +33,11 @@ public class BlockPayload implements Payload{
|
||||
tile.setBlock(entity.block(), entity.team(), rotation, () -> entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeTaken(Payloadc picker){
|
||||
return entity.block.size <= 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fits(){
|
||||
return entity.block().size < 3;
|
||||
|
||||
@@ -27,6 +27,11 @@ public interface Payload{
|
||||
return true;
|
||||
}
|
||||
|
||||
/** @return whether the unit can pick up this payload. */
|
||||
default boolean canBeTaken(Payloadc picker){
|
||||
return true;
|
||||
}
|
||||
|
||||
/** writes the payload for saving. */
|
||||
void write(Writes write);
|
||||
|
||||
|
||||
@@ -20,6 +20,11 @@ public class UnitPayload implements Payload{
|
||||
return unit.hitSize <= 16f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeTaken(Payloadc picker){
|
||||
return unit.hitSize < picker.hitSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(Writes write){
|
||||
write.b(payloadUnit);
|
||||
|
||||
@@ -65,6 +65,11 @@ public class PayloadAcceptor extends Block{
|
||||
updatePayload();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Payload getPayload(){
|
||||
return payload;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Payload takePayload(){
|
||||
T t = payload;
|
||||
|
||||
Reference in New Issue
Block a user