Lock rotation of blocks with rotate = false to 0 (#8531)

* Lock rotation of blocks that don't rotate

* Fix input visuals

* Default to false

Quick, stop forcing changes to mods before sk yells at me.

* lock GenericCrafter rotation if rotate = false

* Convert from a setter a to block method

* Simplify

* Revert "lock GenericCrafter rotation if rotate = false"

This reverts commit 26ac41baf5.

* Remove `lockRotation` boolean.

Pointless. If you want something to rotate, just do `rotate = true; drawArrow = false;`
This commit is contained in:
MEEPofFaith
2023-06-16 15:57:54 -04:00
committed by GitHub
parent d14cdfd59c
commit 26c0c7467b
5 changed files with 19 additions and 12 deletions
+6 -5
View File
@@ -178,17 +178,18 @@ public class DesktopInput extends InputHandler{
}
linePlans.each(this::drawOverPlan);
}else if(isPlacing()){
int rot = block.planRotation(rotation);
if(block.rotate && block.drawArrow){
drawArrow(block, cursorX, cursorY, rotation);
drawArrow(block, cursorX, cursorY, rot);
}
Draw.color();
boolean valid = validPlace(cursorX, cursorY, block, rotation);
drawPlan(cursorX, cursorY, block, rotation);
block.drawPlace(cursorX, cursorY, rotation, valid);
boolean valid = validPlace(cursorX, cursorY, block, rot);
drawPlan(cursorX, cursorY, block, rot);
block.drawPlace(cursorX, cursorY, rot, valid);
if(block.saveConfig){
Draw.mixcol(!valid ? Pal.breakInvalid : Color.white, (!valid ? 0.4f : 0.24f) + Mathf.absin(Time.globalTime, 6f, 0.28f));
bplan.set(cursorX, cursorY, rotation, block);
bplan.set(cursorX, cursorY, rot, block);
bplan.config = block.lastConfig;
block.drawPlanConfig(bplan, allPlans());
bplan.config = null;