Try to fix blending with omnidirectional
This commit is contained in:
@@ -122,6 +122,10 @@ public class TileEntity extends BaseEntity implements TargetTrait, HealthTrait{
|
|||||||
return dead || tile.entity != this;
|
return dead || tile.entity != this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isOmnidirectional(){
|
||||||
|
return !block.rotate;
|
||||||
|
}
|
||||||
|
|
||||||
@CallSuper
|
@CallSuper
|
||||||
public void write(DataOutput stream) throws IOException{
|
public void write(DataOutput stream) throws IOException{
|
||||||
stream.writeShort((short)health);
|
stream.writeShort((short)health);
|
||||||
|
|||||||
@@ -53,8 +53,6 @@ public class Block extends BlockStorage{
|
|||||||
public boolean solidifes;
|
public boolean solidifes;
|
||||||
/** whether this is rotateable */
|
/** whether this is rotateable */
|
||||||
public boolean rotate;
|
public boolean rotate;
|
||||||
/** whether this dumps as well */
|
|
||||||
public boolean dumpling;
|
|
||||||
/** whether you can break this with rightclick */
|
/** whether you can break this with rightclick */
|
||||||
public boolean breakable;
|
public boolean breakable;
|
||||||
/** whether to add this block to brokenblocks */
|
/** whether to add this block to brokenblocks */
|
||||||
@@ -669,13 +667,6 @@ public class Block extends BlockStorage{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether blending this tile should respect dumpling.
|
|
||||||
*/
|
|
||||||
public boolean blendDumpling(Tile tile){
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDisplayName(Tile tile){
|
public String getDisplayName(Tile tile){
|
||||||
return localizedName;
|
return localizedName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,13 +91,13 @@ public interface Autotiler{
|
|||||||
|
|
||||||
default boolean blendsArmored(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){
|
default boolean blendsArmored(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){
|
||||||
return (Point2.equals(tile.x + Geometry.d4(rotation).x, tile.y + Geometry.d4(rotation).y, otherx, othery)
|
return (Point2.equals(tile.x + Geometry.d4(rotation).x, tile.y + Geometry.d4(rotation).y, otherx, othery)
|
||||||
|| ((!otherblock.rotate && Edges.getFacingEdge(otherblock, otherx, othery, tile) != null &&
|
|| ((world.tile(otherx, othery).entity.isOmnidirectional() && Edges.getFacingEdge(otherblock, otherx, othery, tile) != null &&
|
||||||
Edges.getFacingEdge(otherblock, otherx, othery, tile).relativeTo(tile) == rotation) || (otherblock.rotate && Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y))));
|
Edges.getFacingEdge(otherblock, otherx, othery, tile).relativeTo(tile) == rotation) || (otherblock.rotate && Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y))));
|
||||||
}
|
}
|
||||||
|
|
||||||
default boolean lookingAt(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){
|
default boolean lookingAt(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){
|
||||||
return (Point2.equals(tile.x + Geometry.d4(rotation).x, tile.y + Geometry.d4(rotation).y, otherx, othery)
|
return (Point2.equals(tile.x + Geometry.d4(rotation).x, tile.y + Geometry.d4(rotation).y, otherx, othery)
|
||||||
|| (!(otherblock.rotate && !(otherblock.dumpling && otherblock.blendDumpling(world.tile(otherx, othery)))) || Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y)));
|
|| (world.tile(otherx, othery).entity.isOmnidirectional() || Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y)));
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock);
|
boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock);
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ public class Conveyor extends Block implements Autotiler{
|
|||||||
ConveyorEntity e = tile.ent();
|
ConveyorEntity e = tile.ent();
|
||||||
if(e.len >= capacity) return false;
|
if(e.len >= capacity) return false;
|
||||||
int direction = source == null ? 0 : Math.abs(source.relativeTo(tile.x, tile.y) - tile.rotation());
|
int direction = source == null ? 0 : Math.abs(source.relativeTo(tile.x, tile.y) - tile.rotation());
|
||||||
return (((direction == 0) && e.minitem >= itemSpace) || ((direction % 2 == 1) && e.minitem > 0.7f)) && (source == null || !((source.block().rotate && !source.block().dumpling) && (source.rotation() + 2) % 4 == tile.rotation()));
|
return (((direction == 0) && e.minitem >= itemSpace) || ((direction % 2 == 1) && e.minitem > 0.7f)) && (source == null || source.entity.isOmnidirectional() && (source.rotation() + 2) % 4 == tile.rotation());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ public class CraterConveyor extends Block implements Autotiler{
|
|||||||
idleSound = Sounds.conveyor;
|
idleSound = Sounds.conveyor;
|
||||||
idleSoundVolume = 0.004f;
|
idleSoundVolume = 0.004f;
|
||||||
unloadable = false;
|
unloadable = false;
|
||||||
dumpling = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -270,6 +269,11 @@ public class CraterConveyor extends Block implements Autotiler{
|
|||||||
dump = stream.readByte();
|
dump = stream.readByte();
|
||||||
reload = stream.readFloat();
|
reload = stream.readFloat();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOmnidirectional(){
|
||||||
|
return blendbit2 == 6;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// crater conveyor tiles that input into this one
|
// crater conveyor tiles that input into this one
|
||||||
@@ -336,9 +340,4 @@ public class CraterConveyor extends Block implements Autotiler{
|
|||||||
|
|
||||||
entity.dump = (byte)((entity.dump + 1) % prox);
|
entity.dump = (byte)((entity.dump + 1) % prox);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean blendDumpling(Tile tile){
|
|
||||||
return tile.<CraterConveyorEntity>ent().blendbit2 == 6;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user