Skip to content

Commit

Permalink
more automountain options :D
Browse files Browse the repository at this point in the history
  • Loading branch information
etianl authored Dec 1, 2022
1 parent 4a5fcb8 commit e5f2920
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 5 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ It can also retrieve arrows and items from a distance if you shoot in that direc
- **Voider:** Replaces the world from the top down (Credits to Allah-Hack) I only added options to set max and minimum height for voiding, and instead of just air it can do water and lava now too.

## Known Bugs:
- **Do Not Use These Blocks With AutoMountain**(especially with the SwapStackonRunOut option)**:**
- Walls and Fences
- Falling Blocks (Sand, Gravel, Anvils, etc.)
- Doors
- Flowers
- Torches
- Anything that requires support from a block beneath
- There may be more
- **Other:**
- Turning direction using the back key and mouse with the AutoStaircaseDown module causes double block placement. It's fine though for lava flow, just wastes blocks. Block wastage can be avoided by just disabling the module, turning, then re-enabling.
- The antikick with AutoStaircaseFly does not always work when enabling the module while falling.
- TPFly can hurt you once in a while on disable. I tried to prevent this. You also rubberband if going toward a block because it attempts to teleport you through it.
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yarn_mappings=1.19.2+build.9
loader_version=0.14.9

# Mod Properties
mod_version=0.2.4
mod_version=0.2.5
maven_group=pwn.noobs
archives_base_name=trouser-streak

Expand Down
50 changes: 46 additions & 4 deletions src/main/java/pwn/noobs/trouserstreak/modules/AutoMountain.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,23 @@ public enum CenterMode {
);

private final Setting<Integer> limit = sgGeneral.add(new IntSetting.Builder()
.name("Build Limit")
.description("sets the Y level at which the stairs stop")
.name("UpwardBuildLimit")
.description("sets the Y level at which the stairs stop going up")
.sliderRange(-64, 318)
.defaultValue(318)
.build());

public final Setting<Boolean> InvertDir = sgGeneral.add(new BoolSetting.Builder()
.name("InvertDir@Limit")
.description("Inverts Direction from up to down, 1 block before you reach your set limit.")
.defaultValue(false)
.build()
);
public final Setting<Boolean> swap = sgGeneral.add(new BoolSetting.Builder()
.name("SwapStackonRunOut")
.description("Swaps to another stack of blocks in your hotbar when you run out")
.defaultValue(false)
.build()
);

private boolean resetTimer;

Expand Down Expand Up @@ -321,6 +332,34 @@ private void onKeyEvent(KeyEvent event) {

@EventHandler
private void onPreTick(TickEvent.Pre event) {
if (swap.get()){
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)){
mc.player.getInventory().selectedSlot = 0;
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)){
mc.player.getInventory().selectedSlot = 1;
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)){
mc.player.getInventory().selectedSlot = 2;
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)){
mc.player.getInventory().selectedSlot = 3;
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)){
mc.player.getInventory().selectedSlot = 4;
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)){
mc.player.getInventory().selectedSlot = 5;
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)){
mc.player.getInventory().selectedSlot = 6;
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)){
mc.player.getInventory().selectedSlot = 7;
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)){
mc.player.getInventory().selectedSlot = 8;
}
}
}
}
}
}
}
}
}}
mc.player.setVelocity(0,0,0);
if (mc.options.useKey.isPressed()){
Modules.get().get(AutoMountain.class).toggle();
Expand Down Expand Up @@ -435,7 +474,10 @@ else if (mc.player.getY() <= limit.get() && delayLeft <= 0 && offLeft > 0) {
if (mc.options.jumpKey.isPressed()){
mc.player.setPosition(mc.player.getX(),mc.player.getY()+spcoffset.get(),mc.player.getZ());
}
} else if (mc.player.getY() >= limit.get() || delayLeft <= 0 && offLeft <= 0) {
if (mc.player.getY() >= limit.get()-1 && InvertDir.get()){
mc.player.setPitch(75);
}
} else if (mc.player.getY() >= limit.get() && !InvertDir.get()|| delayLeft <= 0 && offLeft <= 0) {
delayLeft = delay.get();
offLeft = offTime.get();
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)) return;
Expand Down

0 comments on commit e5f2920

Please sign in to comment.