Block color pick fix

This commit is contained in:
Anuken
2025-07-17 16:52:19 -04:00
parent 24cfb000de
commit 64471cf817
4 changed files with 5 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

View File

@@ -841,6 +841,7 @@ public class Blocks{
autotile = true; autotile = true;
drawEdgeOut = false; drawEdgeOut = false;
drawEdgeIn = false; drawEdgeIn = false;
autotileMidVariants = 2;
}}; }};
cruxFloor5 = new Floor("crux-floor-5"){{ cruxFloor5 = new Floor("crux-floor-5"){{

View File

@@ -138,10 +138,6 @@ public class PlacementFragment{
Block tryBlock = build == null ? null : build instanceof ConstructBuild c ? c.current : build.block; Block tryBlock = build == null ? null : build instanceof ConstructBuild c ? c.current : build.block;
Object tryConfig = build == null || !build.block.copyConfig ? null : build.config(); Object tryConfig = build == null || !build.block.copyConfig ? null : build.config();
if(tryBlock != null && tryBlock.showColorEdit && tryConfig == null){
tryConfig = tile.extraData;
}
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())){
tryBlock = req.block; tryBlock = req.block;
@@ -157,6 +153,10 @@ public class PlacementFragment{
tile.floor() != Blocks.air ? tile.floor() : null; tile.floor() != Blocks.air ? tile.floor() : null;
} }
if(tryBlock != null && tryBlock.showColorEdit && tryConfig == null){
tryConfig = tile.extraData;
}
if(tryBlock != null && ((tryBlock.isVisible() && unlocked(tryBlock)) || state.rules.editor)){ if(tryBlock != null && ((tryBlock.isVisible() && unlocked(tryBlock)) || state.rules.editor)){
input.block = tryBlock; input.block = tryBlock;
tryBlock.lastConfig = tryConfig; tryBlock.lastConfig = tryConfig;