Skip to content

Commit

Permalink
Macros:
Browse files Browse the repository at this point in the history
 = Possible fix for not properly rotating after some features
  • Loading branch information
May2Beez committed Apr 27, 2024
1 parent 1c32c00 commit 686a534
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ baseGroup=com.jelly.farmhelperv2
mcVersion=1.8.9
modid=farmhelperv2
modName=FarmHelper
version=2.6.7
version=2.6.8
shouldRelease=true
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public class SShapeCocoaBeanMacro extends AbstractMacro {
@Override
public void onEnable() {
super.onEnable();
if (!FarmHelperConfig.customPitch && !isRestoredState() && !isPitchSet()) {
if (!isPitchSet()) {
setPitch(-70f + (float) (Math.random() * 0.6));
}
if (!FarmHelperConfig.customYaw && !isRestoredState() && !isYawSet()) {
if (!isYawSet()) {
setYaw(AngleUtils.getClosest());
setClosest90Deg(Optional.of(AngleUtils.getClosest(getYaw())));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ public class SShapeMelonPumpkinDefaultMacro extends AbstractMacro {
@Override
public void onEnable() {
super.onEnable();
if (!FarmHelperConfig.customPitch && !isRestoredState() && !isPitchSet())
if (!isPitchSet())
setPitch(50 + (float) (Math.random() * 6 - 3)); // -3 - 3
if (!FarmHelperConfig.customYaw && !isRestoredState() && !isYawSet()) {
if (!isYawSet()) {
setYaw(AngleUtils.getClosestDiagonal());
setClosest90Deg(Optional.of(AngleUtils.getClosest(getYaw())));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public class SShapeMushroomMacro extends AbstractMacro {
@Override
public void onEnable() {
super.onEnable();
if (!FarmHelperConfig.customPitch && !isRestoredState() && !isPitchSet()) {
if (!isPitchSet()) {
setPitch((float) (Math.random() * 2 - 1)); // -1 - 1
}
if (!FarmHelperConfig.customYaw && !isRestoredState() && !isYawSet()) {
if (!isYawSet()) {
setYaw(AngleUtils.getClosestDiagonal());
setClosest90Deg(Optional.of(AngleUtils.getClosest()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public class SShapeMushroomRotateMacro extends AbstractMacro {
@Override
public void onEnable() {
super.onEnable();
if (!FarmHelperConfig.customPitch && !isRestoredState() && !isPitchSet()) {
if (!isPitchSet()) {
setPitch((float) (Math.random() * 2 - 1)); // -1 - 1
}
if (!FarmHelperConfig.customYaw && !isRestoredState() && !isYawSet()) {
if (!isYawSet()) {
setYaw(AngleUtils.getClosest());
setClosest90Deg(Optional.of(AngleUtils.getClosest(AngleUtils.get360RotationYaw())));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public class SShapeMushroomSDSMacro extends AbstractMacro {
public void onEnable() {
super.onEnable();

if (!FarmHelperConfig.customPitch && !isRestoredState() && !isPitchSet()) {
if (!isPitchSet()) {
setPitch((float) (6.5f + Math.random() * 1f)); // 6.5 - 7.5
}

if (!FarmHelperConfig.customYaw && !isRestoredState() && !isYawSet()) {
if (!isYawSet()) {
setYaw(AngleUtils.getClosest());
setClosest90Deg(Optional.of(AngleUtils.getClosest(getYaw())));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ public void actionAfterTeleport() {
@Override
public void onEnable() {
super.onEnable();
if (!FarmHelperConfig.customPitch && !isRestoredState() && !isPitchSet()) {
if (!isPitchSet()) {
setPitch((float) (Math.random() * 1) - 0.5f); // -0.5 to 0.5
}
if (!FarmHelperConfig.customYaw && !isRestoredState() && !isYawSet()) {
if (!isYawSet()) {
setYaw(AngleUtils.getClosestDiagonal());
setClosest90Deg(Optional.of(AngleUtils.getClosest(getYaw())));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public void invokeState() {
public void onEnable() {
super.onEnable();
changeLaneDirection = null;
if (!FarmHelperConfig.customPitch && !isRestoredState() && !isPitchSet()) {
if (!isPitchSet()) {
if (FarmHelperConfig.getMacro() == FarmHelperConfig.MacroEnum.S_V_NORMAL_TYPE) {
setPitch((float) (2.8f + Math.random() * 0.5f));
} else if (FarmHelperConfig.getMacro() == FarmHelperConfig.MacroEnum.S_PUMPKIN_MELON) {
Expand All @@ -228,7 +228,7 @@ public void onEnable() {
setPitch(-90f);
}
}
if (!FarmHelperConfig.customYaw && !isRestoredState() && !isYawSet()) {
if (!isYawSet()) {
setYaw(AngleUtils.getClosest());
setClosest90Deg(Optional.of(AngleUtils.getClosest(getYaw())));
}
Expand Down

0 comments on commit 686a534

Please sign in to comment.