This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
forked from Strangerrrs/Raven-bS
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add silent mode to norotate fix invmanager
- Loading branch information
Showing
6 changed files
with
62 additions
and
39 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,49 @@ | ||
package keystrokesmod.module.impl.fun; | ||
|
||
import keystrokesmod.event.RotationEvent; | ||
import keystrokesmod.module.Module; | ||
import keystrokesmod.module.setting.impl.DescriptionSetting; | ||
import keystrokesmod.module.setting.impl.ButtonSetting; | ||
import keystrokesmod.module.setting.impl.SliderSetting; | ||
import net.minecraft.client.entity.EntityPlayerSP; | ||
import net.minecraftforge.fml.common.eventhandler.EventPriority; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
|
||
public class Spin extends Module { | ||
public SliderSetting a; | ||
public SliderSetting b; | ||
private float yaw; | ||
|
||
public Spin() { | ||
super("Spin", category.fun, 0); | ||
this.registerSetting(a = new SliderSetting("Rotation", 360.0D, 30.0D, 360.0D, 1.0D)); | ||
this.registerSetting(b = new SliderSetting("Speed", 25.0D, 1.0D, 60.0D, 1.0D)); | ||
} | ||
private final SliderSetting speed = new SliderSetting("Speed", 30, 10, 45, 5); | ||
private final ButtonSetting constantPitch = new ButtonSetting("Constant pitch", true); | ||
private final SliderSetting pitch = new SliderSetting("Pitch", 90, -90, 90, 5, constantPitch::isToggled); | ||
|
||
public void onEnable() { | ||
this.yaw = mc.thePlayer.rotationYaw; | ||
} | ||
private Float lastYaw = null; | ||
private Float lastPitch = null; | ||
|
||
public Spin() { | ||
super("Spin", category.fun); | ||
this.registerSetting(speed, constantPitch, pitch); | ||
} | ||
|
||
public void onDisable() { | ||
this.yaw = 0.0F; | ||
@SubscribeEvent(priority = EventPriority.LOWEST) | ||
public void onRotation(@NotNull RotationEvent event) { | ||
if (lastYaw == null) { | ||
lastPitch = event.getPitch(); | ||
} | ||
event.setYaw(lastYaw = lastYaw + (float) speed.getInput()); | ||
|
||
public void onUpdate() { | ||
double left = (double) this.yaw + a.getInput() - (double) mc.thePlayer.rotationYaw; | ||
EntityPlayerSP var10000; | ||
if (left < b.getInput()) { | ||
var10000 = mc.thePlayer; | ||
var10000.rotationYaw = (float) ((double) var10000.rotationYaw + left); | ||
this.disable(); | ||
} else { | ||
var10000 = mc.thePlayer; | ||
var10000.rotationYaw = (float) ((double) var10000.rotationYaw + b.getInput()); | ||
if ((double) mc.thePlayer.rotationYaw >= (double) this.yaw + a.getInput()) { | ||
this.disable(); | ||
} | ||
} | ||
|
||
if (constantPitch.isToggled()) { | ||
event.setPitch((float) pitch.getInput()); | ||
} else { | ||
if (lastPitch == null) { | ||
lastPitch = event.getPitch(); | ||
} | ||
event.setPitch(lastPitch = lastPitch + (float) speed.getInput()); | ||
} | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
lastYaw = null; | ||
lastPitch = null; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters