diff --git a/res/command.rdcml b/res/command.rdcml index 2e9f1e4..a99a341 100644 --- a/res/command.rdcml +++ b/res/command.rdcml @@ -11,7 +11,7 @@ structure,struct { hook create user player } - build int<0,3>:rotation?(0) boolean:mirrored?(true) { + build int<0,3>:rotation?(0) boolean:mirrored?(false) { help Build the created structure at your location hook build user player diff --git a/res/plugin.yml b/res/plugin.yml index 98ed3fc..dcd9f5d 100755 --- a/res/plugin.yml +++ b/res/plugin.yml @@ -1,6 +1,6 @@ name: RedLib main: redempt.redlib.RedLib -version: 2022-09-16 05:12 +version: 2022-09-23 01:40 author: Redempt api-version: 1.13 load: STARTUP diff --git a/src/redempt/redlib/multiblock/Rotator.java b/src/redempt/redlib/multiblock/Rotator.java index 13e622f..a598498 100644 --- a/src/redempt/redlib/multiblock/Rotator.java +++ b/src/redempt/redlib/multiblock/Rotator.java @@ -129,12 +129,16 @@ private void rotate(T[] arr) { rot[i] = arr[i]; } for (int i = 0; i < 4; i++) { - int dir = (i + rotation) % 4; - if (mirrored && (i == 0 || i == 2)) { - dir = (dir + 2) % 4; - } + int dir = (i + 4 - rotation) % 4; arr[i] = (T) rot[dir]; } + if (mirrored) { + int first = rotation % 2 == 0 ? 1 : 0; + int second = rotation % 2 == 0 ? 3 : 2; + T tmp = arr[first]; + arr[first] = arr[second]; + arr[second] = tmp; + } } /**