Skip to content

Commit

Permalink
options for bowmod+bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
etianl authored Nov 15, 2022
1 parent e7d2a17 commit ec00b2b
Show file tree
Hide file tree
Showing 10 changed files with 311 additions and 16 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
- **FireballRain+:** Rains whatever entities you desire from a list similar to Boom (Credits to Allah-Hack.) I did pull the code from GriefWaffen, the name was from there. It used to only rain fireballs, but I didn't think that was fun enough so I added the things put in Boom.
- **HandOfGod:** Deletes the world around you as you fly, and as you click. It deletes when you press the directional keys, or when you click it fills with the specified block. Operator status required.
- **Inventory Dupe (1.17):** Duplicates things in your crafting slots when the module is enabled and the Dupe button is pressed in your inventory. (Credit to ItsVen and Da0neDatGotAway for original creation of the dupe, and to B2H990 for making the fabric mod.)
- **InstaKillBow** Shoots arrows with incredible power and velocity. Credits to Saturn5Vfive. DISABLE ANTIHUNGER
- **InstaKillBow** Shoots arrows with incredible power and velocity. Credits to Saturn5Vfive. Disable extra "MovePacket" buttons in the inventory to choose how many to send. I couldn't change the default from them all being enabled and they all add up.
- **Phase:** Allows you to phase through blocks vertically, and through thin blocks horizontally such as doors and world border (Credits to Meteor-Rejects) Please add this back it's not too terrible.
- **RedstoneNuker:** It's just the regular Nuker module from Meteor client, customized for only breaking things that generate redstone signals. Also with included AutoTool. To keep you safer when placing lots of TNT.
- **ShulkerDupe:** Duplicates the contents of a shulker when opening. Only works on Vanilla, Forge, and Fabric servers 1.19 and below. Use multiconnect or viafabric (Credits to Allah-Hack)
- **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:
- 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.
- The antikick with AutoStaircaseFly does not always work when enabling the module while falling.
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.1.8
mod_version=0.1.9
maven_group=pwn.noobs
archives_base_name=trouser-streak

