Skip to content

Commit

Permalink
0.6.5 WorldBorderCoords command, new misc features/fixes
Browse files Browse the repository at this point in the history
- Prevented AutoMountain from attempting to make stairs going through the world border.
- Added the .wb command to tell you the precise coordinates of each world border in a server. Useful if world border may not be default size.
- Made BaseFinder actually reset the "Nearest Base Chunk" when deleting base data and when leaving worlds, and at other times when it should.
- Added the "last" option after typing "rmv" with the .base command. It removes the last single Base Coord found when using basefinder.
- Added a button to the BaseFinder options which does thes same as above. (Useful for deleting false positives)
- Made HandOfGod and Voider module not disable when you are not operator. It was causing the module to disable on login to a multiplayer server even if you are an operator.
- In NewerNewChunks the two if statements in the "tick exploit" section of code has been combined
- Fixed version in the fabric.mod.json
etianl authored Jul 25, 2023
1 parent 206c5ac commit 1c21dcb
Showing 12 changed files with 163 additions and 51 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -62,7 +62,10 @@ This will return the lowest block placed with AutoMountain until AutoLavacast is
- The Number of Blocks to Find options is the total amount any of the blocks from one of the lists to find before throwing a base coord.
- Do not do the same block in more than one list, it will be a waste of CPU time. The torches and signs in by default are fine because they are actually two different blocks, "WALL_TORCH" and just "TORCH".
- The "Unnatural Spawner Finder" option locates spawners and if they do not have one of the blocks that spawners have around them in nature (Mossy Cobblestone, Stone Brick Stairs, Cobweb, Nether Brick Fence, and Chain), then flag the spawner as unnatural.
- .base command returns the nearest base to you, .base add or remove will add or remove the location you are in as a base coord, or you can input X,Y. There are buttons in the options menu to do the same things.
- .base command returns the nearest base to you
- .base add or rmv will add or remove the location you are in as a base coord, or you can input X,Y after add/rmv (ex: .base add 69 420)
- .base rmv last will remove the last single base coordinate found. (Good for removing false positives)
- There are buttons in the options menu to do the same things as the commands listed above.
- Base location data will be stored in the "BaseChunks" folder, in your Minecraft folder.
- **BetterAutoSign:** Automatically writes signs with the text you specify, and can also apply glow ink or dye. (Credits to Meteor-Tweaks)
- **BetterScaffold:** Give you more options for scaffolding, bigger range and others. (Credits to Meteor-Tweaks)
@@ -103,6 +106,7 @@ This will return the lowest block placed with AutoMountain until AutoLavacast is
- **TrailMaker:** Leaves blocks behind you in a trail. Has a place delay option to spread placement further apart. Select the blocks you want to use in the block list setting for it to work. (Credits to etianl :D)
- **TrouserBuild:** It can build either horizontally or vertically according to a 5x5 grid centered on the block you are aiming at. Right click to build at the targeted location. (Credits to etianl, and to Banana for the checkboxes and idea. :D)
- **Voider+:** Replaces the world from the top down. (Credits to Allah-Hack) I added a 3x3 voiding script, a TP foward option for deleting strips, as well as options to set max and minimum height for voiding, and instead of just air it can do water and lava now too.
- **WorldBorderCoordsCommand** Type .wb in chat to tell you the precise coordinates of each of the world borders. (Credits to etianl :D)

## Known Bugs:
- **AutoLavaCaster Bugs**
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -2,11 +2,11 @@ org.gradle.jvmargs=-Xmx2G

# Fabric (https://fabricmc.net/versions.html)
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.9
yarn_mappings=1.20.1+build.10
loader_version=0.14.21

# Mod Properties
mod_version=0.6.4-1.20.1
mod_version=0.6.5-1.20.1
maven_group=pwn.noobs
archives_base_name=1trouser-streak

6 changes: 2 additions & 4 deletions src/main/java/pwn/noobs/trouserstreak/Trouser.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package pwn.noobs.trouserstreak;

