This commit is contained in:
@@ -97,9 +97,9 @@ public class PlacementFragment extends Fragment{
|
|||||||
scrollPositions.put(currentCategory, blockPane.getScrollY());
|
scrollPositions.put(currentCategory, blockPane.getScrollY());
|
||||||
|
|
||||||
if(Core.input.keyTap(Binding.pick) && player.isBuilder()){ //mouse eyedropper select
|
if(Core.input.keyTap(Binding.pick) && player.isBuilder()){ //mouse eyedropper select
|
||||||
Building tile = world.buildWorld(Core.input.mouseWorld().x, Core.input.mouseWorld().y);
|
var build = world.buildWorld(Core.input.mouseWorld().x, Core.input.mouseWorld().y);
|
||||||
Block tryRecipe = tile == null ? null : tile instanceof ConstructBuild c ? c.cblock : tile.block;
|
Block tryRecipe = build == null ? null : build instanceof ConstructBuild c ? c.cblock : build.block;
|
||||||
Object tryConfig = tile == null ? null : tile.config();
|
Object tryConfig = build == null || !build.block.copyConfig ? null : build.config();
|
||||||
|
|
||||||
for(BuildPlan req : player.unit().plans()){
|
for(BuildPlan req : player.unit().plans()){
|
||||||
if(!req.breaking && req.block.bounds(req.x, req.y, Tmp.r1).contains(Core.input.mouseWorld())){
|
if(!req.breaking && req.block.bounds(req.x, req.y, Tmp.r1).contains(Core.input.mouseWorld())){
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ public class Block extends UnlockableContent{
|
|||||||
public @Nullable Object lastConfig;
|
public @Nullable Object lastConfig;
|
||||||
/** whether to save the last config and apply it to newly placed blocks */
|
/** whether to save the last config and apply it to newly placed blocks */
|
||||||
public boolean saveConfig = false;
|
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 */
|
/** whether this block has a tile entity that updates */
|
||||||
public boolean update;
|
public boolean update;
|
||||||
/** whether this block has health and can be destroyed */
|
/** whether this block has health and can be destroyed */
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public class ItemBridge extends Block{
|
|||||||
unloadable = false;
|
unloadable = false;
|
||||||
group = BlockGroup.transportation;
|
group = BlockGroup.transportation;
|
||||||
noUpdateDisabled = true;
|
noUpdateDisabled = true;
|
||||||
|
copyConfig = false;
|
||||||
|
|
||||||
//point2 config is relative
|
//point2 config is relative
|
||||||
config(Point2.class, (ItemBridgeBuild tile, Point2 i) -> tile.link = Point2.pack(i.x + tile.tileX(), i.y + tile.tileY()));
|
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){
|
public Tile findLink(int x, int y){
|
||||||
Tile tile = world.tile(x, 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 lastBuild.tile;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@@ -176,11 +177,9 @@ public class ItemBridge extends Block{
|
|||||||
public void playerPlaced(Object config){
|
public void playerPlaced(Object config){
|
||||||
super.playerPlaced(config);
|
super.playerPlaced(config);
|
||||||
|
|
||||||
if(config == null){
|
Tile link = findLink(tile.x, tile.y);
|
||||||
Tile link = findLink(tile.x, tile.y);
|
if(linkValid(tile, link) && !proximity.contains(link.build)){
|
||||||
if(linkValid(tile, link) && !proximity.contains(link.build)){
|
link.build.configure(tile.pos());
|
||||||
link.build.configure(tile.pos());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lastBuild = this;
|
lastBuild = this;
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=13b82d76b623e9c6492f3005adc17babad5cb9bf
|
archash=0c7618428502c75e08b4e15239df297c7ab95be9
|
||||||
|
|||||||
Reference in New Issue
Block a user