Expand Down
1 change: 1 addition & 0 deletions src/main/java/pwn/noobs/trouserstreak/Trouser.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public void onInitialize() {
Modules.get().add(new AutoStaircaseDown());
Modules.get().add(new AutoStaircaseFly());
Modules.get().add(new InstantKill());
Modules.get().add(new TrouserFlight());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package pwn.noobs.trouserstreak.mixin;

import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.movement.Flight;
import meteordevelopment.meteorclient.systems.modules.player.AntiHunger;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -15,9 +17,13 @@
@Mixin(ClientPlayerInteractionManager.class)
public class ClientPlayerInteractionManagerMixin {
@Inject(at = @At("HEAD"), method = "stopUsingItem")
private void onStopUsingItem(PlayerEntity player, CallbackInfo ci){
public void onStopUsingItem(PlayerEntity player, CallbackInfo ci){
if ((Modules.get().get(InstantKill.class).isActive())){}
if(Modules.get().isActive(InstantKill.class)){
if(player.getInventory().getMainHandStack().getItem().equals(Items.BOW)){
if (Modules.get().get(AntiHunger.class).isActive()) {
Modules.get().get(AntiHunger.class).toggle();
}
InstantKill.addVelocityToPlayer();
}}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,39 @@ protected InventoryScreenMixinBow(Text title){
@Inject(method = "init", at = @At("HEAD"))
public void onInit(CallbackInfo ci){
if(Modules.get().isActive(InstantKill.class)) {
ButtonWidget toggle = new ButtonWidget(1, 1, 100, 20, Text.of("InstantKill: " + (InstantKill.shouldAddVelocity ? "On" : "Off")), b -> {
ButtonWidget toggle = new ButtonWidget(1, 1, 90, 12, Text.of("MovePackets: " + (InstantKill.shouldAddVelocity0 ? "50" : "OFF")), b -> {
InstantKill.shouldAddVelocity0 = !InstantKill.shouldAddVelocity0;
InstantKill.mc.setScreen(new InventoryScreen(InstantKill.mc.player));
});
this.addDrawableChild(toggle);
}
if(Modules.get().isActive(InstantKill.class)) {
ButtonWidget toggle = new ButtonWidget(1, 13, 90, 12, Text.of("MovePackets: " + (InstantKill.shouldAddVelocity ? "100" : "OFF")), b -> {
InstantKill.shouldAddVelocity = !InstantKill.shouldAddVelocity;
InstantKill.mc.setScreen(new InventoryScreen(InstantKill.mc.player));
});
this.addDrawableChild(toggle);
}}

@Inject(method = "render", at = @At("HEAD"))
public void onRender(MatrixStack matrices, int a, int b, float d, CallbackInfo ci){
}
if(Modules.get().isActive(InstantKill.class)) {
ButtonWidget toggle = new ButtonWidget(1, 25, 90, 12, Text.of("MovePackets: " + (InstantKill.shouldAddVelocity1 ? "150" : "OFF")), b -> {
InstantKill.shouldAddVelocity1 = !InstantKill.shouldAddVelocity1;
InstantKill.mc.setScreen(new InventoryScreen(InstantKill.mc.player));
});
this.addDrawableChild(toggle);
}
if(Modules.get().isActive(InstantKill.class)) {
int pp = this.textRenderer.getWidth("Made by Saturn5Vfive <3") / 2;
drawCenteredText(matrices, textRenderer, Text.of("Made by Saturn5Vfive <3"), pp + 5, InstantKill.mc.getWindow().getScaledHeight() - 10, new Color(255, 255, 255, 255).getRGB());
}}
ButtonWidget toggle = new ButtonWidget(1, 37, 90, 12, Text.of("MovePackets: " + (InstantKill.shouldAddVelocity2 ? "200" : "OFF")), b -> {
InstantKill.shouldAddVelocity2 = !InstantKill.shouldAddVelocity2;
InstantKill.mc.setScreen(new InventoryScreen(InstantKill.mc.player));
});
this.addDrawableChild(toggle);
}
if(Modules.get().isActive(InstantKill.class)) {
ButtonWidget toggle = new ButtonWidget(1, 49, 90, 12, Text.of("MovePackets: " + (InstantKill.shouldAddVelocity3 ? "300" : "OFF")), b -> {
InstantKill.shouldAddVelocity3 = !InstantKill.shouldAddVelocity3;
InstantKill.mc.setScreen(new InventoryScreen(InstantKill.mc.player));
});
this.addDrawableChild(toggle);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ public void onActivate() {
if (!airPlace.getDefaultValue()) mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(pos.down()), Direction.DOWN, pos, false));
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(pos), Direction.DOWN, pos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
if (Modules.get().get(TrouserFlight.class).isActive()) {
Modules.get().get(TrouserFlight.class).toggle();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ public void onActivate() {
}

dir = BPlayerUtils.direction(mc.gameRenderer.getCamera().getYaw());
if (Modules.get().get(TrouserFlight.class).isActive()) {
Modules.get().get(TrouserFlight.class).toggle();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public WWidget getWidget(GuiTheme theme) {
@Override
public void onActivate() {
resetTimer = false;
mc.player.setNoGravity(true);
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)) return;
ticksPassed = 0;
blocksPlaced = 0;

Expand All @@ -248,17 +248,17 @@ public void onActivate() {
if (centerMode.get() == CenterMode.Snap) BWorldUtils.snapPlayer(playerPos);
else PlayerUtils.centerPlayer();
}
mc.player.setNoGravity(true);
mc.options.jumpKey.setPressed(true);
if (!(mc.player.getInventory().getMainHandStack().getItem() instanceof BlockItem)) return;
BlockPos pos = playerPos.add(new Vec3i(0,-1,0));
if (mc.world.getBlockState(pos).getMaterial().isReplaceable()) {
if (!airPlace.getDefaultValue()) mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(pos.down()), Direction.DOWN, pos, false));
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(pos), Direction.DOWN, pos, false));
mc.player.swingHand(Hand.MAIN_HAND);}

dir = BPlayerUtils.direction(mc.gameRenderer.getCamera().getYaw());
if (Modules.get().get(Flight.class).isActive()) {
Modules.get().get(Flight.class).toggle();
if (Modules.get().get(TrouserFlight.class).isActive()) {
Modules.get().get(TrouserFlight.class).toggle();
}
mc.player.setNoGravity(false);
}
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/pwn/noobs/trouserstreak/modules/InstantKill.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ public class InstantKill extends Module {
public static final MinecraftClient mc = MinecraftClient.getInstance();

public static boolean shouldAddVelocity = true;
public static boolean shouldAddVelocity1 = true;
public static boolean shouldAddVelocity2 = true;
public static boolean shouldAddVelocity3 = true;
public static boolean shouldAddVelocity0 = true;
public InstantKill() {
super(Trouser.Main, "InstaKillBow", "Enable/Disable instakill");
}
Expand All @@ -29,11 +33,39 @@ public void onInitialize() {
//I dont completely know where it originated, but I'm pretty sure it's 2b2t.
public static void addVelocityToPlayer(){
if(shouldAddVelocity){
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
for (int i = 0; i < 100; i++) {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() - 0.000000001, mc.player.getZ(), true));
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() + 0.000000001, mc.player.getZ(), false));
}
}
if(shouldAddVelocity1){
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
for (int i = 0; i < 150; i++) {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() - 0.000000001, mc.player.getZ(), true));
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() + 0.000000001, mc.player.getZ(), false));
}
}
if(shouldAddVelocity2){
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
for (int i = 0; i < 200; i++) {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() - 0.000000001, mc.player.getZ(), true));
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() + 0.000000001, mc.player.getZ(), false));
}
}
if(shouldAddVelocity3){
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
for (int i = 0; i < 300; i++) {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() - 0.000000001, mc.player.getZ(), true));
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() + 0.000000001, mc.player.getZ(), false));
}
}
if(shouldAddVelocity0){
mc.player.networkHandler.sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_SPRINTING));
for (int i = 0; i < 50; i++) {
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() - 0.000000001, mc.player.getZ(), true));
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY() + 0.000000001, mc.player.getZ(), false));
}
}
}
}
Loading

0 comments on commit ec00b2b

Please sign in to comment.