Bodge in a rotational blend bypass
This commit is contained in:
@@ -53,6 +53,8 @@ public class Block extends BlockStorage{
|
||||
public boolean solidifes;
|
||||
/** whether this is rotateable */
|
||||
public boolean rotate;
|
||||
/** whether this dumps as well */
|
||||
public boolean dumpling;
|
||||
/** whether you can break this with rightclick */
|
||||
public boolean breakable;
|
||||
/** whether to add this block to brokenblocks */
|
||||
@@ -667,6 +669,13 @@ public class Block extends BlockStorage{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether blending this tile should respect dumpling.
|
||||
*/
|
||||
public boolean blendDumpling(Tile tile){
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getDisplayName(Tile tile){
|
||||
return localizedName;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import mindustry.world.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static mindustry.Vars.world;
|
||||
|
||||
public interface Autotiler{
|
||||
class AutotilerHolder{
|
||||
static final int[] blendresult = new int[3];
|
||||
@@ -95,7 +97,7 @@ public interface Autotiler{
|
||||
|
||||
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)
|
||||
|| (!otherblock.rotate || Point2.equals(otherx + Geometry.d4(otherrot).x, othery + Geometry.d4(otherrot).y, tile.x, tile.y)));
|
||||
|| (!(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)));
|
||||
}
|
||||
|
||||
boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock);
|
||||
|
||||
@@ -116,7 +116,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
|
||||
@Override
|
||||
public boolean blends(Tile tile, int rotation, int otherx, int othery, int otherrot, Block otherblock){
|
||||
return otherblock.outputsItems() && (lookingAt(tile, rotation, otherx, othery, otherrot, otherblock) || (otherblock instanceof CraterConveyor && world.tile(otherx, othery).<CraterConveyorEntity>ent().blendbit2 == 6));
|
||||
return otherblock.outputsItems() && (lookingAt(tile, rotation, otherx, othery, otherrot, otherblock));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -285,7 +285,7 @@ public class Conveyor extends Block implements Autotiler{
|
||||
ConveyorEntity e = tile.ent();
|
||||
if(e.len >= capacity) return false;
|
||||
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.rotation() + 2) % 4 == 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()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,6 +43,7 @@ public class CraterConveyor extends Block implements Autotiler{
|
||||
idleSound = Sounds.conveyor;
|
||||
idleSoundVolume = 0.004f;
|
||||
unloadable = false;
|
||||
dumpling = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -335,4 +336,9 @@ public class CraterConveyor extends Block implements Autotiler{
|
||||
|
||||
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