From db81e773f8de029f0beba2c22b89b813180d8d1f Mon Sep 17 00:00:00 2001 From: blockparole <48992448+blockparole@users.noreply.github.com> Date: Thu, 21 Nov 2019 19:27:56 +0100 Subject: [PATCH 1/5] add seppukus fastbow --- .../kami/module/modules/combat/FastBow.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java b/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java new file mode 100644 index 00000000..75bc59f3 --- /dev/null +++ b/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java @@ -0,0 +1,25 @@ +package me.zeroeightsix.kami.module.modules.combat; + +import me.zeroeightsix.kami.module.Module; +import net.minecraft.network.play.client.CPacketPlayerDigging; +import net.minecraft.network.play.client.CPacketPlayerTryUseItem; +import net.minecraft.util.math.BlockPos; + +/** + * Author Seth 4/30/2019 @ 4:27 AM. + *

+ * see github.com/seppukudevelopment/seppuku + */ +@Module.Info(name = "FastBow", description = "Fast Bow Release", category = Module.Category.COMBAT) +public class FastBow extends Module { + + @Override + public void onUpdate() { + if (mc.player.inventory.getCurrentItem().getItem() instanceof net.minecraft.item.ItemBow && + mc.player.isHandActive() && mc.player.getItemInUseMaxCount() >= 3) { + mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, mc.player.getHorizontalFacing())); + mc.player.connection.sendPacket(new CPacketPlayerTryUseItem(mc.player.getActiveHand())); + mc.player.stopActiveHand(); + } + } +} From 0cba9fb85a6d1cb338f04e282e116707eef24169 Mon Sep 17 00:00:00 2001 From: blockparole <48992448+blockparole@users.noreply.github.com> Date: Thu, 21 Nov 2019 20:08:14 +0100 Subject: [PATCH 2/5] IceSpeed --- .../module/modules/movement/IceSpeed.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/me/zeroeightsix/kami/module/modules/movement/IceSpeed.java diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/movement/IceSpeed.java b/src/main/java/me/zeroeightsix/kami/module/modules/movement/IceSpeed.java new file mode 100644 index 00000000..2cad1bd8 --- /dev/null +++ b/src/main/java/me/zeroeightsix/kami/module/modules/movement/IceSpeed.java @@ -0,0 +1,32 @@ +package me.zeroeightsix.kami.module.modules.movement; + +import me.zeroeightsix.kami.module.Module; +import me.zeroeightsix.kami.setting.Setting; +import me.zeroeightsix.kami.setting.Settings; +import net.minecraft.init.Blocks; + +/** + * Created on 26 October 2019 by hub + * Updated 21 November 2019 by hub + */ +@Module.Info(name = "IceSpeed", description = "Ice Speed", category = Module.Category.MOVEMENT) +public class IceSpeed extends Module { + + // Using double here cause float isnt cut off in the gui (example: 0.40000089485) + private Setting slipperiness = register(Settings.doubleBuilder("Slipperiness").withMinimum(0.2).withValue(0.4).withMaximum(1.0).build()); + + @Override + public void onUpdate() { + Blocks.ICE.slipperiness = slipperiness.getValue().floatValue(); + Blocks.PACKED_ICE.slipperiness = slipperiness.getValue().floatValue(); + Blocks.FROSTED_ICE.slipperiness = slipperiness.getValue().floatValue(); + } + + @Override + public void onDisable() { + Blocks.ICE.slipperiness = 0.98f; + Blocks.PACKED_ICE.slipperiness = 0.98f; + Blocks.FROSTED_ICE.slipperiness = 0.98f; + } + +} From 0195e0e507cf11c8b1f7eabeb029b3fc0fe9aa3b Mon Sep 17 00:00:00 2001 From: blockparole <48992448+blockparole@users.noreply.github.com> Date: Sun, 24 Nov 2019 16:47:41 +0100 Subject: [PATCH 3/5] change IceSpeed slipperiness setting to float --- .../kami/module/modules/movement/IceSpeed.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/movement/IceSpeed.java b/src/main/java/me/zeroeightsix/kami/module/modules/movement/IceSpeed.java index 2cad1bd8..ea40df76 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/movement/IceSpeed.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/movement/IceSpeed.java @@ -7,19 +7,18 @@ import net.minecraft.init.Blocks; /** * Created on 26 October 2019 by hub - * Updated 21 November 2019 by hub + * Updated 24 November 2019 by hub */ @Module.Info(name = "IceSpeed", description = "Ice Speed", category = Module.Category.MOVEMENT) public class IceSpeed extends Module { - // Using double here cause float isnt cut off in the gui (example: 0.40000089485) - private Setting slipperiness = register(Settings.doubleBuilder("Slipperiness").withMinimum(0.2).withValue(0.4).withMaximum(1.0).build()); + private Setting slipperiness = register(Settings.floatBuilder("Slipperiness").withMinimum(0.2f).withValue(0.4f).withMaximum(1.0f).build()); @Override public void onUpdate() { - Blocks.ICE.slipperiness = slipperiness.getValue().floatValue(); - Blocks.PACKED_ICE.slipperiness = slipperiness.getValue().floatValue(); - Blocks.FROSTED_ICE.slipperiness = slipperiness.getValue().floatValue(); + Blocks.ICE.slipperiness = slipperiness.getValue(); + Blocks.PACKED_ICE.slipperiness = slipperiness.getValue(); + Blocks.FROSTED_ICE.slipperiness = slipperiness.getValue(); } @Override From b9601736510caa90fc4b8cc57907355e8dded32e Mon Sep 17 00:00:00 2001 From: Ridan Vandenbergh Date: Sun, 24 Nov 2019 22:42:15 +0100 Subject: [PATCH 4/5] Fix unbound float settings decimal errors as well Closes #150 --- README.md | 2 +- .../kami/gui/kami/component/SettingsPanel.java | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0b682c5c..2c79b59a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## A minecraft utility mod for anarchy servers. -Development has slowed down considerably. KAMI will likely no longer be updated. Pull requests are still welcome. +Development has slowed down considerably. See [forgehax](https://github.com/fr1kin/forgehax) for a more polished equivalent. Some features in KAMI may be based on those of forgehax, as I sometimes used it as reference. diff --git a/src/main/java/me/zeroeightsix/kami/gui/kami/component/SettingsPanel.java b/src/main/java/me/zeroeightsix/kami/gui/kami/component/SettingsPanel.java index ac2005f8..09ebb7fe 100644 --- a/src/main/java/me/zeroeightsix/kami/gui/kami/component/SettingsPanel.java +++ b/src/main/java/me/zeroeightsix/kami/gui/kami/component/SettingsPanel.java @@ -63,15 +63,19 @@ public class SettingsPanel extends OrganisedContainer { NumberSetting numberSetting = (NumberSetting) setting; boolean isBound = numberSetting.isBound(); + // Terrible terrible bug fix. + // I know, these parseDoubles look awful, but any conversions I tried here would end up with weird floating point conversion errors. + // This is really the easiest solution.. + double value = Double.parseDouble(numberSetting.getValue().toString()); if (!isBound) { - UnboundSlider slider = new UnboundSlider(numberSetting.getValue().doubleValue(), name, setting instanceof IntegerSetting); + UnboundSlider slider = new UnboundSlider(value, name, setting instanceof IntegerSetting); slider.addPoof(new Slider.SliderPoof() { @Override public void execute(UnboundSlider component, SliderPoofInfo info) { if (setting instanceof IntegerSetting) - setting.setValue(new Integer((int) info.getNewValue())); + setting.setValue((int) info.getNewValue()); else if (setting instanceof FloatSetting) - setting.setValue(new Float(info.getNewValue())); + setting.setValue((float) info.getNewValue()); else if (setting instanceof DoubleSetting) setting.setValue(info.getNewValue()); setModule(module); @@ -81,10 +85,6 @@ public class SettingsPanel extends OrganisedContainer { if (numberSetting.getMin() != null) slider.setMin(numberSetting.getMin().doubleValue()); addChild(slider); } else { - // Terrible terrible bug fix. - // I know, these parseDoubles look awful, but any conversions I tried here would end up with weird floating point conversion errors. - // This is really the easiest solution.. - double value = Double.parseDouble(numberSetting.getValue().toString()); double min = Double.parseDouble(numberSetting.getMin().toString()); double max = Double.parseDouble(numberSetting.getMax().toString()); Slider slider = new Slider( From b6eb5065fdf0dc5283d5de6384507c7d5cc3c8dc Mon Sep 17 00:00:00 2001 From: Ridan Vandenbergh Date: Mon, 25 Nov 2019 22:34:58 +0100 Subject: [PATCH 5/5] Revert "added seppukus FastBow" --- .../kami/module/modules/combat/FastBow.java | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java b/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java deleted file mode 100644 index 75bc59f3..00000000 --- a/src/main/java/me/zeroeightsix/kami/module/modules/combat/FastBow.java +++ /dev/null @@ -1,25 +0,0 @@ -package me.zeroeightsix.kami.module.modules.combat; - -import me.zeroeightsix.kami.module.Module; -import net.minecraft.network.play.client.CPacketPlayerDigging; -import net.minecraft.network.play.client.CPacketPlayerTryUseItem; -import net.minecraft.util.math.BlockPos; - -/** - * Author Seth 4/30/2019 @ 4:27 AM. - *

- * see github.com/seppukudevelopment/seppuku - */ -@Module.Info(name = "FastBow", description = "Fast Bow Release", category = Module.Category.COMBAT) -public class FastBow extends Module { - - @Override - public void onUpdate() { - if (mc.player.inventory.getCurrentItem().getItem() instanceof net.minecraft.item.ItemBow && - mc.player.isHandActive() && mc.player.getItemInUseMaxCount() >= 3) { - mc.player.connection.sendPacket(new CPacketPlayerDigging(CPacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, mc.player.getHorizontalFacing())); - mc.player.connection.sendPacket(new CPacketPlayerTryUseItem(mc.player.getActiveHand())); - mc.player.stopActiveHand(); - } - } -}