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

@@ -464,10 +464,12 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
}
if(player != null) build.lastAccessed = player.name;
int previous = build.rotation;
build.rotation = Mathf.mod(build.rotation + Mathf.sign(direction), 4);
build.updateProximity();
build.noSleep();
Fx.rotateBlock.at(build.x, build.y, build.block.size);
Events.fire(new BuildRotateEvent(build, player.unit(), previous));
}
@Remote(targets = Loc.both, called = Loc.both, forward = true)