Skip to content

Commit

Permalink
Fixes:
Browse files Browse the repository at this point in the history
Vector Operator *: Multiplying by a Matrix modifies the vector instead of copying it.
EntityNameplate:getBackgroundColor(): Returns a barg vector instead of an rgba vector.
  • Loading branch information
UnlikePaladin committed Sep 17, 2023
1 parent 6d9b152 commit b9ddd1e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public EntityNameplateCustomization scale(Object x, Double y, Double z) {
@LuaWhitelist
@LuaMethodDoc("nameplate_entity.get_background_color")
public FiguraVec4 getBackgroundColor() {
return this.background == null ? null : ColorUtils.intToARGB(this.background);
return this.background == null ? null : ColorUtils.intToRGBA(this.background);
}

@LuaWhitelist
Expand All @@ -141,7 +141,7 @@ public FiguraVec4 getBackgroundColor() {
)
public EntityNameplateCustomization setBackgroundColor(Object r, Double g, Double b, Double a) {
FiguraVec4 vec = LuaUtils.parseVec4("setBackgroundColor", r, g, b, a, 0, 0, 0, Minecraft.getInstance().options.getBackgroundOpacity(0.25f));
this.background = ColorUtils.rgbaToIntARGB(vec);
this.background = ColorUtils.rgbaToInt(vec);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ public static FiguraVec2 __mul(@LuaNotNil Object a, @LuaNotNil Object b) {
else if (b instanceof Number d)
return vec.scaled(d.doubleValue());
else if (b instanceof FiguraMat2 mat)
return vec.transform(mat);
return vec.copy().transform(mat);
} else if (a instanceof Number d && b instanceof FiguraVec2 vec) {
return (vec.scaled(d.doubleValue()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ public static FiguraVec3 __mul(@LuaNotNil Object a, @LuaNotNil Object b) {
else if (b instanceof Number d)
return vec.scaled(d.doubleValue());
else if (b instanceof FiguraMat3 mat)
return vec.transform(mat);
return vec.copy().transform(mat);
} else if (a instanceof Number d && b instanceof FiguraVec3 vec) {
return (vec.scaled(d.doubleValue()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ public static FiguraVec4 __mul(@LuaNotNil Object a, @LuaNotNil Object b) {
else if (b instanceof Number d)
return vec.scaled(d.doubleValue());
else if (b instanceof FiguraMat4 mat)
return vec.transform(mat);
return vec.copy().transform(mat);
} else if (a instanceof Number d && b instanceof FiguraVec4 vec) {
return (vec.scaled(d.doubleValue()));
}
Expand Down

0 comments on commit b9ddd1e

Please sign in to comment.