-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from Xatsec/master
- Loading branch information
Showing
4 changed files
with
193 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package net.aoba.module.modules.misc; | ||
|
||
import net.aoba.Aoba; | ||
import net.aoba.event.events.TickEvent; | ||
import net.aoba.event.listeners.TickListener; | ||
import net.aoba.module.Module; | ||
import net.aoba.settings.types.FloatSetting; | ||
import net.aoba.settings.types.KeybindSetting; | ||
import net.minecraft.client.util.InputUtil; | ||
import org.lwjgl.glfw.GLFW; | ||
|
||
public class AntiKick extends Module implements TickListener { | ||
|
||
//Experimental | ||
|
||
private FloatSetting ticks; | ||
private FloatSetting duration; | ||
|
||
public int i = 0; | ||
|
||
public AntiKick() { | ||
super(new KeybindSetting("key.antikick", "AntiKick Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); | ||
|
||
this.setName("AntiKick"); | ||
this.setCategory(Category.Misc); | ||
this.setDescription("Avoids being kicked for 'Flying is not enabled on this Server'"); | ||
|
||
ticks = new FloatSetting("ticks", "Ticks", "Amount of Ticks between Execution", 40f, 10f, 50f, 10f); | ||
duration = new FloatSetting("duration", "Duration", "Duration in Ticks", 1f, 1f, 5f, 1f); | ||
|
||
this.addSetting(ticks); | ||
this.addSetting(duration); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onEnable() { | ||
Aoba.getInstance().eventManager.AddListener(TickListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onToggle() { | ||
|
||
} | ||
|
||
@Override | ||
public void OnUpdate(TickEvent event) { | ||
//Basically deactivates and reactivates the Flymodule in the set Period of ticks to avoid being Kicked for "Flying is not enabled on this Server" | ||
//For now, vertical Movement still can get you kicked if you are not carefull | ||
if(i == ticks.getValue() && Aoba.getInstance().moduleManager.fly.getState()) { | ||
Aoba.getInstance().moduleManager.fly.toggle(); | ||
} | ||
if(i == ticks.getValue() + duration.getValue() && !Aoba.getInstance().moduleManager.fly.getState()) { | ||
Aoba.getInstance().moduleManager.fly.toggle(); | ||
i = 0; | ||
} | ||
i ++; | ||
|
||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
src/main/java/net/aoba/module/modules/movement/FastLadder.java
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package net.aoba.module.modules.movement; | ||
|
||
import net.aoba.Aoba; | ||
import net.aoba.event.events.TickEvent; | ||
import net.aoba.event.listeners.TickListener; | ||
import net.aoba.module.Module; | ||
import net.aoba.settings.types.FloatSetting; | ||
import net.aoba.settings.types.KeybindSetting; | ||
import net.minecraft.client.network.ClientPlayerEntity; | ||
import net.minecraft.client.util.InputUtil; | ||
import net.minecraft.util.math.Vec3d; | ||
import org.lwjgl.glfw.GLFW; | ||
|
||
public class FastLadder extends Module implements TickListener { | ||
|
||
private FloatSetting ladderSpeed; | ||
|
||
public FastLadder() { | ||
super(new KeybindSetting("key.fastladder", "FastLadder Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); | ||
|
||
this.setName("FastLadder"); | ||
this.setCategory(Category.Movement); | ||
this.setDescription("Allows players to climb up Ladders faster"); | ||
|
||
ladderSpeed = new FloatSetting("fastladder_speed", "Speed", "Speed for FastLadder Module", 0.2f, 0.1f, 0.5f, 0.1f); | ||
this.addSetting(ladderSpeed); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onEnable() { | ||
Aoba.getInstance().eventManager.AddListener(TickListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onToggle() { | ||
|
||
} | ||
|
||
@Override | ||
public void OnUpdate(TickEvent event) { | ||
ClientPlayerEntity player = MC.player; | ||
|
||
if(!player.isClimbing() || !player.horizontalCollision) | ||
return; | ||
|
||
if(player.input.movementForward == 0 | ||
&& player.input.movementSideways == 0) | ||
return; | ||
|
||
Vec3d velocity = player.getVelocity(); | ||
player.setVelocity(velocity.x, ladderSpeed.getValue() + 0.08, velocity.z); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package net.aoba.module.modules.movement; | ||
|
||
import net.aoba.Aoba; | ||
import net.aoba.event.events.TickEvent; | ||
import net.aoba.event.listeners.TickListener; | ||
import net.aoba.module.Module; | ||
import net.aoba.settings.types.FloatSetting; | ||
import net.aoba.settings.types.KeybindSetting; | ||
import net.minecraft.client.util.InputUtil; | ||
import net.minecraft.entity.attribute.EntityAttributeInstance; | ||
import net.minecraft.entity.attribute.EntityAttributes; | ||
import org.lwjgl.glfw.GLFW; | ||
|
||
public class Speed extends Module implements TickListener { | ||
|
||
private FloatSetting speedSetting; | ||
|
||
public Speed() { | ||
super(new KeybindSetting("key.speed", "Speed Key", InputUtil.fromKeyCode(GLFW.GLFW_KEY_UNKNOWN, 0))); | ||
|
||
this.setName("Speed"); | ||
this.setCategory(Category.Movement); | ||
this.setDescription("Modifies the Movement-Speed of the Player"); | ||
|
||
speedSetting = new FloatSetting("speed_setting", "Speed", "Speed", 0.2f, 0.1f, 6f, 0.1f); | ||
|
||
speedSetting.setOnUpdate((i) -> { | ||
if(this.getState()) { | ||
EntityAttributeInstance attribute = MC.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED); | ||
attribute.setBaseValue(speedSetting.getValue()); | ||
} | ||
}); | ||
|
||
this.addSetting(speedSetting); | ||
} | ||
|
||
@Override | ||
public void onDisable() { | ||
MC.options.getFovEffectScale().setValue(100.0); | ||
if(MC.player != null) { | ||
EntityAttributeInstance attribute = MC.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED); | ||
attribute.setBaseValue(0.1); | ||
} | ||
Aoba.getInstance().eventManager.RemoveListener(TickListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onEnable() { | ||
MC.options.getFovEffectScale().setValue(0.0); | ||
EntityAttributeInstance attribute = MC.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED); | ||
attribute.setBaseValue(speedSetting.getValue()); | ||
Aoba.getInstance().eventManager.AddListener(TickListener.class, this); | ||
} | ||
|
||
@Override | ||
public void onToggle() { | ||
|
||
} | ||
|
||
@Override | ||
public void OnUpdate(TickEvent event) { | ||
EntityAttributeInstance attribute = MC.player.getAttributeInstance(EntityAttributes.GENERIC_MOVEMENT_SPEED); | ||
attribute.setBaseValue(speedSetting.getValue()); | ||
} | ||
} |