import meteordevelopment.meteorclient.commands.Commands;
import pwn.noobs.trouserstreak.commands.BaseFinderCommands;
import pwn.noobs.trouserstreak.commands.CasterTimer;
import pwn.noobs.trouserstreak.commands.LavaTimeCalculator;
import pwn.noobs.trouserstreak.commands.NewChunkCounter;
import pwn.noobs.trouserstreak.commands.*;
import pwn.noobs.trouserstreak.modules.*;
import meteordevelopment.meteorclient.addons.MeteorAddon;
import meteordevelopment.meteorclient.systems.modules.Category;
@@ -50,6 +47,7 @@ public void onInitialize() {
Commands.add(new CasterTimer());
Commands.add(new NewChunkCounter());
Commands.add(new BaseFinderCommands());
Commands.add(new WorldBorderCoordsCommand());
}

@Override
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import net.minecraft.command.CommandSource;
import net.minecraft.text.Text;
import net.minecraft.util.math.ChunkPos;
import pwn.noobs.trouserstreak.modules.BaseFinder;

import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
@@ -59,6 +60,21 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
ChatUtils.sendMsg(Text.of("Base near X"+mc.player.getChunkPos().getCenterX()+", Z"+mc.player.getChunkPos().getCenterZ()+" removed from the BaseFinder."));
return SINGLE_SUCCESS;}
}));
builder.then(literal("rmv").then(literal("last").executes(ctx -> {
if(b.isBaseFinderModuleOn==0){
error("Please turn on BaseFinder module and run the command again.");
return SINGLE_SUCCESS;
} else if(b.isBaseFinderModuleOn!=0 && (b.LastBaseFound.x==2000000000 || b.LastBaseFound.z==2000000000)){
error("Please find a base and run the command again.");
return SINGLE_SUCCESS;
} else {
b.RemoveCoordX= b.LastBaseFound.x;
b.RemoveCoordZ= b.LastBaseFound.z;
ChatUtils.sendMsg(Text.of("Base near X"+b.LastBaseFound.getCenterX()+", Z"+b.LastBaseFound.getCenterZ()+" removed from the BaseFinder."));
b.LastBaseFound= new ChunkPos(2000000000, 2000000000);
return SINGLE_SUCCESS;
}
})));
builder.then(literal("rmv").then(argument("x",FloatArgumentType.floatArg()).then(argument("z",FloatArgumentType.floatArg()).executes(ctx -> {
if(b.isBaseFinderModuleOn==0){
error("Please turn on BaseFinder module and run the command again.");
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package pwn.noobs.trouserstreak.commands;

import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import net.minecraft.command.CommandSource;
import net.minecraft.text.Text;
import static meteordevelopment.meteorclient.MeteorClient.mc;

import static com.mojang.brigadier.Command.SINGLE_SUCCESS;

public class WorldBorderCoordsCommand extends Command {
public WorldBorderCoordsCommand() {
super("wb", "Tells you the coordinates of each world border.");
}

@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.executes(context -> {
ChatUtils.sendMsg(Text.of("East World Border X: "+(int) mc.world.getWorldBorder().getBoundEast()+", West World Border X: "+(int) mc.world.getWorldBorder().getBoundWest()+", South World Border Z: "+(int) mc.world.getWorldBorder().getBoundSouth()+", North World Border Z: "+(int) mc.world.getWorldBorder().getBoundNorth()));
return SINGLE_SUCCESS;
});
}
}
32 changes: 16 additions & 16 deletions src/main/java/pwn/noobs/trouserstreak/modules/AutoMountain.java

Large diffs are not rendered by default.

98 changes: 88 additions & 10 deletions src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java
Original file line number Diff line number Diff line change
@@ -44,6 +44,8 @@
import java.util.List;
import java.util.Set;

import static com.mojang.brigadier.Command.SINGLE_SUCCESS;

/*
This BaseFinder was made from the newchunks code,
Newchunks was Ported from: https://github.com/BleachDrinker420/BleachHack/blob/master/BleachHack-Fabric-1.16/src/main/java/bleach/hack/module/mods/NewChunks.java
@@ -76,6 +78,13 @@ public class BaseFinder extends Module {
.description("If a spawner doesn't have the proper natural companion blocks with it in the chunk, flag as possible build.")
.defaultValue(true)
.build());
private final Setting<Integer> bsefndtickdelay = sgGeneral.add(new IntSetting.Builder()
.name("Base Found Message Tick Delay")
.description("Delays the allowance of Base Found messages to reduce spam.")
.min(0)
.sliderRange(0,300)
.defaultValue(5)
.build());
private final Setting<List<Block>> Blawcks1 = sglists.add(new BlockListSetting.Builder()
.name("Block List #1 (Default)")
.description("If the total amount of any of these found is greater than the Number specified, throw a base location.")
@@ -273,6 +282,20 @@ public WWidget getWidget(GuiTheme theme) {
}
};
table.row();
WButton dellastdata = table.add(theme.button("RemoveLastBase")).expandX().minWidth(100).widget();
dellastdata.action = () -> {
if(isBaseFinderModuleOn==0){
error("Please turn on BaseFinder module and push the button again.");
} else if(isBaseFinderModuleOn!=0 && (LastBaseFound.x==2000000000 || LastBaseFound.z==2000000000)){
error("Please find a base and run the command again.");
} else {
RemoveCoordX= LastBaseFound.x;
RemoveCoordZ= LastBaseFound.z;
ChatUtils.sendMsg(Text.of("Base near X"+LastBaseFound.getCenterX()+", Z"+LastBaseFound.getCenterZ()+" removed from the BaseFinder."));
LastBaseFound= new ChunkPos(2000000000, 2000000000);
}
};
table.row();
WButton deletedata = table.add(theme.button("**DELETE ALL BASE DATA**")).expandX().minWidth(100).widget();
deletedata.action = () -> {
if (!(mc.world==null) && mc.world.isChunkLoaded(mc.player.getChunkPos().x,mc.player.getChunkPos().z)){
@@ -341,7 +364,8 @@ public WWidget getWidget(GuiTheme theme) {
.visible(() -> trcr.get())
.build()
);

private int basefoundspamTicks=0;
private boolean basefound=false;
private int deletewarningTicks=666;
private int deletewarning=0;
private boolean checkingchunk1=false;
@@ -358,6 +382,7 @@ public WWidget getWidget(GuiTheme theme) {
private int found6 = 0;
private boolean checkingchunk7=false;
private int found7 = 0;
public static ChunkPos LastBaseFound = new ChunkPos(2000000000, 2000000000);
private int closestbaseX=2000000000;
private int closestbaseZ=2000000000;
private double basedistance=2000000000;
@@ -429,6 +454,10 @@ public void onDeactivate() {
reloadworld=0;
if (remove.get()|autoreload.get()) {
baseChunks.clear();
closestbaseX=2000000000;
closestbaseZ=2000000000;
basedistance=2000000000;
LastBaseFound= new ChunkPos(2000000000, 2000000000);
}
super.onDeactivate();
}
@@ -450,17 +479,30 @@ private void onGameLeft(GameLeftEvent event) {
basenotifticks=0;
if (worldleaveremove.get()) {
baseChunks.clear();
closestbaseX=2000000000;
closestbaseZ=2000000000;
basedistance=2000000000;
LastBaseFound= new ChunkPos(2000000000, 2000000000);
}
}

@EventHandler
private void onPreTick(TickEvent.Pre event) {
if (basefound==true && basefoundspamTicks< bsefndtickdelay.get())basefoundspamTicks++;
else if (basefoundspamTicks>= bsefndtickdelay.get()){
basefound=false;
basefoundspamTicks=0;
}
if (deletewarningTicks<=100) deletewarningTicks++;
else deletewarning=0;
if (deletewarning>=2){
baseChunks.clear();
new File("BaseChunks/"+serverip+"/"+world+"/BaseChunkData.txt").delete();
error("Base Data deleted for this Dimension.");
closestbaseX=2000000000;
closestbaseZ=2000000000;
basedistance=2000000000;
LastBaseFound= new ChunkPos(2000000000, 2000000000);
error("Base Data deleted for this Dimension.");
deletewarning=0;
}
if (load.get()){
@@ -626,7 +668,11 @@ private void onReadPacket(PacketEvent.Receive event) {
if (save.get()) {
saveBaseChunkData();
}
if (basefoundspamTicks==0){
ChatUtils.sendMsg(Text.of("(Skybuild)Possible build located near X"+basepos.getCenterX()+", Y"+y+", Z"+basepos.getCenterZ()));
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
}
}
if (!(blerks.getBlock()==Blocks.STONE)){
@@ -710,7 +756,11 @@ private void onReadPacket(PacketEvent.Receive event) {
if (save.get()) {
saveBaseChunkData();
}
ChatUtils.sendMsg(Text.of("(List1)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions1.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound1+")"));
if (basefoundspamTicks== 0) {
ChatUtils.sendMsg(Text.of("(List1)Possible build located near X" + basepos.getCenterX() + ", Y" + blockpositions1.stream().toList().get(0).getY() + ", Z" + basepos.getCenterZ() + " (" + lastblockfound1 + ")"));
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
}
blockpositions1.clear();
found1 = 0;
@@ -730,7 +780,11 @@ private void onReadPacket(PacketEvent.Receive event) {
if (save.get()) {
saveBaseChunkData();
}
ChatUtils.sendMsg(Text.of("(List2)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions2.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound2+")"));
if (basefoundspamTicks== 0) {
ChatUtils.sendMsg(Text.of("(List2)Possible build located near X" + basepos.getCenterX() + ", Y" + blockpositions2.stream().toList().get(0).getY() + ", Z" + basepos.getCenterZ() + " (" + lastblockfound2 + ")"));
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
}
blockpositions2.clear();
found2 = 0;
@@ -750,7 +804,11 @@ private void onReadPacket(PacketEvent.Receive event) {
if (save.get()) {
saveBaseChunkData();
}
ChatUtils.sendMsg(Text.of("(List3)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions3.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound3+")"));
if (basefoundspamTicks== 0) {
ChatUtils.sendMsg(Text.of("(List3)Possible build located near X" + basepos.getCenterX() + ", Y" + blockpositions3.stream().toList().get(0).getY() + ", Z" + basepos.getCenterZ() + " (" + lastblockfound3 + ")"));
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
}
blockpositions3.clear();
found3 = 0;
@@ -770,7 +828,11 @@ private void onReadPacket(PacketEvent.Receive event) {
if (save.get()) {
saveBaseChunkData();
}
ChatUtils.sendMsg(Text.of("(List4)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions4.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound4+")"));
if (basefoundspamTicks== 0) {
ChatUtils.sendMsg(Text.of("(List4)Possible build located near X" + basepos.getCenterX() + ", Y" + blockpositions4.stream().toList().get(0).getY() + ", Z" + basepos.getCenterZ() + " (" + lastblockfound4 + ")"));
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
}
blockpositions4.clear();
found4 = 0;
@@ -790,7 +852,11 @@ private void onReadPacket(PacketEvent.Receive event) {
if (save.get()) {
saveBaseChunkData();
}
ChatUtils.sendMsg(Text.of("(List5)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions5.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound5+")"));
if (basefoundspamTicks== 0) {
ChatUtils.sendMsg(Text.of("(List5)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions5.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound5+")"));
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
}
blockpositions5.clear();
found5 = 0;
@@ -810,7 +876,11 @@ private void onReadPacket(PacketEvent.Receive event) {
if (save.get()) {
saveBaseChunkData();
}
ChatUtils.sendMsg(Text.of("(List6)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions6.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound6+")"));
if (basefoundspamTicks== 0) {
ChatUtils.sendMsg(Text.of("(List6)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions6.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound6+")"));
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
}
blockpositions6.clear();
found6 = 0;
@@ -830,7 +900,11 @@ private void onReadPacket(PacketEvent.Receive event) {
if (save.get()) {
saveBaseChunkData();
}
ChatUtils.sendMsg(Text.of("(List7)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions7.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound7+")"));
if (basefoundspamTicks== 0) {
ChatUtils.sendMsg(Text.of("(List7)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions7.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound7+")"));
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
}
blockpositions7.clear();
found7 = 0;
@@ -852,7 +926,11 @@ private void onReadPacket(PacketEvent.Receive event) {
if (save.get()) {
saveBaseChunkData();
}
ChatUtils.sendMsg(Text.of("Possible modified spawner located near X"+basepos.getCenterX()+", Y"+spawnerY+", Z"+basepos.getCenterZ()));
if (basefoundspamTicks== 0) {
ChatUtils.sendMsg(Text.of("Possible modified spawner located near X"+basepos.getCenterX()+", Y"+spawnerY+", Z"+basepos.getCenterZ()));
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
}
spawnerfound=false;
spawnernaturalblocks=false;
Original file line number Diff line number Diff line change
@@ -44,8 +44,11 @@ else if (delayLeft <= 0 && offLeft > 0) {
offLeft--;
BlockPos playerPos = mc.player.getBlockPos();
BlockPos pos = playerPos.add(new Vec3i(0,-1,0));
if (mc.world.getBlockState(pos).isAir())
if (mc.world.getBlockState(pos).isAir()){
mc.player.move(MovementType.SELF, new Vec3d(0,-0.1,0));
} else if (!mc.world.getBlockState(pos).isAir() && mc.player.getY()>pos.getY()+0.1){
mc.player.move(MovementType.SELF, new Vec3d(0,-0.1,0));
}
} else if (delayLeft <= 0 && offLeft <= 0) {
delayLeft = delay.get();
offLeft = offTime.get();
6 changes: 1 addition & 5 deletions src/main/java/pwn/noobs/trouserstreak/modules/HandOfGod.java
Original file line number Diff line number Diff line change
@@ -242,7 +242,7 @@ public class HandOfGod extends Module {
.build()
);
public HandOfGod() {
super(Trouser.Main, "HandOfGod", "Changes the world as you fly around, and replaces blocks with whatever you please when you click. Must be OP");
super(Trouser.Main, "HandOfGod", "Changes the world as you fly around, and replaces blocks with whatever you please when you click. (Must have OP status)");
}

private int ticks=0;
@@ -325,10 +325,6 @@ public void onTick(TickEvent.Pre event) {
pX=mc.player.getBlockPos().getX();
pY=mc.player.getBlockPos().getY();
pZ=mc.player.getBlockPos().getZ();
if (!(mc.player.hasPermissionLevel(4))) {
toggle();
error("Must have OP");
}
if (autosave.get()){
asaveticks++;
if (asaveticks>=autosavedelay.get()*20){
Original file line number Diff line number Diff line change
@@ -539,12 +539,9 @@ else if (event.packet instanceof BlockUpdateS2CPacket) {
BlockUpdateS2CPacket packet = (BlockUpdateS2CPacket) event.packet;
if (tickexploit.get()){
try {
if (!packet.getState().hasRandomTicks() && !tickexploitChunks.contains(chunkPos) && !oldChunks.contains(chunkPos) && !olderoldChunks.contains(chunkPos) && !newChunks.contains(chunkPos)){
tickexploitChunks.add(chunkPos);
if (save.get()){
saveTickExploitChunkData();
}
} else if (packet.getState().hasRandomTicks() && !tickexploitChunks.contains(chunkPos) && !oldChunks.contains(chunkPos) && !olderoldChunks.contains(chunkPos) && !newChunks.contains(chunkPos)){
//I cannot tell if the addition of "!packet.getState().hasRandomTicks() || packet.getState().hasRandomTicks())" below even does anything
//It might just work on BlockUpdate packet, in testing it's hard to tell what gives more "false positives"
if ((!packet.getState().hasRandomTicks() || packet.getState().hasRandomTicks()) && !tickexploitChunks.contains(chunkPos) && !oldChunks.contains(chunkPos) && !olderoldChunks.contains(chunkPos) && !newChunks.contains(chunkPos)){
tickexploitChunks.add(chunkPos);
if (save.get()){
saveTickExploitChunkData();
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ public class VoiderPlus extends Module {
);

public VoiderPlus() {
super(Trouser.Main, "voider+", "Runs /fill on the world from the top down");
super(Trouser.Main, "voider+", "Runs /fill on the world from the top down (Must have OP status)");
}

int i;
@@ -109,10 +109,6 @@ public void onActivate() {

@EventHandler
public void onTick(TickEvent.Post event) {
if (!(mc.player.hasPermissionLevel(4))) {
toggle();
error("Must have OP");
}
if (!threebythree.get() && !tpfwd.get()){
ChatUtils.sendPlayerMsg("/fill " + (sX - radius.get()) + " " + i +" "+ (sZ - radius.get()) +" "+ (sX + radius.get()) + " " + i +" "+ (sZ + radius.get()) + " "+block);
i--;
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "streak-addon",
"version": "${version}",
"version": "0.6.5",
"name": "TrouserStreak",
"description": "Trouser-Streak is a compilation of modules, updated to the latest version and optimized for maximum grief. I did not make all of these.",
"authors": [

0 comments on commit 1c21dcb

Please sign in to comment.