Add BlockRotateEvent (#8577)

* feat: Add BuildRotateEvent

* fix: Fix invalid argument

* fix: Goofy aaah static imports

* chore: Update ConfigEvent doc + Add forgotten annotation

* chore: Remove final keyword

* fix: Remove rotation validation in Build#beginPlace

* Already covered by client snapshots

* fix: Remove useless imports
This commit is contained in:
Phinner
2023-05-11 01:03:08 +00:00
committed by GitHub
parent 51daa82a1b
commit 0919063ca3
3 changed files with 19 additions and 3 deletions

View File

@@ -77,10 +77,12 @@ public class Build{
//auto-rotate the block to the correct orientation and bail out
if(tile.team() == team && tile.block == result && tile.build != null && tile.block.quickRotate){
if(unit != null && unit.getControllerName() != null) tile.build.lastAccessed = unit.getControllerName();
int previous = tile.build.rotation;
tile.build.rotation = Mathf.mod(rotation, 4);
tile.build.updateProximity();
tile.build.noSleep();
Fx.rotateBlock.at(tile.build.x, tile.build.y, tile.build.block.size);
Events.fire(new BuildRotateEvent(tile.build, unit, previous));
return;
}