forked from RepoMirrors/kami-blue
Merge branch 'master' into feature/aimbot
This commit is contained in:
commit
2462f92f90
|
@ -74,6 +74,7 @@ public class SetCommand extends Command {
|
|||
}
|
||||
setting.setValueFromString(arg2); /* PLEASE MAKE SURE TO USE PROPER NAMING WHEN USING ENUMS */ /* if you use improper lowercase letters it will *not* work with this command ~S-B99 */
|
||||
sendChatMessage("Set &b" + setting.getName() + "&r to &3" + arg2 + "&r.");
|
||||
Module.closeSettings();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
sendChatMessage("Unable to set value! &6" + e.getMessage());
|
||||
|
|
|
@ -5,6 +5,8 @@ import com.google.gson.JsonElement;
|
|||
import com.google.gson.JsonPrimitive;
|
||||
import me.zeroeightsix.kami.KamiMod;
|
||||
import me.zeroeightsix.kami.event.events.RenderEvent;
|
||||
import me.zeroeightsix.kami.gui.kami.component.SettingsPanel;
|
||||
import me.zeroeightsix.kami.gui.rgui.util.ContainerHelper;
|
||||
import me.zeroeightsix.kami.setting.Setting;
|
||||
import me.zeroeightsix.kami.setting.Settings;
|
||||
import me.zeroeightsix.kami.setting.builder.SettingBuilder;
|
||||
|
@ -19,7 +21,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* Created by 086 on 23/08/2017.
|
||||
* Updated by S-B99 on 15/12/19
|
||||
* Updated by S-B99 on 15/04/20
|
||||
*/
|
||||
public class Module {
|
||||
|
||||
|
@ -189,6 +191,16 @@ public class Module {
|
|||
public void destroy() {
|
||||
}
|
||||
|
||||
/* If you change a setting with ;set or eg a defaults button the GUI doesn't update, so call this */
|
||||
public static void closeSettings() {
|
||||
List<SettingsPanel> panels = ContainerHelper.getAllChildren(SettingsPanel.class, KamiMod.getInstance().getGuiManager());
|
||||
for (SettingsPanel settingsPanel : panels) {
|
||||
if (settingsPanel.isVisible()) {
|
||||
settingsPanel.setModule(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void registerAll(Setting... settings) {
|
||||
for (Setting setting : settings) {
|
||||
register(setting);
|
||||
|
|
|
@ -130,7 +130,7 @@ public class CrystalAura extends Module {
|
|||
|
||||
defaultSetting.setValue(false);
|
||||
sendChatMessage(getChatName() + "Set to defaults!");
|
||||
sendChatMessage(getChatName() + "Close and reopen the " + getName() + " settings menu to see changes");
|
||||
closeSettings();
|
||||
}
|
||||
|
||||
if (mc.player == null) {
|
||||
|
|
|
@ -108,6 +108,6 @@ public class AutoFish extends Module {
|
|||
variation.setValue(50);
|
||||
defaultSetting.setValue(false);
|
||||
sendChatMessage(getChatName() + "Set to defaults!");
|
||||
sendChatMessage(getChatName() + "Close and reopen the " + getName() + " settings menu to see changes");
|
||||
closeSettings();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ public class AutoNametag extends Module {
|
|||
|
||||
public void onUpdate() {
|
||||
useNameTag();
|
||||
findNameTags();
|
||||
}
|
||||
|
||||
private void useNameTag() {
|
||||
|
@ -85,5 +86,16 @@ public class AutoNametag extends Module {
|
|||
mc.player.inventory.currentItem = tagSlot;
|
||||
}
|
||||
|
||||
private void findNameTags() {
|
||||
for (int i = 0; i < 9; i++) {
|
||||
ItemStack stack = mc.player.inventory.getStackInSlot(i);
|
||||
if (stack == ItemStack.EMPTY || stack.getItem() instanceof ItemBlock) continue;
|
||||
Item tag = stack.getItem();
|
||||
if (tag instanceof ItemNameTag) {
|
||||
currentName = stack.getDisplayName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private enum Mode { WITHER, ANY }
|
||||
}
|
||||
|
|
|
@ -9,13 +9,13 @@ import me.zeroeightsix.kami.setting.Settings;
|
|||
import net.minecraft.network.play.client.CPacketEntityAction;
|
||||
import net.minecraft.network.play.client.CPacketPlayer;
|
||||
|
||||
import static me.zeroeightsix.kami.KamiMod.MODULE_MANAGER;
|
||||
import static me.zeroeightsix.kami.util.MessageSendHelper.sendChatMessage;
|
||||
import static net.minecraft.network.play.client.CPacketEntityAction.Action.START_SPRINTING;
|
||||
import static net.minecraft.network.play.client.CPacketEntityAction.Action.STOP_SPRINTING;
|
||||
|
||||
/**
|
||||
* Created by 086 on 8/04/2018.
|
||||
* Code tweaked by coderynx & OverFloyd.
|
||||
*
|
||||
* Movement taken from Seppuku
|
||||
* https://github.com/seppukudevelopment/seppuku/blob/005e2da/src/main/java/me/rigamortis/seppuku/impl/module/player/NoHungerModule.java
|
||||
*/
|
||||
|
@ -25,15 +25,15 @@ public class AntiHunger extends Module {
|
|||
|
||||
@EventHandler
|
||||
public Listener<PacketEvent.Send> packetListener = new Listener<>(event -> {
|
||||
if (MODULE_MANAGER.getModule(ElytraFlight.class).isEnabled()) {
|
||||
return;
|
||||
}
|
||||
if (event.getPacket() instanceof CPacketEntityAction) {
|
||||
final CPacketEntityAction packet = (CPacketEntityAction) event.getPacket();
|
||||
if (cancelMovementState.getValue() && (packet.getAction() == START_SPRINTING || packet.getAction() == STOP_SPRINTING)) {
|
||||
if (mc.player == null || mc.player.isElytraFlying()) return;
|
||||
|
||||
if (cancelMovementState.getValue() && event.getPacket() instanceof CPacketEntityAction) {
|
||||
CPacketEntityAction packet = (CPacketEntityAction) event.getPacket();
|
||||
if (packet.getAction() == START_SPRINTING || packet.getAction() == STOP_SPRINTING) {
|
||||
event.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
if (event.getPacket() instanceof CPacketPlayer) {
|
||||
((CPacketPlayer) event.getPacket()).onGround = mc.player.fallDistance > 0 || mc.playerController.isHittingBlock;
|
||||
}
|
||||
|
|
|
@ -28,14 +28,14 @@ public class ElytraFlight extends Module {
|
|||
private Setting<ElytraFlightMode> mode = register(Settings.e("Mode", ElytraFlightMode.HIGHWAY));
|
||||
private Setting<Boolean> defaultSetting = register(Settings.b("Defaults", false));
|
||||
private Setting<Boolean> easyTakeOff = register(Settings.booleanBuilder("Easy Takeoff H").withValue(true).withVisibility(v -> mode.getValue().equals(ElytraFlightMode.HIGHWAY)).build());
|
||||
private Setting<Boolean> hoverControl = register(Settings.booleanBuilder("Hover").withValue(false).withVisibility(v -> mode.getValue().equals(ElytraFlightMode.CONTROL)).build());
|
||||
private Setting<Boolean> hoverControl = register(Settings.booleanBuilder("Hover").withValue(true).withVisibility(v -> mode.getValue().equals(ElytraFlightMode.CONTROL)).build());
|
||||
private Setting<Boolean> easyTakeOffControl = register(Settings.booleanBuilder("Easy Takeoff C").withValue(false).withVisibility(v -> mode.getValue().equals(ElytraFlightMode.CONTROL)).build());
|
||||
private Setting<Boolean> timerControl = register(Settings.booleanBuilder("Takeoff Timer").withValue(false).withVisibility(v -> easyTakeOffControl.getValue() && mode.getValue().equals(ElytraFlightMode.CONTROL)).build());
|
||||
private Setting<TakeoffMode> takeOffMode = register(Settings.enumBuilder(TakeoffMode.class).withName("Takeoff Mode").withValue(TakeoffMode.PACKET).withVisibility(v -> easyTakeOff.getValue() && mode.getValue().equals(ElytraFlightMode.HIGHWAY)).build());
|
||||
private Setting<Boolean> overrideMaxSpeed = register(Settings.booleanBuilder("Over Max Speed").withValue(false).withVisibility(v -> mode.getValue().equals(ElytraFlightMode.HIGHWAY)).build());
|
||||
private Setting<Float> speedHighway = register(Settings.floatBuilder("Speed H").withValue(1.8f).withMaximum(1.8f).withVisibility(v -> !overrideMaxSpeed.getValue() && mode.getValue().equals(ElytraFlightMode.HIGHWAY)).build());
|
||||
private Setting<Float> speedControl = register(Settings.floatBuilder("Speed C").withValue(1.8f).withVisibility(v -> mode.getValue().equals(ElytraFlightMode.CONTROL)).build());
|
||||
private Setting<Float> speedHighwayOverride = register(Settings.floatBuilder("Speed H O").withValue(1.8f).withVisibility(v -> overrideMaxSpeed.getValue() && mode.getValue().equals(ElytraFlightMode.HIGHWAY)).build());
|
||||
private Setting<Float> speedControl = register(Settings.floatBuilder("Speed C").withValue(1.8f).withVisibility(v -> mode.getValue().equals(ElytraFlightMode.CONTROL)).build());
|
||||
private Setting<Float> fallSpeedHighway = register(Settings.floatBuilder("Fall Speed H").withValue(0.000050000002f).withVisibility(v -> mode.getValue().equals(ElytraFlightMode.HIGHWAY)).build());
|
||||
private Setting<Float> fallSpeedControl = register(Settings.floatBuilder("Fall Speed C").withValue(0.001f).withMaximum(0.3f).withMinimum(0.0f).withVisibility(v -> mode.getValue().equals(ElytraFlightMode.CONTROL)).build());
|
||||
private Setting<Float> fallSpeed = register(Settings.floatBuilder("Fall Speed").withValue(-.003f).withVisibility(v -> !mode.getValue().equals(ElytraFlightMode.CONTROL) && !mode.getValue().equals(ElytraFlightMode.HIGHWAY)).build());
|
||||
|
@ -256,17 +256,23 @@ public class ElytraFlight extends Module {
|
|||
|
||||
private void defaults() {
|
||||
easyTakeOff.setValue(true);
|
||||
hoverControl.setValue(true);
|
||||
easyTakeOffControl.setValue(false);
|
||||
timerControl.setValue(false);
|
||||
takeOffMode.setValue(TakeoffMode.PACKET);
|
||||
overrideMaxSpeed.setValue(false);
|
||||
speedHighway.setValue(1.8f);
|
||||
speedHighwayOverride.setValue(1.8f);
|
||||
speedControl.setValue(1.8f);
|
||||
fallSpeedHighway.setValue(.000050000002f);
|
||||
fallSpeedControl.setValue(0.001f);
|
||||
fallSpeed.setValue(-.003f);
|
||||
upSpeedBoost.setValue(0.08f);
|
||||
downSpeedBoost.setValue(0.04f);
|
||||
downSpeedControl.setValue(2.0);
|
||||
defaultSetting.setValue(false);
|
||||
sendChatMessage(getChatName() + "Set to defaults!");
|
||||
sendChatMessage(getChatName() + "Close and reopen the " + getName() + " settings menu to see changes");
|
||||
closeSettings();
|
||||
}
|
||||
|
||||
private float getHighwaySpeed() {
|
||||
|
|
Loading…
Reference in New Issue