Cleanup, renaming

This commit is contained in:
Anuken
2020-06-08 21:03:29 -04:00
parent 6dd9369066
commit 6501071510
15 changed files with 571 additions and 605 deletions

View File

@@ -23,8 +23,6 @@ public class Tile implements Position, QuadTreeObject{
/** Tile entity, usually null. */
public @Nullable Tilec entity;
public short x, y;
/** Extra data. Used for dumping. */
public byte data;
protected @NonNull Block block;
protected @NonNull Floor floor;
protected @NonNull Floor overlay;

View File

@@ -68,8 +68,16 @@ public class PayloadConveyor extends Block{
Tilec accept = nearby(Geometry.d4(rotation()).x * size, Geometry.d4(rotation()).y * size);
//next block must be aligned and of the same size
if(accept != null && accept.block().size == size &&
tileX() + Geometry.d4(rotation()).x * size == accept.tileX() && tileY() + Geometry.d4(rotation()).y * size == accept.tileY()){
if(accept != null && (
//same size
(accept.block().size == size && tileX() + Geometry.d4(rotation()).x * size == accept.tileX() && tileY() + Geometry.d4(rotation()).y * size == accept.tileY()) ||
//differing sizes
(accept.block().size > size &&
(rotation() % 2 == 0 ? //check orientation
Math.abs(accept.y() - y) <= accept.block().size * tilesize - size * tilesize : //check Y alignment
Math.abs(accept.x() - x) <= accept.block().size * tilesize - size * tilesize //check X alignment
)))){
next = accept;
}else{
next = null;