Skip to content

Commit 0f1bce9

Browse files
committed
Fix array based call to transformation.
1 parent 0306de4 commit 0f1bce9

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

src/main/java/com/laytonsmith/abstraction/bukkit/entities/BukkitMCDisplay.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,14 @@ public void setTransformation(MCTransformation transformation) {
156156

157157
@Override
158158
public void setTransformationMatrix(float[] mtrxf) {
159+
// Note that the order of the matrix is flipped about the identity of the
160+
// matrix. This allows us to accept inputs that are the same order as the
161+
// /data command would accept.
159162
Matrix4f matrix = new Matrix4f(
160-
mtrxf[0], mtrxf[1], mtrxf[2], mtrxf[3],
161-
mtrxf[4], mtrxf[5], mtrxf[6], mtrxf[7],
162-
mtrxf[8], mtrxf[9], mtrxf[10], mtrxf[11],
163-
mtrxf[12], mtrxf[13], mtrxf[14], mtrxf[15]);
163+
mtrxf[0], mtrxf[4], mtrxf[8], mtrxf[12],
164+
mtrxf[1], mtrxf[5], mtrxf[9], mtrxf[13],
165+
mtrxf[2], mtrxf[6], mtrxf[10], mtrxf[14],
166+
mtrxf[3], mtrxf[7], mtrxf[11], mtrxf[15]);
164167
this.d.setTransformationMatrix(matrix);
165168
}
166169
}

src/main/java/com/laytonsmith/core/functions/EntityManagement.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5137,7 +5137,13 @@ public Integer[] numArgs() {
51375137
@Override
51385138
public String docs() {
51395139
return "void {entityUUID, array} Sets the data for a display entity."
5140-
+ " See {{function|get_display_entity}} for details about the array format.";
5140+
+ " See {{function|get_display_entity}} for details about the array format. ---- "
5141+
+ " Note that there is one additional point for setting the data that is unique to"
5142+
+ " the set function, the '''transformation''' property can be provided in the same"
5143+
+ " format as recieved (i.e. with the leftRotation, rightRotation, scale, and translation"
5144+
+ " properties) but you can also provide it as a length 16 array of floats. These are"
5145+
+ " accepted in the same order that the /data command would accept them. Regardless of"
5146+
+ " how they are input, the function will always return the complex object.";
51415147
}
51425148

51435149
@Override

0 commit comments

Comments
 (0)