diff --git a/common/src/main/java/com/mrbysco/armorposer/client/gui/ArmorStandScreen.java b/common/src/main/java/com/mrbysco/armorposer/client/gui/ArmorStandScreen.java index 25acd58..68e7f1c 100644 --- a/common/src/main/java/com/mrbysco/armorposer/client/gui/ArmorStandScreen.java +++ b/common/src/main/java/com/mrbysco/armorposer/client/gui/ArmorStandScreen.java @@ -33,6 +33,8 @@ import net.minecraft.world.entity.decoration.ArmorStand; import net.minecraft.world.phys.Vec3; +import java.util.Locale; + public class ArmorStandScreen extends Screen { private static final WidgetSprites MIRROR_POSE_SPRITES = new WidgetSprites( ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "widget/mirror_pose"), ResourceLocation.fromNamespaceAndPath(Reference.MOD_ID, "widget/mirror_pose_highlighted") @@ -641,7 +643,7 @@ public boolean mouseScrolled(double mouseX, double mouseY, double xScroll, doubl if (allowScrolling && yScroll > 0) { //Add 1 to the value if (rotationTextField.canConsumeInput()) { - float nextValue = (rotationTextField.getFloat() + multiplier * rotationTextField.scrollMultiplier) % rotationTextField.modValue; + int nextValue = (int) (rotationTextField.getFloat() + (1 * multiplier)); rotationTextField.setValue(String.valueOf(nextValue)); rotationTextField.setCursorPosition(0); rotationTextField.setHighlightPos(0); @@ -670,7 +672,7 @@ public boolean mouseScrolled(double mouseX, double mouseY, double xScroll, doubl } else if (allowScrolling && yScroll < 0) { //Remove 1 to the value if (rotationTextField.canConsumeInput()) { - float previousValue = (rotationTextField.getFloat() - multiplier * rotationTextField.scrollMultiplier) % rotationTextField.modValue; + int previousValue = (int) (rotationTextField.getFloat() - (1 * multiplier)); rotationTextField.setValue(String.valueOf(previousValue)); rotationTextField.setCursorPosition(0); rotationTextField.setHighlightPos(0); @@ -798,12 +800,12 @@ protected CompoundTag writeFieldsToNBT() { poseTag.put("RightArm", poseRightArmTag); - var offsetX = this.poseTextFields[18].getFloat(); - var offsetY = this.poseTextFields[19].getFloat(); - var offsetZ = this.poseTextFields[20].getFloat(); - var offsetXDiff = offsetX - this.lastSendOffset.x; - var offsetYDiff = offsetY - this.lastSendOffset.y; - var offsetZDiff = offsetZ - this.lastSendOffset.z; + float offsetX = this.poseTextFields[18].getFloat(); + float offsetY = this.poseTextFields[19].getFloat(); + float offsetZ = this.poseTextFields[20].getFloat(); + double offsetXDiff = offsetX - this.lastSendOffset.x; + double offsetYDiff = offsetY - this.lastSendOffset.y; + double offsetZDiff = offsetZ - this.lastSendOffset.z; ListTag positionOffset = new ListTag(); positionOffset.add(DoubleTag.valueOf(offsetXDiff)); positionOffset.add(DoubleTag.valueOf(offsetYDiff));