Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
improve tower
Browse files Browse the repository at this point in the history
improve itemRenderer
add none mode to Timer
  • Loading branch information
xia-mc committed Jul 18, 2024
1 parent 882ffd3 commit 7b8b29a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public void renderItemInFirstPerson(final float partialTicks, @NotNull CallbackI

ItemStack itemToRender = SlotHandler.getRenderHeldItem();
if (itemToRender != null) {
if (itemToRender != SlotHandler.getHeldItem())
animationProgression = 0.0F;

EnumAction enumaction = itemToRender.getItemUseAction();
final int itemInUseCount = thePlayer.getItemInUseCount();
boolean useItem = itemInUseCount > 0;
Expand Down
13 changes: 3 additions & 10 deletions src/main/java/keystrokesmod/module/impl/movement/Timer.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ public class Timer extends Module {

public Timer() {
super("Timer", Module.category.movement, 0);
this.registerSetting(mode = new ModeSetting("Mode", new String[]{"Normal", "Balance", "Hypixel"}, 0));
this.registerSetting(mode = new ModeSetting("Mode", new String[]{"Normal", "Balance", "Hypixel", "None"}, 0));
final ModeOnly mode1 = new ModeOnly(mode, 1);
this.registerSetting(speed = new SliderSetting("Speed", 1.00, 0.01, 10.0, 0.01, new ModeOnly(mode, 0, 1)));
this.registerSetting(speed = new SliderSetting("Speed", 1.00, 0.01, 10.0, 0.05, new ModeOnly(mode, 0, 1)));
this.registerSetting(slowTimer = new SliderSetting("Slow timer", 0, 0, 1, 0.01, "x", mode1));
this.registerSetting(maxBalance = new SliderSetting("Max balance", 1000, 0, 3000, 10, "ms", mode1));
this.registerSetting(costMultiplier = new SliderSetting("Cost multiplier", 1, 0.5, 5, 0.05, "x", mode1));
Expand Down Expand Up @@ -128,14 +128,7 @@ private void reset() {

@Override
public String getInfo() {
switch ((int) mode.getInput()) {
case 0:
return String.valueOf(speed.getInput());
case 1:
return String.valueOf(balance);
default:
return mode.getOptions()[(int) mode.getInput()];
}
return String.valueOf(Utils.getTimer().timerSpeed);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package keystrokesmod.module.impl.world.tower;

import keystrokesmod.Raven;
import keystrokesmod.event.PreMotionEvent;
import keystrokesmod.event.PreUpdateEvent;
import keystrokesmod.module.ModuleManager;
import keystrokesmod.module.impl.world.Tower;
import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SubMode;
import keystrokesmod.script.classes.Vec3;
import keystrokesmod.utility.MoveUtil;
Expand All @@ -18,6 +20,7 @@
import org.jetbrains.annotations.NotNull;

import java.util.Optional;
import java.util.concurrent.TimeUnit;

import static keystrokesmod.module.ModuleManager.tower;

Expand All @@ -40,8 +43,11 @@ public class HypixelBTower extends SubMode<Tower> {
private int offGroundTicks = 0;
private BlockPos deltaPlace = BlockPos.ORIGIN;

private final ButtonSetting onlyWhileMoving;

public HypixelBTower(String name, @NotNull Tower parent) {
super(name, parent);
this.registerSetting(onlyWhileMoving = new ButtonSetting("Only while moving", true));
}

@SubscribeEvent(priority = EventPriority.LOW)
Expand All @@ -62,20 +68,20 @@ public void onPreUpdate(PreUpdateEvent event) {
Triple<BlockPos, EnumFacing, Vec3> placeSide = optionalPlaceSide.get();


ModuleManager.scaffold.place(
Raven.getExecutor().schedule(() -> ModuleManager.scaffold.place(
new MovingObjectPosition(placeSide.getRight().toVec3(), placeSide.getMiddle(), placeSide.getLeft()),
false
);
), 50, TimeUnit.MILLISECONDS);
// ModuleManager.scaffold.tower$noBlockPlace = true;
blockPlaceRequest = false;
}
}

@SubscribeEvent
public void onPreMotion(PreMotionEvent event) {
if (!tower.canTower()) return;
if (onlyWhileMoving.isToggled() && !MoveUtil.isMoving()) return;

if (!Utils.jumpDown()) {
if (!tower.canTower()) {
this.Io = mc.thePlayer.rotationYaw;
this.er = 100;
} else {
Expand Down Expand Up @@ -171,6 +177,6 @@ public void onEnable() {

public void et() {
this.Iq = (int)Math.floor(mc.thePlayer.posY);
deltaPlace = new BlockPos(0, 0, 1);
deltaPlace = new BlockPos(0, 1, 1);
}
}

0 comments on commit 7b8b29a

Please sign in to comment.