autoremount improvements and inventorymove default speed

This commit is contained in:
Bella 2020-04-07 09:17:51 -04:00
parent 88e9f7725e
commit a0fafc510f
No known key found for this signature in database
GPG Key ID: DBD4A6030080C8B3
2 changed files with 29 additions and 7 deletions

View File

@ -4,21 +4,43 @@ import me.zeroeightsix.kami.module.Module;
import me.zeroeightsix.kami.setting.Setting;
import me.zeroeightsix.kami.setting.Settings;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.EntityDonkey;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.util.EnumHand;
/**
* @author S-B99
* Created by S-B99 on 05/04/20
* Updated by S-B99 on 07/04/20
*/
@Module.Info(name = "AutoRemount", description = "Automatically remounts your horse", category = Module.Category.MOVEMENT)
public class AutoRemount extends Module {
private Setting<Mode> modeSetting = register(Settings.e("Mode", Mode.HORSE));
private Setting<Float> range = register(Settings.floatBuilder("Range").withMinimum(1.0f).withValue(1.5f).withMaximum(10.0f).build());
private enum Mode { HORSE, DONKEY }
public void onUpdate() {
for (Entity e : mc.world.getLoadedEntityList()) {
if (e instanceof EntityHorse && !(mc.player.isRidingHorse())) {
final EntityHorse horse = (EntityHorse) e;
if (mc.player.getDistance(horse) <= range.getValue()) {
mc.playerController.interactWithEntity(mc.player, horse, EnumHand.MAIN_HAND);
switch (modeSetting.getValue()) {
case HORSE:
for (Entity e : mc.world.getLoadedEntityList()) {
if (e instanceof EntityHorse && !(mc.player.isRidingHorse())) {
final EntityHorse horse = (EntityHorse) e;
if (mc.player.getDistance(horse) <= range.getValue()) {
mc.playerController.interactWithEntity(mc.player, horse, EnumHand.MAIN_HAND);
}
}
}
case DONKEY:
for (Entity e : mc.world.getLoadedEntityList()) {
if (e instanceof EntityDonkey && !(mc.player.isRidingHorse())) {
final EntityDonkey donkey = (EntityDonkey) e;
if (mc.player.getDistance(donkey) <= range.getValue()) {
mc.playerController.interactWithEntity(mc.player, donkey, EnumHand.MAIN_HAND);
}
}
}
}
}
}
}

View File

@ -13,7 +13,7 @@ import org.lwjgl.input.Keyboard;
*/
@Module.Info(name = "InventoryMove", description = "Allows you to walk around with GUIs opened", category = Module.Category.MOVEMENT)
public class InventoryMove extends Module {
private Setting<Integer> speed = register(Settings.i("Look speed", 20));
private Setting<Integer> speed = register(Settings.i("Look speed", 10));
public void onUpdate() {
if (mc.player == null || mc.currentScreen == null || mc.currentScreen instanceof GuiChat) return;
if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) {