Created
January 16, 2022 20:01
-
-
Save DavidRockin/c4fd6582f82983dce78a1ea834f39746 to your computer and use it in GitHub Desktop.
dave's sexy secet rotation branch magic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * KEK rotation bitwise magic go BBRRRRRRRRRRRRRRRRRRRRRRRRR | |
| * | |
| * (c) Dave T kek | |
| */ | |
| __BRANCH__.engine.worldManager.entityManager.entityInteraction.rotateTileEntity = (e, id, cw) => { | |
| let bits = (id >>> 29); | |
| bits = (bits + 1) % 0b111; | |
| id = ((bits << 29) | (id & 0x1FFF_FFFF)) >>> 0; | |
| console.log(bits, id.toString(16)); | |
| e.setTileId(id); | |
| return id; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment