This commit is contained in:
@@ -63,6 +63,8 @@ public class Block extends UnlockableContent{
|
||||
public @Nullable Object lastConfig;
|
||||
/** whether to save the last config and apply it to newly placed blocks */
|
||||
public boolean saveConfig = false;
|
||||
/** whether to allow copying the config through middle click */
|
||||
public boolean copyConfig = true;
|
||||
/** whether this block has a tile entity that updates */
|
||||
public boolean update;
|
||||
/** whether this block has health and can be destroyed */
|
||||
|
||||
@@ -45,6 +45,7 @@ public class ItemBridge extends Block{
|
||||
unloadable = false;
|
||||
group = BlockGroup.transportation;
|
||||
noUpdateDisabled = true;
|
||||
copyConfig = false;
|
||||
|
||||
//point2 config is relative
|
||||
config(Point2.class, (ItemBridgeBuild tile, Point2 i) -> tile.link = Point2.pack(i.x + tile.tileX(), i.y + tile.tileY()));
|
||||
@@ -142,7 +143,7 @@ public class ItemBridge extends Block{
|
||||
|
||||
public Tile findLink(int x, int y){
|
||||
Tile tile = world.tile(x, y);
|
||||
if(tile != null && lastBuild != null && linkValid(tile, lastBuild.tile) && lastBuild.tile != tile){
|
||||
if(tile != null && lastBuild != null && linkValid(tile, lastBuild.tile) && lastBuild.tile != tile && lastBuild.link == -1){
|
||||
return lastBuild.tile;
|
||||
}
|
||||
return null;
|
||||
@@ -176,11 +177,9 @@ public class ItemBridge extends Block{
|
||||
public void playerPlaced(Object config){
|
||||
super.playerPlaced(config);
|
||||
|
||||
if(config == null){
|
||||
Tile link = findLink(tile.x, tile.y);
|
||||
if(linkValid(tile, link) && !proximity.contains(link.build)){
|
||||
link.build.configure(tile.pos());
|
||||
}
|
||||
Tile link = findLink(tile.x, tile.y);
|
||||
if(linkValid(tile, link) && !proximity.contains(link.build)){
|
||||
link.build.configure(tile.pos());
|
||||
}
|
||||
|
||||
lastBuild = this;
|
||||
|
||||
Reference in New Issue
Block a user