From 891712acd477e9aa28c7cfc2977b8fca4c9c79b8 Mon Sep 17 00:00:00 2001
From: etianl <115842502+etianl@users.noreply.github.com>
Date: Sun, 5 Jan 2025 23:44:16 -0800
Subject: [PATCH] 1.3.9 PortalPatternFinder and much more!
**v1.3.9**
CAVE_AIR Update!
## New Modules!
**PortalPatternFinder**
- Scans for the shapes of broken/removed Nether Portals within the cave air blocks found in caves and underground structures in 1.13+ chunks.
- This may be useful for finding portal skips in the Nether because there is alot of cave generation containing CAVE_AIR.
**CaveDisturbanceDetector**
- Scans for single air blocks within the cave air blocks found in caves and underground structures in 1.13+ chunks.
- There is alot of false positives with this module due to random single air blocks that can naturally occur in caves, mineshafts, etc.
## Other Changes
- Made detected positions get cleared on switching dimension to prevent the renders still being visible from the previous dimension in the **ActivatedSpawnerDetector** and **PotESP** modules.
- Added an option so you can turn off chat feedback in ActivatedSpawnerDetector and BaseFinder.
- Added an option enabled by default to **ActivatedSpawnerDetector** which scans for disturbances in the air around the spawner blocks if the timer value is 20 or 0. If someone placed a block and removed it immediately around the spawner this will detect that within chunks generated in Minecraft version 1.13+.
- Added an option for tracers to **PotESP** and **ActivatedSpawnerDetector**. This also includes an option to only show one tracer to the nearest detected thing.
- Made the small box around the spawner and the tracer still render when no chests within are in range of spawner when "Less Render Spam" is enabled in **ActivatedSpawnerDetector**.
- Merged this pull request https://github.com/etianl/Trouser-Streak/pull/76 that cleaned up a bunch of my code with 40 files changed! Thank you to https://github.com/DonKisser for their contributions!
---
README.md | 5 +-
gradle.properties | 2 +-
.../java/pwn/noobs/trouserstreak/Trouser.java | 2 +
.../modules/ActivatedSpawnerDetector.java | 369 +++++++++---
.../trouserstreak/modules/AirstrikePlus.java | 68 +--
.../trouserstreak/modules/AutoCommand.java | 2 +-
.../noobs/trouserstreak/modules/AutoDrop.java | 12 +-
.../trouserstreak/modules/AutoLavaCaster.java | 1 -
.../trouserstreak/modules/BaseFinder.java | 112 +++-
.../trouserstreak/modules/BetterScaffold.java | 236 ++++----
.../modules/CaveDisturbanceDetector.java | 423 ++++++++++++++
.../trouserstreak/modules/ForceOPBook.java | 3 +-
.../trouserstreak/modules/ForceOPSign.java | 3 +-
.../trouserstreak/modules/HandOfGod.java | 9 +-
.../noobs/trouserstreak/modules/LavaAura.java | 274 ++++-----
.../trouserstreak/modules/NewerNewChunks.java | 10 +-
.../modules/OPServerKillModule.java | 2 +-
.../modules/OnlinePlayerActivityDetector.java | 2 +-
.../modules/PortalPatternFinder.java | 542 ++++++++++++++++++
.../noobs/trouserstreak/modules/PotESP.java | 107 +++-
.../trouserstreak/modules/RedstoneNuker.java | 4 +-
.../trouserstreak/modules/ShulkerDupe.java | 22 +-
.../trouserstreak/modules/StorageLooter.java | 9 +-
.../noobs/trouserstreak/modules/TPFly.java | 36 +-
.../trouserstreak/modules/TrouserBuild.java | 80 +--
src/main/resources/fabric.mod.json | 2 +-
26 files changed, 1819 insertions(+), 518 deletions(-)
create mode 100644 src/main/java/pwn/noobs/trouserstreak/modules/CaveDisturbanceDetector.java
create mode 100644 src/main/java/pwn/noobs/trouserstreak/modules/PortalPatternFinder.java
diff --git a/README.md b/README.md
index c2c6e069..4801d0be 100644
--- a/README.md
+++ b/README.md
@@ -5,13 +5,14 @@
Official Griefing Utilities of Mountains of Lava Inc.
Trouser-Streak is a compilation of modules for Meteor Client.
Updated to the latest version and optimized for maximum grief!
- Discord server for updates and help: https://discord.gg/Az3G3p4ZCj
+ Customer Service Discord: https://discord.gg/Az3G3p4ZCj
***A few of these modules were not made by me!***
## Credits to the people I skidded from:
In no particular order
+- All of these people https://github.com/etianl/Trouser-Streak/graphs/contributors
- [DAMcraft (ServerSeeker)](https://github.com/DAMcraft/MeteorServerSeeker)
- [Meteor Client](https://github.com/meteordevelopment/meteor-client)
- [Allah-Hack](https://github.com/TaxEvasiqn/allah-hack)
@@ -97,6 +98,7 @@ In no particular order
- **Book And Quill Dupe:** Overflows data in a book's title to cause dupes and chunk bans. Credits to [Thorioum](https://github.com/Thorioum)!
- **Boom+:** Throws entities or spawns them on the targeted block when you click (Credits to Allah-Hack for the original) I just added more fun things you might want to throw as well as included the option for height based on player Y level.
- **BungeeSpoofer:** Allows you to join servers with an exposed bungeecord backend. (Credits to DAMcraft of ServerSeeker!)
+- **CaveDisturbanceDetector:** Scans for single air blocks within the cave air blocks found in caves and underground structures in 1.13+ chunks. (Credits to etianl :D)
- **CrashCommand:** Crashes other players out using a nasty particle effect. Requires OP status. Credits to [aaaasdfghjkllll](https://github.com/aaaasdfghjkllll)
- **ExplosionAura:** Spawns creepers at your position as you move that explode instantly. Like a bigger, more laggy Nuker module for creative mode. The use of the module Velocity is recommended to avoid being thrown around. (Credits to etianl :D)
- **FlightAntikick:** Moves you down on a tick-based timer. Added in to substitute the lack of a "Normal" mode antikick for velocity flight in MeteorClient (not a great antikick it's just something). Bind it to the same key as Flight. (Credits to etianl :D)
@@ -161,6 +163,7 @@ In no particular order
- **OnlinePlayerActivityDetector:** Detects if an online player is nearby if there are blocks missing from a BlockState palette and your render distances are overlapping. It can detect players that are outside of render distance. (Credits to etianl :D)
- **OPplayerTPmodule:** Uses operator commands to teleport you to each player online one by one at the push of a button, or those players to you one by one. There is a button in the options for it to reset the current player to zero. Thank you to [ogmur](https://www.youtube.com/@Ogmur) for the module suggestion (Credits to etianl for writing :D). REQUIRES OP STATUS
- **OPServerKillModule:** Runs a set of operator commands to disable a server and cover up the tracks of the kill command. REQUIRES OP STATUS (Credits to etianl :D)
+- **PortalPatternFinder:** Scans for the shapes of broken/removed Nether Portals within the cave air blocks found in caves and underground structures in 1.13+ chunks. **May be useful for finding portal skips in the Nether**. (Credits to etianl :D)
- **PotESP:** Detects Decorated Pots with un-natural contents, and also tells you what item it is and the location of the pot. (Credits to etianl :D)
- **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. (Credits to Meteor Client for Nuker code, and AutoTool code inthere.)
- **ShulkerDupe:** Duplicates the contents of a shulker when pressing "Dupe" or "Dupe All" in the shulker menu. Only works on Vanilla, Forge, and Fabric servers 1.19 and below. Use multiconnect or viafabric (Credits to Allah-Hack, I just brought back the buttons, and make it dupe slot1 as well.)
diff --git a/gradle.properties b/gradle.properties
index 0213865d..9f654701 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -6,7 +6,7 @@ yarn_mappings=1.21.3+build.2
loader_version=0.16.9
# Mod Properties
-mod_version=1.3.8-1.21.3
+mod_version=1.3.9-1.21.3
maven_group=pwn.noobs
archives_base_name=1trouser-streak
diff --git a/src/main/java/pwn/noobs/trouserstreak/Trouser.java b/src/main/java/pwn/noobs/trouserstreak/Trouser.java
index 995b5cce..a72c57a8 100644
--- a/src/main/java/pwn/noobs/trouserstreak/Trouser.java
+++ b/src/main/java/pwn/noobs/trouserstreak/Trouser.java
@@ -30,6 +30,8 @@ public void onInitialize() {
Modules.get().add(new NewerNewChunks());
Modules.get().add(new BaseFinder());
Modules.get().add(new ActivatedSpawnerDetector());
+ Modules.get().add(new PortalPatternFinder());
+ Modules.get().add(new CaveDisturbanceDetector());
Modules.get().add(new PotESP());
Modules.get().add(new OnlinePlayerActivityDetector());
Modules.get().add(new HoleAndTunnelAndStairsESP());
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/ActivatedSpawnerDetector.java b/src/main/java/pwn/noobs/trouserstreak/modules/ActivatedSpawnerDetector.java
index 47163686..8c14df6e 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/ActivatedSpawnerDetector.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/ActivatedSpawnerDetector.java
@@ -1,12 +1,15 @@
//made by etianl :D
package pwn.noobs.trouserstreak.modules;
+ import meteordevelopment.meteorclient.events.game.GameLeftEvent;
+ import meteordevelopment.meteorclient.events.game.OpenScreenEvent;
import meteordevelopment.meteorclient.events.render.Render3DEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.renderer.ShapeMode;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
+ import meteordevelopment.meteorclient.utils.render.RenderUtils;
import meteordevelopment.meteorclient.utils.render.color.Color;
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import meteordevelopment.orbit.EventHandler;
@@ -15,6 +18,8 @@
import net.minecraft.block.entity.MobSpawnerBlockEntity;
import net.minecraft.block.entity.TrialSpawnerBlockEntity;
import net.minecraft.block.enums.TrialSpawnerState;
+ import net.minecraft.client.gui.screen.DisconnectedScreen;
+ import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
import net.minecraft.entity.vehicle.ChestMinecartEntity;
import net.minecraft.text.Text;
import net.minecraft.util.math.BlockPos;
@@ -30,7 +35,18 @@
public class ActivatedSpawnerDetector extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();
private final SettingGroup sgRender = settings.createGroup("Render");
-
+ private final Setting chatFeedback = sgGeneral.add(new BoolSetting.Builder()
+ .name("Chat feedback")
+ .description("Display info about spawners in chat.")
+ .defaultValue(true)
+ .build()
+ );
+ private final Setting displaycoords = sgGeneral.add(new BoolSetting.Builder()
+ .name("DisplayCoords")
+ .description("Displays coords of activated spawners in chat.")
+ .defaultValue(true)
+ .build()
+ );
private final Setting extramessage = sgGeneral.add(new BoolSetting.Builder()
.name("Stash Message")
.description("Toggle the message reminding you about stashes.")
@@ -44,18 +60,18 @@ public class ActivatedSpawnerDetector extends Module {
.visible(extramessage::get)
.build()
);
+ private final Setting airChecker = sgGeneral.add(new BoolSetting.Builder()
+ .name("Check Air Disturbances")
+ .description("Displays spawners as activated if there are disturbances in the air around them. For example if a torch was placed and removed it will detect that.")
+ .defaultValue(true)
+ .build()
+ );
private final Setting> blocks = sgGeneral.add(new BlockListSetting.Builder()
.name("Storage Blocks")
.description("Storage Blocks the module checks for when considering displaying messages and renders.")
.defaultValue(Blocks.CHEST, Blocks.BARREL, Blocks.HOPPER, Blocks.DISPENSER)
.build()
);
- private final Setting displaycoords = sgGeneral.add(new BoolSetting.Builder()
- .name("DisplayCoords")
- .description("Displays coords of activated spawners in chat.")
- .defaultValue(true)
- .build()
- );
private final Setting deactivatedSpawner = sgGeneral.add(new BoolSetting.Builder()
.name("De-Activated Spawner Detector")
.description("Detects spawners with torches on them.")
@@ -79,13 +95,13 @@ public class ActivatedSpawnerDetector extends Module {
);
private final Setting lessRenderSpam = sgRender.add(new BoolSetting.Builder()
.name("Less Render Spam")
- .description("Do not render if NO chests within 16 blocks of spawner.")
+ .description("Do not render big box if NO chests within range of spawner.")
.defaultValue(true)
.build()
);
public final Setting renderDistance = sgRender.add(new IntSetting.Builder()
.name("Render-Distance(Chunks)")
- .description("How many chunks from the character to render the detected chunks.")
+ .description("How many chunks from the character to render the detected spawners.")
.defaultValue(32)
.min(6)
.sliderRange(6,1024)
@@ -97,6 +113,18 @@ public class ActivatedSpawnerDetector extends Module {
.defaultValue(true)
.build()
);
+ private final Setting trcr = sgRender.add(new BoolSetting.Builder()
+ .name("Tracers")
+ .description("Show tracers to the Spawner.")
+ .defaultValue(true)
+ .build()
+ );
+ private final Setting nearesttrcr = sgRender.add(new BoolSetting.Builder()
+ .name("Tracer to nearest Spawner Only")
+ .description("Show only one tracer to the nearest Spawner.")
+ .defaultValue(false)
+ .build()
+ );
private final Setting shapeMode = sgRender.add(new EnumSetting.Builder()
.name("shape-mode")
.description("How the shapes are rendered.")
@@ -114,7 +142,7 @@ public class ActivatedSpawnerDetector extends Module {
.name("spawner-line-color")
.description("Color of the activated spawner.")
.defaultValue(new SettingColor(251, 5, 5, 235))
- .visible(() -> (shapeMode.get() == ShapeMode.Lines || shapeMode.get() == ShapeMode.Both))
+ .visible(() -> (shapeMode.get() == ShapeMode.Lines || shapeMode.get() == ShapeMode.Both || trcr.get()))
.build()
);
private final Setting trialSideColor = sgRender.add(new ColorSetting.Builder()
@@ -128,7 +156,7 @@ public class ActivatedSpawnerDetector extends Module {
.name("trial-line-color")
.description("Color of the activated trial spawner.")
.defaultValue(new SettingColor(255, 100, 0, 235))
- .visible(() -> trialSpawner.get() && (shapeMode.get() == ShapeMode.Lines || shapeMode.get() == ShapeMode.Both))
+ .visible(() -> trialSpawner.get() && (shapeMode.get() == ShapeMode.Lines || shapeMode.get() == ShapeMode.Both || trcr.get()))
.build()
);
private final Setting despawnerSideColor = sgRender.add(new ColorSetting.Builder()
@@ -179,28 +207,45 @@ public class ActivatedSpawnerDetector extends Module {
.visible(() -> trialSpawner.get() && rangerendering.get() && (shapeMode.get() == ShapeMode.Lines || shapeMode.get() == ShapeMode.Both))
.build()
);
-
+ private final Set scannedPositions = Collections.synchronizedSet(new HashSet<>());
private final Set spawnerPositions = Collections.synchronizedSet(new HashSet<>());
private final Set trialspawnerPositions = Collections.synchronizedSet(new HashSet<>());
private final Set deactivatedSpawnerPositions = Collections.synchronizedSet(new HashSet<>());
private final Set noRenderPositions = Collections.synchronizedSet(new HashSet<>());
+ private int closestSpawnerX=2000000000;
+ private int closestSpawnerY=2000000000;
+ private int closestSpawnerZ=2000000000;
+ private double SpawnerDistance=2000000000;
public ActivatedSpawnerDetector() {
super(Trouser.Main,"ActivatedSpawnerDetector", "Detects if a player has been near a mob spawner in the past. May be useful for finding player made stashes in dungeons, mineshafts, and other places.");
}
@Override
public void onActivate() {
- spawnerPositions.clear();
- deactivatedSpawnerPositions.clear();
- noRenderPositions.clear();
- trialspawnerPositions.clear();
+ clearChunkData();
}
@Override
public void onDeactivate() {
+ clearChunkData();
+ }
+ @EventHandler
+ private void onScreenOpen(OpenScreenEvent event) {
+ if (event.screen instanceof DisconnectedScreen || event.screen instanceof DownloadingTerrainScreen) clearChunkData();
+ }
+ @EventHandler
+ private void onGameLeft(GameLeftEvent event) {
+ clearChunkData();
+ }
+ private void clearChunkData(){
+ scannedPositions.clear();
spawnerPositions.clear();
deactivatedSpawnerPositions.clear();
noRenderPositions.clear();
trialspawnerPositions.clear();
+ closestSpawnerX=2000000000;
+ closestSpawnerY=2000000000;
+ closestSpawnerZ=2000000000;
+ SpawnerDistance=2000000000;
}
@EventHandler
private void onPreTick(TickEvent.Pre event) {
@@ -215,93 +260,142 @@ private void onPreTick(TickEvent.Pre event) {
for (BlockEntity blockEntity : blockEntities) {
if (blockEntity instanceof MobSpawnerBlockEntity){
+ boolean activatedSpawnerFound = false;
MobSpawnerBlockEntity spawner = (MobSpawnerBlockEntity) blockEntity;
BlockPos pos = spawner.getPos();
BlockPos playerPos = new BlockPos(mc.player.getBlockX(), pos.getY(), mc.player.getBlockZ());
- if (playerPos.isWithinDistance(pos, renderDistance.get() * 16) && !trialspawnerPositions.contains(pos) && !noRenderPositions.contains(pos) && !deactivatedSpawnerPositions.contains(pos) && !spawnerPositions.contains(pos) && spawner.getLogic().spawnDelay != 20) {
- if (mc.world.getRegistryKey() == World.NETHER && spawner.getLogic().spawnDelay == 0) return;
- if (spawner.getLogic().spawnEntry.getNbt().get("id") != null){
- String monster = spawner.getLogic().spawnEntry.getNbt().get("id").toString();
- if (monster != null){
- if (monster.contains("zombie") || monster.contains("skeleton")) {
- if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cDUNGEON§r Spawner! Block Position: " + pos));
- else ChatUtils.sendMsg(Text.of("Detected Activated §cDUNGEON§r Spawner!"));
- } else if (monster.contains(":spider")) {
- if (mc.world.getBlockState(spawner.getPos().down()).getBlock() == Blocks.BIRCH_PLANKS){
- if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cWOODLAND MANSION§r Spawner! Block Position: " + pos));
- else ChatUtils.sendMsg(Text.of("Detected Activated §cWOODLAND MANSION§r Spawner!"));
- } else {
- if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cDUNGEON§r Spawner! Block Position: " + pos));
- else ChatUtils.sendMsg(Text.of("Detected Activated §cDUNGEON§r Spawner!"));
+ String monster = null;
+ if (spawner.getLogic().spawnEntry != null && spawner.getLogic().spawnEntry.getNbt().get("id") != null) monster = spawner.getLogic().spawnEntry.getNbt().get("id").toString();
+ if (playerPos.isWithinDistance(pos, renderDistance.get() * 16) && !trialspawnerPositions.contains(pos) && !noRenderPositions.contains(pos) && !deactivatedSpawnerPositions.contains(pos) && !spawnerPositions.contains(pos)){
+ if (airChecker.get() && (spawner.getLogic().spawnDelay == 20 || spawner.getLogic().spawnDelay == 0)){
+ boolean airFound = false;
+ boolean caveAirFound = false;
+ if (monster != null && !scannedPositions.contains(pos)){
+ if (monster.contains("zombie") || monster.contains("skeleton") || monster.contains(":spider")) {
+ for (int x = -2; x < 2; x++) {
+ for (int y = -1; y < 3; y++) {
+ for (int z = -2; z < 2; z++) {
+ BlockPos bpos = new BlockPos(pos.getX()+x,pos.getY()+y,pos.getZ()+z);
+ if (mc.world.getBlockState(bpos).getBlock() == Blocks.AIR) airFound = true;
+ if (mc.world.getBlockState(bpos).getBlock() == Blocks.CAVE_AIR) caveAirFound = true;
+ if (caveAirFound && airFound) break;
+ }
+ }
+ }
+ if (caveAirFound && airFound) {
+ spawnerPositions.add(pos);
+ activatedSpawnerFound = true;
+ if (monster == ":spider") displayMessage("dungeon", pos, ":spider");
+ else displayMessage("dungeon", pos, "null");
}
} else if (monster.contains("cave_spider")) {
- if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cMINESHAFT§r Spawner! Block Position: " + pos));
- else ChatUtils.sendMsg(Text.of("Detected Activated §cMINESHAFT§r Spawner!"));
+ for (int x = -1; x < 2; x++) {
+ for (int y = 0; y < 2; y++) {
+ for (int z = -1; z < 2; z++) {
+ BlockPos bpos = new BlockPos(pos.getX()+x,pos.getY()+y,pos.getZ()+z);
+ if (mc.world.getBlockState(bpos).getBlock() == Blocks.AIR) airFound = true;
+ if (mc.world.getBlockState(bpos).getBlock() == Blocks.CAVE_AIR) caveAirFound = true;
+ if (caveAirFound && airFound) break;
+ }
+ }
+ }
+ if (caveAirFound && airFound) {
+ spawnerPositions.add(pos);
+ activatedSpawnerFound = true;
+ displayMessage("cave_spider", pos, "null");
+ }
} else if (monster.contains("silverfish")) {
- if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cSTRONGHOLD§r Spawner! Block Position: " + pos));
- else ChatUtils.sendMsg(Text.of("Detected Activated §cSTRONGHOLD§r Spawner!"));
- } else if (monster.contains("blaze")) {
- if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cFORTRESS§r Spawner! Block Position: " + pos));
- else ChatUtils.sendMsg(Text.of("Detected Activated §cFORTRESS§r Spawner!"));
- } else if (monster.contains("magma")) {
- if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cBASTION§r Spawner! Block Position: " + pos));
- else ChatUtils.sendMsg(Text.of("Detected Activated §cBASTION§r Spawner!"));
+ for (int x = -3; x < 3+1; x++) {
+ for (int y = -2; y < 3+1; y++) {
+ for (int z = -3; z < 3+1; z++) {
+ BlockPos bpos = new BlockPos(pos.getX()+x,pos.getY()+y,pos.getZ()+z);
+ if (mc.world.getBlockState(bpos).getBlock() == Blocks.AIR) airFound = true;
+ if (mc.world.getBlockState(bpos).getBlock() == Blocks.CAVE_AIR) caveAirFound = true;
+ if (caveAirFound && airFound) break;
+ }
+ }
+ }
+ if (caveAirFound && airFound) {
+ spawnerPositions.add(pos);
+ activatedSpawnerFound = true;
+ displayMessage("silverfish", pos, "null");
+ }
+ }
+ }
+ scannedPositions.add(pos);
+ } else if (spawner.getLogic().spawnDelay != 20) {
+ if (mc.world.getRegistryKey() == World.NETHER && spawner.getLogic().spawnDelay == 0) return;
+ if (chatFeedback.get()) {
+ if (monster != null){
+ if (monster.contains("zombie") || monster.contains("skeleton") || monster.contains(":spider")) {
+ if (monster == ":spider") displayMessage("dungeon", pos, ":spider");
+ else displayMessage("dungeon", pos, "null");
+ } else if (monster.contains("cave_spider")) {
+ displayMessage("cave_spider", pos, "null");
+ } else if (monster.contains("silverfish")) {
+ displayMessage("silverfish", pos, "null");
+ } else if (monster.contains("blaze")) {
+ displayMessage("blaze", pos, "null");
+ } else if (monster.contains("magma")) {
+ displayMessage("magma", pos, "null");
+ } else {
+ if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated Spawner! Block Position: " + pos));
+ else ChatUtils.sendMsg(Text.of("Detected Activated Spawner!"));
+ }
} else {
if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated Spawner! Block Position: " + pos));
else ChatUtils.sendMsg(Text.of("Detected Activated Spawner!"));
}
- } else {
- if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated Spawner! Block Position: " + pos));
- else ChatUtils.sendMsg(Text.of("Detected Activated Spawner!"));
}
- } else {
- if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated Spawner! Block Position: " + pos));
- else ChatUtils.sendMsg(Text.of("Detected Activated Spawner!"));
+ spawnerPositions.add(pos);
+ activatedSpawnerFound = true;
}
-
- spawnerPositions.add(pos);
- if (deactivatedSpawner.get()){
- boolean lightsFound = false;
- for (int x = -deactivatedSpawnerdistance.get(); x < deactivatedSpawnerdistance.get()+1; x++) {
- for (int y = -deactivatedSpawnerdistance.get(); y < deactivatedSpawnerdistance.get()+1; y++) {
- for (int z = -deactivatedSpawnerdistance.get(); z < deactivatedSpawnerdistance.get()+1; z++) {
- BlockPos bpos = new BlockPos(pos.getX()+x,pos.getY()+y,pos.getZ()+z);
- if (mc.world.getBlockState(bpos).getBlock() == Blocks.TORCH || mc.world.getBlockState(bpos).getBlock() == Blocks.SOUL_TORCH || mc.world.getBlockState(bpos).getBlock() == Blocks.REDSTONE_TORCH || mc.world.getBlockState(bpos).getBlock() == Blocks.JACK_O_LANTERN || mc.world.getBlockState(bpos).getBlock() == Blocks.GLOWSTONE || mc.world.getBlockState(bpos).getBlock() == Blocks.SHROOMLIGHT || mc.world.getBlockState(bpos).getBlock() == Blocks.OCHRE_FROGLIGHT || mc.world.getBlockState(bpos).getBlock() == Blocks.PEARLESCENT_FROGLIGHT || mc.world.getBlockState(bpos).getBlock() == Blocks.PEARLESCENT_FROGLIGHT || mc.world.getBlockState(bpos).getBlock() == Blocks.SEA_LANTERN || mc.world.getBlockState(bpos).getBlock() == Blocks.LANTERN || mc.world.getBlockState(bpos).getBlock() == Blocks.SOUL_LANTERN || mc.world.getBlockState(bpos).getBlock() == Blocks.CAMPFIRE || mc.world.getBlockState(bpos).getBlock() == Blocks.SOUL_CAMPFIRE){
- lightsFound = true;
- deactivatedSpawnerPositions.add(pos);
- break;
+ if (activatedSpawnerFound == true) {
+ if (deactivatedSpawner.get()){
+ boolean lightsFound = false;
+ for (int x = -deactivatedSpawnerdistance.get(); x < deactivatedSpawnerdistance.get()+1; x++) {
+ for (int y = -deactivatedSpawnerdistance.get(); y < deactivatedSpawnerdistance.get()+1; y++) {
+ for (int z = -deactivatedSpawnerdistance.get(); z < deactivatedSpawnerdistance.get()+1; z++) {
+ BlockPos bpos = new BlockPos(pos.getX()+x,pos.getY()+y,pos.getZ()+z);
+ if (mc.world.getBlockState(bpos).getBlock() == Blocks.TORCH || mc.world.getBlockState(bpos).getBlock() == Blocks.SOUL_TORCH || mc.world.getBlockState(bpos).getBlock() == Blocks.REDSTONE_TORCH || mc.world.getBlockState(bpos).getBlock() == Blocks.JACK_O_LANTERN || mc.world.getBlockState(bpos).getBlock() == Blocks.GLOWSTONE || mc.world.getBlockState(bpos).getBlock() == Blocks.SHROOMLIGHT || mc.world.getBlockState(bpos).getBlock() == Blocks.OCHRE_FROGLIGHT || mc.world.getBlockState(bpos).getBlock() == Blocks.PEARLESCENT_FROGLIGHT || mc.world.getBlockState(bpos).getBlock() == Blocks.PEARLESCENT_FROGLIGHT || mc.world.getBlockState(bpos).getBlock() == Blocks.SEA_LANTERN || mc.world.getBlockState(bpos).getBlock() == Blocks.LANTERN || mc.world.getBlockState(bpos).getBlock() == Blocks.SOUL_LANTERN || mc.world.getBlockState(bpos).getBlock() == Blocks.CAMPFIRE || mc.world.getBlockState(bpos).getBlock() == Blocks.SOUL_CAMPFIRE){
+ lightsFound = true;
+ deactivatedSpawnerPositions.add(pos);
+ break;
+ }
}
}
}
+ if (chatFeedback.get() && lightsFound == true) ChatUtils.sendMsg(Text.of("The Spawner has torches or other light blocks!"));
}
- if (lightsFound == true) ChatUtils.sendMsg(Text.of("The Spawner has torches or other light blocks!"));
- }
- boolean chestfound = false;
- for (int x = -16; x < 17; x++) {
- for (int y = -16; y < 17; y++) {
- for (int z = -16; z < 17; z++) {
- BlockPos bpos = new BlockPos(pos.getX()+x, pos.getY()+y, pos.getZ()+z);
- if (blocks.get().contains(mc.world.getBlockState(bpos).getBlock())) {
- chestfound = true;
- break;
- }
- Box box = new Box(bpos);
- List minecarts = mc.world.getEntitiesByClass(ChestMinecartEntity.class, box, entity -> true);
- if (!minecarts.isEmpty()) {
- chestfound = true;
- break;
+
+ boolean chestfound = false;
+ for (int x = -16; x < 17; x++) {
+ for (int y = -16; y < 17; y++) {
+ for (int z = -16; z < 17; z++) {
+ BlockPos bpos = new BlockPos(pos.getX()+x, pos.getY()+y, pos.getZ()+z);
+ if (blocks.get().contains(mc.world.getBlockState(bpos).getBlock())) {
+ chestfound = true;
+ break;
+ }
+ Box box = new Box(bpos);
+ List minecarts = mc.world.getEntitiesByClass(ChestMinecartEntity.class, box, entity -> true);
+ if (!minecarts.isEmpty()) {
+ chestfound = true;
+ break;
+ }
}
+ if (chestfound) break;
}
if (chestfound) break;
}
- if (chestfound) break;
- }
- if (!chestfound && lessRenderSpam.get()){
- spawnerPositions.remove(pos);
- noRenderPositions.add(pos);
+ if (!chestfound && lessRenderSpam.get()){
+ noRenderPositions.add(pos);
+ }
+ if (chatFeedback.get()) {
+ if (lessSpam.get() && chestfound && extramessage.get()) error("There may be stashed items in the storage near the spawners!");
+ else if (!lessSpam.get() && extramessage.get()) error("There may be stashed items in the storage near the spawners!");
+ }
}
- if (lessSpam.get() && chestfound && extramessage.get()) error("There may be stashed items in the storage near the spawners!");
- else if (!lessSpam.get() && extramessage.get()) error("There may be stashed items in the storage near the spawners!");
}
}
if (blockEntity instanceof TrialSpawnerBlockEntity){
@@ -309,8 +403,10 @@ private void onPreTick(TickEvent.Pre event) {
BlockPos tPos = trialspawner.getPos();
BlockPos playerPos = new BlockPos(mc.player.getBlockX(), tPos.getY(), mc.player.getBlockZ());
if (playerPos.isWithinDistance(tPos, renderDistance.get() * 16) && trialSpawner.get() && !trialspawnerPositions.contains(tPos) && !noRenderPositions.contains(tPos) && !deactivatedSpawnerPositions.contains(tPos) && !spawnerPositions.contains(tPos) && trialspawner.getSpawnerState() != TrialSpawnerState.WAITING_FOR_PLAYERS) {
- if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cTRIAL§r Spawner! Block Position: " + tPos));
- else ChatUtils.sendMsg(Text.of("Detected Activated §cTRIAL§r Spawner!"));
+ if (chatFeedback.get()) {
+ if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cTRIAL§r Spawner! Block Position: " + tPos));
+ else ChatUtils.sendMsg(Text.of("Detected Activated §cTRIAL§r Spawner!"));
+ }
trialspawnerPositions.add(tPos);
boolean chestfound = false;
for (int x = -14; x < 15; x++) {
@@ -333,14 +429,37 @@ private void onPreTick(TickEvent.Pre event) {
if (chestfound) break;
}
if (!chestfound && lessRenderSpam.get()){
- trialspawnerPositions.remove(tPos);
noRenderPositions.add(tPos);
}
- if (lessSpam.get() && chestfound && extramessage.get()) error("There may be stashed items in the storage near the spawners!");
- else if (!lessSpam.get() && extramessage.get()) error("There may be stashed items in the storage near the spawners!");
+ if (chatFeedback.get()) {
+ if (lessSpam.get() && chestfound && extramessage.get()) error("There may be stashed items in the storage near the spawners!");
+ else if (!lessSpam.get() && extramessage.get()) error("There may be stashed items in the storage near the spawners!");
+ }
+ }
+ }
+ }
+ }
+ }
+ if (nearesttrcr.get()){
+ try {
+ Set CombinedPositions = Collections.synchronizedSet(new HashSet<>());
+ CombinedPositions.addAll(spawnerPositions);
+ CombinedPositions.addAll(deactivatedSpawnerPositions);
+ CombinedPositions.addAll(trialspawnerPositions);
+
+ if (CombinedPositions.stream().toList().size() > 0) {
+ for (int b = 0; b < CombinedPositions.stream().toList().size(); b++) {
+ if (SpawnerDistance > Math.sqrt(Math.pow(CombinedPositions.stream().toList().get(b).getX() - mc.player.getBlockX(), 2) + Math.pow(CombinedPositions.stream().toList().get(b).getZ() - mc.player.getBlockZ(), 2))) {
+ closestSpawnerX = Math.round((float) CombinedPositions.stream().toList().get(b).getX());
+ closestSpawnerY = Math.round((float) CombinedPositions.stream().toList().get(b).getY());
+ closestSpawnerZ = Math.round((float) CombinedPositions.stream().toList().get(b).getZ());
+ SpawnerDistance = Math.sqrt(Math.pow(CombinedPositions.stream().toList().get(b).getX() - mc.player.getBlockX(), 2) + Math.pow(CombinedPositions.stream().toList().get(b).getZ() - mc.player.getBlockZ(), 2));
}
}
+ SpawnerDistance = 2000000000;
}
+ } catch (Exception e) {
+ e.printStackTrace();
}
}
if (removerenderdist.get())removeChunksOutsideRenderDistance();
@@ -358,9 +477,18 @@ private void onRender(Render3DEvent event) {
int endX = pos.getX();
int endY = pos.getY();
int endZ = pos.getZ();
- if (rangerendering.get())render(new Box(new Vec3d(startX+17, startY+17, startZ+17), new Vec3d(endX-16, endY-16, endZ-16)), rangeSideColor.get(), rangeLineColor.get(), shapeMode.get(), event);
- if (deactivatedSpawnerPositions.contains(pos)) render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), despawnerSideColor.get(), despawnerLineColor.get(), shapeMode.get(), event);
- else render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), spawnerSideColor.get(), spawnerLineColor.get(), shapeMode.get(), event);
+ if (!nearesttrcr.get()) {
+ if (rangerendering.get() && !lessRenderSpam.get())renderRange(new Box(new Vec3d(startX+17, startY+17, startZ+17), new Vec3d(endX-16, endY-16, endZ-16)), rangeSideColor.get(), rangeLineColor.get(), shapeMode.get(), event);
+ else if (rangerendering.get() && lessRenderSpam.get() && !noRenderPositions.contains(pos))renderRange(new Box(new Vec3d(startX+17, startY+17, startZ+17), new Vec3d(endX-16, endY-16, endZ-16)), rangeSideColor.get(), rangeLineColor.get(), shapeMode.get(), event);
+ if (deactivatedSpawnerPositions.contains(pos)) render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), despawnerSideColor.get(), despawnerLineColor.get(), shapeMode.get(), event);
+ else render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), spawnerSideColor.get(), spawnerLineColor.get(), shapeMode.get(), event);
+ } else if (nearesttrcr.get()) {
+ if (rangerendering.get() && !lessRenderSpam.get())renderRange(new Box(new Vec3d(startX+17, startY+17, startZ+17), new Vec3d(endX-16, endY-16, endZ-16)), rangeSideColor.get(), rangeLineColor.get(), shapeMode.get(), event);
+ else if (rangerendering.get() && lessRenderSpam.get() && !noRenderPositions.contains(pos))renderRange(new Box(new Vec3d(startX+17, startY+17, startZ+17), new Vec3d(endX-16, endY-16, endZ-16)), rangeSideColor.get(), rangeLineColor.get(), shapeMode.get(), event);
+ if (deactivatedSpawnerPositions.contains(pos)) render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), despawnerSideColor.get(), despawnerLineColor.get(), shapeMode.get(), event);
+ else render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), spawnerSideColor.get(), spawnerLineColor.get(), shapeMode.get(), event);
+ render2(new Box(new Vec3d(closestSpawnerX, closestSpawnerY, closestSpawnerZ), new Vec3d (closestSpawnerX, closestSpawnerY, closestSpawnerZ)), spawnerSideColor.get(), spawnerLineColor.get(),ShapeMode.Sides, event);
+ }
}
}
}
@@ -374,21 +502,74 @@ private void onRender(Render3DEvent event) {
int endX = pos.getX();
int endY = pos.getY();
int endZ = pos.getZ();
- if (trialSpawner.get() && rangerendering.get())render(new Box(new Vec3d(startX+15, startY+15, startZ+15), new Vec3d(endX-14, endY-14, endZ-14)), trangeSideColor.get(), trangeLineColor.get(), shapeMode.get(), event);
- if (deactivatedSpawnerPositions.contains(pos)) render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), despawnerSideColor.get(), despawnerLineColor.get(), shapeMode.get(), event);
- else render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), trialSideColor.get(), trialLineColor.get(), shapeMode.get(), event);
+ if (!nearesttrcr.get()) {
+ if (trialSpawner.get() && rangerendering.get() && !lessRenderSpam.get())renderRange(new Box(new Vec3d(startX+15, startY+15, startZ+15), new Vec3d(endX-14, endY-14, endZ-14)), trangeSideColor.get(), trangeLineColor.get(), shapeMode.get(), event);
+ else if (trialSpawner.get() && rangerendering.get() && lessRenderSpam.get() && !noRenderPositions.contains(pos))renderRange(new Box(new Vec3d(startX+15, startY+15, startZ+15), new Vec3d(endX-14, endY-14, endZ-14)), trangeSideColor.get(), trangeLineColor.get(), shapeMode.get(), event);
+ if (deactivatedSpawnerPositions.contains(pos)) render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), despawnerSideColor.get(), despawnerLineColor.get(), shapeMode.get(), event);
+ else render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), trialSideColor.get(), trialLineColor.get(), shapeMode.get(), event);
+ } else if (nearesttrcr.get()) {
+ if (trialSpawner.get() && rangerendering.get() && !lessRenderSpam.get())renderRange(new Box(new Vec3d(startX+15, startY+15, startZ+15), new Vec3d(endX-14, endY-14, endZ-14)), trangeSideColor.get(), trangeLineColor.get(), shapeMode.get(), event);
+ else if (trialSpawner.get() && rangerendering.get() && lessRenderSpam.get() && !noRenderPositions.contains(pos))renderRange(new Box(new Vec3d(startX+15, startY+15, startZ+15), new Vec3d(endX-14, endY-14, endZ-14)), trangeSideColor.get(), trangeLineColor.get(), shapeMode.get(), event);
+ if (deactivatedSpawnerPositions.contains(pos)) render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), despawnerSideColor.get(), despawnerLineColor.get(), shapeMode.get(), event);
+ else render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), trialSideColor.get(), trialLineColor.get(), shapeMode.get(), event);
+ render2(new Box(new Vec3d(closestSpawnerX, closestSpawnerY, closestSpawnerZ), new Vec3d (closestSpawnerX, closestSpawnerY, closestSpawnerZ)), trialSideColor.get(), trialLineColor.get(),ShapeMode.Sides, event);
+ }
}
}
}
}
}
-
+ private void displayMessage(String key, BlockPos pos, String key2) {
+ if (chatFeedback.get()){
+ if (key=="dungeon") {
+ if (key2==":spider") {
+ if (mc.world.getBlockState(pos.down()).getBlock() == Blocks.BIRCH_PLANKS){
+ if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cWOODLAND MANSION§r Spawner! Block Position: " + pos));
+ else ChatUtils.sendMsg(Text.of("Detected Activated §cWOODLAND MANSION§r Spawner!"));
+ } else {
+ if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cDUNGEON§r Spawner! Block Position: " + pos));
+ else ChatUtils.sendMsg(Text.of("Detected Activated §cDUNGEON§r Spawner!"));
+ }
+ } else {
+ if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cDUNGEON§r Spawner! Block Position: " + pos));
+ else ChatUtils.sendMsg(Text.of("Detected Activated §cDUNGEON§r Spawner!"));
+ }
+ } else if (key=="cave_spider") {
+ if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cMINESHAFT§r Spawner! Block Position: " + pos));
+ else ChatUtils.sendMsg(Text.of("Detected Activated §cMINESHAFT§r Spawner!"));
+ } else if (key=="silverfish") {
+ if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cSTRONGHOLD§r Spawner! Block Position: " + pos));
+ else ChatUtils.sendMsg(Text.of("Detected Activated §cSTRONGHOLD§r Spawner!"));
+ } else if (key=="blaze") {
+ if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cFORTRESS§r Spawner! Block Position: " + pos));
+ else ChatUtils.sendMsg(Text.of("Detected Activated §cFORTRESS§r Spawner!"));
+ } else if (key=="magma") {
+ if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated §cBASTION§r Spawner! Block Position: " + pos));
+ else ChatUtils.sendMsg(Text.of("Detected Activated §cBASTION§r Spawner!"));
+ } else {
+ if (displaycoords.get()) ChatUtils.sendMsg(Text.of("Detected Activated Spawner! Block Position: " + pos));
+ else ChatUtils.sendMsg(Text.of("Detected Activated Spawner!"));
+ }
+ }
+ }
private void render(Box box, Color sides, Color lines, ShapeMode shapeMode, Render3DEvent event) {
+ if (trcr.get() && Math.abs(box.minX- RenderUtils.center.x)<=renderDistance.get()*16 && Math.abs(box.minZ-RenderUtils.center.z)<=renderDistance.get()*16)
+ if (!nearesttrcr.get())
+ event.renderer.line(RenderUtils.center.x, RenderUtils.center.y, RenderUtils.center.z, box.minX+0.5, box.minY+((box.maxY-box.minY)/2), box.minZ+0.5, lines);
+ event.renderer.box(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, sides, new Color(0,0,0,0), shapeMode, 0);
+ }
+ private void render2(Box box, Color sides, Color lines, ShapeMode shapeMode, Render3DEvent event) {
+ if (trcr.get() && Math.abs(box.minX-RenderUtils.center.x)<=renderDistance.get()*16 && Math.abs(box.minZ-RenderUtils.center.z)<=renderDistance.get()*16)
+ event.renderer.line(RenderUtils.center.x, RenderUtils.center.y, RenderUtils.center.z, box.minX+0.5, box.minY+((box.maxY-box.minY)/2), box.minZ+0.5, lines);
+ event.renderer.box(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, sides, new Color(0,0,0,0), shapeMode, 0);
+ }
+ private void renderRange(Box box, Color sides, Color lines, ShapeMode shapeMode, Render3DEvent event) {
event.renderer.box(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, sides, lines, shapeMode, 0);
}
private void removeChunksOutsideRenderDistance() {
double renderDistanceBlocks = renderDistance.get() * 16;
+ removeChunksOutsideRenderDistance(scannedPositions, renderDistanceBlocks);
removeChunksOutsideRenderDistance(spawnerPositions, renderDistanceBlocks);
removeChunksOutsideRenderDistance(deactivatedSpawnerPositions, renderDistanceBlocks);
removeChunksOutsideRenderDistance(trialspawnerPositions, renderDistanceBlocks);
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/AirstrikePlus.java b/src/main/java/pwn/noobs/trouserstreak/modules/AirstrikePlus.java
index 3e068189..53c621a7 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/AirstrikePlus.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/AirstrikePlus.java
@@ -124,7 +124,7 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.name("CustomNameVisible")
.description("CustomNameVisible or not.")
.defaultValue(true)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build()
);
private final Setting health = sgnormal.add(new IntSetting.Builder()
@@ -133,7 +133,7 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.defaultValue(1000)
.min(0)
.sliderRange(0, 10000)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build());
private final Setting absorption = sgnormal.add(new IntSetting.Builder()
.name("Absorption Points")
@@ -141,7 +141,7 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.defaultValue(1000)
.min(0)
.sliderRange(0, 10000)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build());
private final Setting age = sgnormal.add(new IntSetting.Builder()
.name("Age")
@@ -149,69 +149,69 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.defaultValue(1)
.min(0)
.sliderRange(0, 100)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build());
public final Setting invincible = sgnormal.add(new BoolSetting.Builder()
.name("Invulnerable")
.description("Invulnerable or not")
.defaultValue(true)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build()
);
public final Setting persist = sgnormal.add(new BoolSetting.Builder()
.name("Never Despawn")
.description("adds PersistenceRequired tag.")
.defaultValue(true)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build()
);
public final Setting noAI = sgnormal.add(new BoolSetting.Builder()
.name("NoAI")
.description("NoAI")
.defaultValue(false)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build()
);
public final Setting falsefire = sgnormal.add(new BoolSetting.Builder()
.name("HasVisualFire")
.description("HasVisualFire or not")
.defaultValue(false)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build()
);
public final Setting nograv = sgnormal.add(new BoolSetting.Builder()
.name("NoGravity")
.description("NoGravity or not")
.defaultValue(false)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build()
);
public final Setting silence = sgnormal.add(new BoolSetting.Builder()
.name("Silent")
.description("adds Silent tag.")
.defaultValue(false)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build()
);
public final Setting glow = sgnormal.add(new BoolSetting.Builder()
.name("Glowing")
.description("Glowing or not")
.defaultValue(false)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build()
);
public final Setting ignite = sgnormal.add(new BoolSetting.Builder()
.name("Ignited")
.description("Pre-ignite creeper or not.")
.defaultValue(true)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build()
);
public final Setting powah = sgnormal.add(new BoolSetting.Builder()
.name("Charged Creeper")
.description("powered creeper or not.")
.defaultValue(false)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build()
);
private final Setting fuse = sgnormal.add(new IntSetting.Builder()
@@ -220,7 +220,7 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.defaultValue(20)
.min(0)
.sliderRange(0, 120)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build());
private final Setting exppower = sgnormal.add(new IntSetting.Builder()
.name("ExplosionPower/Radius")
@@ -228,7 +228,7 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.defaultValue(10)
.min(1)
.sliderMax(127)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build());
private final Setting size = sgnormal.add(new IntSetting.Builder()
.name("Slime/Magma Cube Size")
@@ -236,19 +236,19 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.defaultValue(1)
.min(0)
.sliderRange(0, 100)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build());
private final Setting blockstate = sgnormal.add(new BlockSetting.Builder()
.name("falling_block entity block")
.description("What is created when specifying falling_block as the entity.")
.defaultValue(Blocks.BEDROCK)
- .visible(() -> !airstrikeEveryone.get())
+ .visible(airstrikeEveryone::get)
.build());
public final Setting Ecustomname = sgeveryone.add(new BoolSetting.Builder()
.name("CustomNameVisible")
.description("CustomNameVisible or not.")
.defaultValue(false)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
private final Setting Ehealth = sgeveryone.add(new IntSetting.Builder()
@@ -257,7 +257,7 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.defaultValue(100)
.min(0)
.sliderRange(0, 10000)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build());
private final Setting Eabsorption = sgeveryone.add(new IntSetting.Builder()
.name("Absorption Points")
@@ -265,13 +265,13 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.defaultValue(0)
.min(0)
.sliderRange(0, 10000)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build());
public final Setting EageSpecify = sgeveryone.add(new BoolSetting.Builder()
.name("Specify Age")
.description("Add an Age NBT tag.")
.defaultValue(false)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
private final Setting Eage = sgeveryone.add(new IntSetting.Builder()
@@ -286,63 +286,63 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.name("Invulnerable")
.description("Invulnerable or not")
.defaultValue(true)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
public final Setting Epersist = sgeveryone.add(new BoolSetting.Builder()
.name("Never Despawn")
.description("adds PersistenceRequired tag.")
.defaultValue(false)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
public final Setting EnoAI = sgeveryone.add(new BoolSetting.Builder()
.name("NoAI")
.description("NoAI")
.defaultValue(false)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
public final Setting Efalsefire = sgeveryone.add(new BoolSetting.Builder()
.name("HasVisualFire")
.description("HasVisualFire or not")
.defaultValue(false)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
public final Setting Enograv = sgeveryone.add(new BoolSetting.Builder()
.name("NoGravity")
.description("NoGravity or not")
.defaultValue(false)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
public final Setting Esilence = sgeveryone.add(new BoolSetting.Builder()
.name("Silent")
.description("adds Silent tag.")
.defaultValue(false)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
public final Setting Eglow = sgeveryone.add(new BoolSetting.Builder()
.name("Glowing")
.description("Glowing or not")
.defaultValue(false)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
public final Setting Eignite = sgeveryone.add(new BoolSetting.Builder()
.name("Ignited")
.description("Pre-ignite creeper or not.")
.defaultValue(true)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
public final Setting Epowah = sgeveryone.add(new BoolSetting.Builder()
.name("Charged Creeper")
.description("powered creeper or not.")
.defaultValue(false)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
private final Setting Efuse = sgeveryone.add(new IntSetting.Builder()
@@ -351,7 +351,7 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.defaultValue(20)
.min(0)
.sliderRange(0, 120)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build());
private final Setting Eexppower = sgeveryone.add(new IntSetting.Builder()
.name("ExplosionPower/Radius")
@@ -359,7 +359,7 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.defaultValue(10)
.min(1)
.sliderMax(127)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build());
private final Setting Esize = sgeveryone.add(new IntSetting.Builder()
.name("Slime/Magma Cube Size")
@@ -367,13 +367,13 @@ public enum ColorModes { aqua, black, blue, dark_aqua, dark_blue, dark_gray, dar
.defaultValue(1)
.min(0)
.sliderRange(0, 100)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build());
public final Setting EblockstateSpecify = sgeveryone.add(new BoolSetting.Builder()
.name("Specify falling_block")
.description("Add an NBT tag defining what is the falling block.")
.defaultValue(false)
- .visible(airstrikeEveryone::get)
+ .visible(() -> airstrikeEveryone.get())
.build()
);
private final Setting Eblockstate = sgeveryone.add(new BlockSetting.Builder()
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/AutoCommand.java b/src/main/java/pwn/noobs/trouserstreak/modules/AutoCommand.java
index 50990594..a272fe5b 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/AutoCommand.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/AutoCommand.java
@@ -117,7 +117,7 @@ private void onGameJoin(GameJoinedEvent event) {
@EventHandler
private void onTick(TickEvent.Post event) {
- if (mc.player == null && !mc.player.hasPermissionLevel(permissionLevel.get())) return;
+ if (mc.player == null || !mc.player.hasPermissionLevel(permissionLevel.get())) return;
if (commandQueue.isEmpty()) {
if (sent && !auto.get()) {
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/AutoDrop.java b/src/main/java/pwn/noobs/trouserstreak/modules/AutoDrop.java
index 2d7c0a60..6a708074 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/AutoDrop.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/AutoDrop.java
@@ -28,9 +28,9 @@ public class AutoDrop extends Module {
private final Setting dropslot = sgGeneral.add(new IntSetting.Builder()
.name("DrotSlot#")
.description("Drops this Slot if items are in it.")
- .sliderRange(1,9)
- .min(1)
- .max(9)
+ .sliderRange(1,9)
+ .min(1)
+ .max(9)
.defaultValue(1)
.visible(dropthisslot::get)
.build());
@@ -44,9 +44,9 @@ private void onPreTick(TickEvent.Pre event) {
if (mc.player == null) return;
if (tool.get() && (mc.player.getMainHandStack().getItem() instanceof BucketItem || mc.player.getMainHandStack().getItem() instanceof FlintAndSteelItem || mc.player.getMainHandStack().getItem() instanceof MiningToolItem || mc.player.getMainHandStack().getItem() instanceof ShearsItem))return;
if (dropthisslot.get() && !mc.player.getInventory().getStack(dropslot.get()-1).isEmpty()){
- previousslot=mc.player.getInventory().selectedSlot;
- mc.player.getInventory().selectedSlot = dropslot.get()-1;
- getprevslot=true;
+ previousslot=mc.player.getInventory().selectedSlot;
+ mc.player.getInventory().selectedSlot = dropslot.get()-1;
+ getprevslot=true;
}else if (!dropthisslot.get()) mc.player.dropSelectedItem(true);
}
@EventHandler
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/AutoLavaCaster.java b/src/main/java/pwn/noobs/trouserstreak/modules/AutoLavaCaster.java
index 5f401685..a4261da4 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/AutoLavaCaster.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/AutoLavaCaster.java
@@ -215,7 +215,6 @@ public AutoLavaCaster() {
int layers;
@Override
public void onActivate() {
- if (mc.player == null) return;
mc.player.setNoGravity(false);
if (Modules.get().get(Flight.class).isActive()) {
Modules.get().get(Flight.class).toggle();
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java b/src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java
index 56d22b57..ed994416 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java
@@ -84,6 +84,18 @@ public class BaseFinder extends Module {
private final SettingGroup sgRender = settings.createGroup("Render");
// general
+ private final Setting chatFeedback = sgGeneral.add(new BoolSetting.Builder()
+ .name("Chat feedback")
+ .description("Displays info for you.")
+ .defaultValue(true)
+ .build()
+ );
+ private final Setting displaycoords = sgGeneral.add(new BoolSetting.Builder()
+ .name("DisplayCoords")
+ .description("Displays coords of air disturbances in chat.")
+ .defaultValue(true)
+ .build()
+ );
private final Setting minY = sgGeneral.add(new IntSetting.Builder()
.name("Detection Y Minimum OffSet")
.description("Scans blocks above or at this this many blocks from minimum build limit.")
@@ -842,7 +854,10 @@ else if (basefoundspamTicks >= bsefndtickdelay.get()) {
saveBaseChunkData(chunk.getPos());
}
if (basefoundspamTicks == 0) {
- ChatUtils.sendMsg(Text.of("Item Frame located near X" + entity.getPos().getX() + ", Y" + entity.getPos().getY() + ", Z" + entity.getPos().getZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("Item Frame located near X" + entity.getPos().getX() + ", Y" + entity.getPos().getY() + ", Z" + entity.getPos().getZ()));
+ else ChatUtils.sendMsg(Text.of("Item Frame located!"));
+ }
LastBaseFound = new ChunkPos(chunk.getPos().x, chunk.getPos().z);
basefound = true;
}
@@ -853,7 +868,10 @@ else if (basefoundspamTicks >= bsefndtickdelay.get()) {
saveBaseChunkData(chunk.getPos());
}
if (basefoundspamTicks == 0) {
- ChatUtils.sendMsg(Text.of("Ender Pearl located near X" + entity.getPos().getX() + ", Y" + entity.getPos().getY() + ", Z" + entity.getPos().getZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("Ender Pearl located near X" + entity.getPos().getX() + ", Y" + entity.getPos().getY() + ", Z" + entity.getPos().getZ()));
+ else ChatUtils.sendMsg(Text.of("Ender Pearl located!"));
+ }
LastBaseFound = new ChunkPos(chunk.getPos().x, chunk.getPos().z);
basefound = true;
}
@@ -864,7 +882,10 @@ else if (basefoundspamTicks >= bsefndtickdelay.get()) {
saveBaseChunkData(chunk.getPos());
}
if (basefoundspamTicks == 0) {
- ChatUtils.sendMsg(Text.of("Illegal Villager located near X" + entity.getPos().getX() + ", Y" + entity.getPos().getY() + ", Z" + entity.getPos().getZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("Illegal Villager located near X" + entity.getPos().getX() + ", Y" + entity.getPos().getY() + ", Z" + entity.getPos().getZ()));
+ else ChatUtils.sendMsg(Text.of("Illegal Villager located!"));
+ }
LastBaseFound = new ChunkPos(chunk.getPos().x, chunk.getPos().z);
basefound = true;
}
@@ -875,7 +896,10 @@ else if (basefoundspamTicks >= bsefndtickdelay.get()) {
saveBaseChunkData(chunk.getPos());
}
if (basefoundspamTicks == 0) {
- ChatUtils.sendMsg(Text.of("NameTagged Entity located near X" + entity.getPos().getX() + ", Y" + entity.getPos().getY() + ", Z" + entity.getPos().getZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("NameTagged Entity located near X" + entity.getPos().getX() + ", Y" + entity.getPos().getY() + ", Z" + entity.getPos().getZ()));
+ else ChatUtils.sendMsg(Text.of("NameTagged Entity located!"));
+ }
LastBaseFound = new ChunkPos(chunk.getPos().x, chunk.getPos().z);
basefound = true;
}
@@ -885,7 +909,10 @@ else if (basefoundspamTicks >= bsefndtickdelay.get()) {
saveBaseChunkData(chunk.getPos());
}
if (basefoundspamTicks == 0) {
- ChatUtils.sendMsg(Text.of("Illegal Boat located near X" + entity.getPos().getX() + ", Y" + entity.getPos().getY() + ", Z" + entity.getPos().getZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("Illegal Boat located near X" + entity.getPos().getX() + ", Y" + entity.getPos().getY() + ", Z" + entity.getPos().getZ()));
+ else ChatUtils.sendMsg(Text.of("Illegal Boat located!"));
+ }
LastBaseFound = new ChunkPos(chunk.getPos().x, chunk.getPos().z);
basefound = true;
}
@@ -899,7 +926,10 @@ else if (basefoundspamTicks >= bsefndtickdelay.get()) {
saveBaseChunkData(chunk.getPos());
}
if (basefoundspamTicks == 0) {
- ChatUtils.sendMsg(Text.of("Illegal amount of entities located near X" + chunk.getPos().getCenterX() + ", Z" + chunk.getPos().getCenterZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("Illegal amount of entities located near X" + chunk.getPos().getCenterX() + ", Z" + chunk.getPos().getCenterZ()));
+ else ChatUtils.sendMsg(Text.of("Illegal amount of entities located!"));
+ }
LastBaseFound = new ChunkPos(chunk.getPos().x, chunk.getPos().z);
basefound = true;
}
@@ -1043,7 +1073,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
if (basefoundspamTicks==0){
- ChatUtils.sendMsg(Text.of("Written Sign located near X"+blockEntity.getPos().getX()+", Y"+blockEntity.getPos().getY()+", Z"+blockEntity.getPos().getZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("Written Sign located near X"+blockEntity.getPos().getX()+", Y"+blockEntity.getPos().getY()+", Z"+blockEntity.getPos().getZ()));
+ else ChatUtils.sendMsg(Text.of("Written Sign located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1057,7 +1090,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
if (basefoundspamTicks==0){
- ChatUtils.sendMsg(Text.of("(Skybuild)Possible build located near X"+basepos.getCenterX()+", Y"+currentY+", Z"+basepos.getCenterZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(Skybuild)Possible build located near X"+basepos.getCenterX()+", Y"+currentY+", Z"+basepos.getCenterZ()));
+ else ChatUtils.sendMsg(Text.of("(Skybuild)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1070,7 +1106,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
if (basefoundspamTicks==0){
- ChatUtils.sendMsg(Text.of("(Bubble Column)Possible build located near X"+basepos.getCenterX()+", Y"+currentY+", Z"+basepos.getCenterZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(Bubble Column)Possible build located near X"+basepos.getCenterX()+", Y"+currentY+", Z"+basepos.getCenterZ()));
+ else ChatUtils.sendMsg(Text.of("(Bubble Column)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1083,7 +1122,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
if (basefoundspamTicks==0){
- ChatUtils.sendMsg(Text.of("(Open Portal)Possible build located near X"+basepos.getCenterX()+", Y"+currentY+", Z"+basepos.getCenterZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(Open Portal)Possible build located near X"+basepos.getCenterX()+", Y"+currentY+", Z"+basepos.getCenterZ()));
+ else ChatUtils.sendMsg(Text.of("(Open Portal)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1096,7 +1138,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
if (basefoundspamTicks==0){
- ChatUtils.sendMsg(Text.of("(Unnatural Bedrock)Possible build located near X"+basepos.getCenterX()+", Y"+currentY+", Z"+basepos.getCenterZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(Unnatural Bedrock)Possible build located near X"+basepos.getCenterX()+", Y"+currentY+", Z"+basepos.getCenterZ()));
+ else ChatUtils.sendMsg(Text.of("(Unnatural Bedrock)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1109,7 +1154,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
if (basefoundspamTicks==0){
- ChatUtils.sendMsg(Text.of("(Nether Roof)Possible build located near X"+basepos.getCenterX()+", Y"+currentY+", Z"+basepos.getCenterZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(Nether Roof)Possible build located near X"+basepos.getCenterX()+", Y"+currentY+", Z"+basepos.getCenterZ()));
+ else ChatUtils.sendMsg(Text.of("(Nether Roof)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1196,7 +1244,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
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 + ")"));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(List1)Possible build located near X" + basepos.getCenterX() + ", Y" + blockpositions1.stream().toList().get(0).getY() + ", Z" + basepos.getCenterZ() + " (" + lastblockfound1 + ")"));
+ else ChatUtils.sendMsg(Text.of("(List1)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1220,7 +1271,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
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 + ")"));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(List2)Possible build located near X" + basepos.getCenterX() + ", Y" + blockpositions2.stream().toList().get(0).getY() + ", Z" + basepos.getCenterZ() + " (" + lastblockfound2 + ")"));
+ else ChatUtils.sendMsg(Text.of("(List2)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1244,7 +1298,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
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 + ")"));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(List3)Possible build located near X" + basepos.getCenterX() + ", Y" + blockpositions3.stream().toList().get(0).getY() + ", Z" + basepos.getCenterZ() + " (" + lastblockfound3 + ")"));
+ else ChatUtils.sendMsg(Text.of("(List3)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1268,7 +1325,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
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 + ")"));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(List4)Possible build located near X" + basepos.getCenterX() + ", Y" + blockpositions4.stream().toList().get(0).getY() + ", Z" + basepos.getCenterZ() + " (" + lastblockfound4 + ")"));
+ else ChatUtils.sendMsg(Text.of("(List4)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1292,7 +1352,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
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+")"));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(List5)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions5.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound5+")"));
+ else ChatUtils.sendMsg(Text.of("(List5)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1316,7 +1379,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
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+")"));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(List6)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions6.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound6+")"));
+ else ChatUtils.sendMsg(Text.of("(List6)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1340,7 +1406,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
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+")"));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("(List7)Possible build located near X"+basepos.getCenterX()+", Y"+blockpositions7.stream().toList().get(0).getY()+", Z"+basepos.getCenterZ()+" ("+lastblockfound7+")"));
+ else ChatUtils.sendMsg(Text.of("(List7)Possible build located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
@@ -1366,7 +1435,10 @@ private void onReadPacket(PacketEvent.Receive event) {
saveBaseChunkData(basepos);
}
if (basefoundspamTicks== 0) {
- ChatUtils.sendMsg(Text.of("Possible modified spawner located near X"+basepos.getCenterX()+", Y"+spawnerY+", Z"+basepos.getCenterZ()));
+ if (chatFeedback.get()){
+ if (displaycoords.get())ChatUtils.sendMsg(Text.of("Possible modified spawner located near X"+basepos.getCenterX()+", Y"+spawnerY+", Z"+basepos.getCenterZ()));
+ else ChatUtils.sendMsg(Text.of("Possible modified spawner located!"));
+ }
LastBaseFound= new ChunkPos(basepos.x, basepos.z);
basefound=true;
}
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/BetterScaffold.java b/src/main/java/pwn/noobs/trouserstreak/modules/BetterScaffold.java
index 0ea86c24..66da303c 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/BetterScaffold.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/BetterScaffold.java
@@ -38,17 +38,17 @@ public class BetterScaffold extends Module {
private final SettingGroup sgRender = settings.createGroup("Render");
private final Setting> blocks = sgGeneral.add(new BlockListSetting.Builder()
- .name("blocks")
- .description("Selected blocks.")
+ .name("blocks")
+ .description("Selected blocks.")
.defaultValue(Blocks.TNT)
.build()
);
private final Setting blocksFilter = sgGeneral.add(new EnumSetting.Builder()
- .name("blocks-filter")
- .description("How to use the block list setting")
- .defaultValue(ListMode.Whitelist)
- .build()
+ .name("blocks-filter")
+ .description("How to use the block list setting")
+ .defaultValue(ListMode.Whitelist)
+ .build()
);
private final Setting placementMode = sgGeneral.add(new EnumSetting.Builder()
.name("Placement Mode")
@@ -72,74 +72,74 @@ public class BetterScaffold extends Module {
.build()
);
private final Setting fastTower = sgGeneral.add(new BoolSetting.Builder()
- .name("fast-tower")
- .description("Whether or not to scaffold upwards faster.")
- .defaultValue(false)
- .build()
+ .name("fast-tower")
+ .description("Whether or not to scaffold upwards faster.")
+ .defaultValue(false)
+ .build()
);
private final Setting renderSwing = sgGeneral.add(new BoolSetting.Builder()
- .name("swing")
- .description("Renders your client-side swing.")
- .defaultValue(false)
- .build()
+ .name("swing")
+ .description("Renders your client-side swing.")
+ .defaultValue(false)
+ .build()
);
private final Setting autoSwitch = sgGeneral.add(new BoolSetting.Builder()
- .name("auto-switch")
- .description("Automatically swaps to a block before placing.")
- .defaultValue(true)
- .build()
+ .name("auto-switch")
+ .description("Automatically swaps to a block before placing.")
+ .defaultValue(true)
+ .build()
);
private final Setting rotate = sgGeneral.add(new BoolSetting.Builder()
- .name("rotate")
- .description("Rotates towards the blocks being placed.")
- .defaultValue(true)
- .build()
+ .name("rotate")
+ .description("Rotates towards the blocks being placed.")
+ .defaultValue(true)
+ .build()
);
private final Setting airPlace = sgGeneral.add(new BoolSetting.Builder()
- .name("air-place")
- .description("Allow air place.")
- .defaultValue(true)
- .build()
+ .name("air-place")
+ .description("Allow air place.")
+ .defaultValue(true)
+ .build()
);
private final Setting placeRange = sgGeneral.add(new DoubleSetting.Builder()
- .name("closest-block-range")
- .description("How far can scaffold place blocks.")
- .defaultValue(4)
- .min(0)
- .sliderMax(8)
- .visible(() -> !airPlace.get())
- .build()
+ .name("closest-block-range")
+ .description("How far can scaffold place blocks.")
+ .defaultValue(4)
+ .min(0)
+ .sliderMax(8)
+ .visible(() -> !airPlace.get())
+ .build()
);
private final Setting onSurface = sgGeneral.add(new BoolSetting.Builder()
- .name("on-surface")
- .description("Places horizontal and vertical blocks when already standing on a block.")
- .defaultValue(true)
- .build()
+ .name("on-surface")
+ .description("Places horizontal and vertical blocks when already standing on a block.")
+ .defaultValue(true)
+ .build()
);
private final Setting horizontalRadius = sgGeneral.add(new IntSetting.Builder()
- .name("horizontal-radius")
- .description("How far scaffold should place blocks horizontally.")
- .defaultValue(1)
- .min(1)
- .sliderMin(1)
- .sliderMax(8)
- .build()
+ .name("horizontal-radius")
+ .description("How far scaffold should place blocks horizontally.")
+ .defaultValue(1)
+ .min(1)
+ .sliderMin(1)
+ .sliderMax(8)
+ .build()
);
private final Setting verticalRadius = sgGeneral.add(new IntSetting.Builder()
- .name("vertical-radius")
- .description("How far scaffold should place blocks vertically.")
- .defaultValue(1)
- .min(1)
- .sliderMin(1)
- .sliderMax(8)
- .build()
+ .name("vertical-radius")
+ .description("How far scaffold should place blocks vertically.")
+ .defaultValue(1)
+ .min(1)
+ .sliderMin(1)
+ .sliderMax(8)
+ .build()
);
private final Setting aboveHeadDistance = sgGeneral.add(new IntSetting.Builder()
.name("distance-above-head")
@@ -155,24 +155,24 @@ public class BetterScaffold extends Module {
// Render
private final Setting shapeMode = sgRender.add(new EnumSetting.Builder()
- .name("shape-mode")
- .description("How the shapes are rendered.")
- .defaultValue(ShapeMode.Both)
- .build()
+ .name("shape-mode")
+ .description("How the shapes are rendered.")
+ .defaultValue(ShapeMode.Both)
+ .build()
);
private final Setting sideColor = sgRender.add(new ColorSetting.Builder()
- .name("side-color")
- .description("The side color of the target block rendering.")
- .defaultValue(new SettingColor(197, 137, 232, 10))
- .build()
+ .name("side-color")
+ .description("The side color of the target block rendering.")
+ .defaultValue(new SettingColor(197, 137, 232, 10))
+ .build()
);
private final Setting lineColor = sgRender.add(new ColorSetting.Builder()
- .name("line-color")
- .description("The line color of the target block rendering.")
- .defaultValue(new SettingColor(197, 137, 232))
- .build()
+ .name("line-color")
+ .description("The line color of the target block rendering.")
+ .defaultValue(new SettingColor(197, 137, 232))
+ .build()
);
private final Pool renderBlockPool = new Pool<>(RenderBlock::new);
@@ -252,8 +252,8 @@ private void onTick(TickEvent.Pre event) {
}
Vec3d vecPrevBP = new Vec3d((double) prevBp.getX() + 0.5f,
- (double) prevBp.getY() + 0.5f,
- (double) prevBp.getZ() + 0.5f);
+ (double) prevBp.getY() + 0.5f,
+ (double) prevBp.getZ() + 0.5f);
Vec3d sub = pos.subtract(vecPrevBP);
Direction facing;
@@ -367,59 +367,59 @@ private void horizontalAndVertical(BlockPos.Mutable bp, FindItemResult item) {
}
}
- if(horizontalRadius.get() > 1) {
-
- for (int v = 0; v < verticalRadius.get(); v++) {
- int vOffset;
- if (placementMode.get() == PlaceMode.BelowFeet) {
- vOffset = -v;
- } else if (placementMode.get() == PlaceMode.AboveHead) {
- vOffset = v + aboveHeadDistance.get()+2;
- } else {
- continue; // Skip the loop iteration if the placement mode is not valid
- }
-
- for (int h = 1; h < horizontalRadius.get(); h++) {
- for (int d = -h + 1; d <= h - 1; d++) {
- //Front
- if (BlockUtils.place(bp.add(h, vOffset, d), item, rotate.get(), 50, renderSwing.get(), true)) {
- renderBlocks.add(renderBlockPool.get().set(bp.add(h, vOffset, d)));
- }
- //Back
- if (BlockUtils.place(bp.add(-h, vOffset, d), item, rotate.get(), 50, renderSwing.get(), true)) {
- renderBlocks.add(renderBlockPool.get().set(bp.add(-h, vOffset, d)));
- }
-
- //Left
- if (BlockUtils.place(bp.add(d, vOffset, h), item, rotate.get(), 50, renderSwing.get(), true)) {
- renderBlocks.add(renderBlockPool.get().set(bp.add(d, vOffset, h)));
- }
-
- //Right
- if (BlockUtils.place(bp.add(d, vOffset, -h), item, rotate.get(), 50, renderSwing.get(), true)) {
- renderBlocks.add(renderBlockPool.get().set(bp.add(d, vOffset, -h)));
- }
- }
- //Diagonals
- if (BlockUtils.place(bp.add(h, vOffset, -h), item, rotate.get(), 50, renderSwing.get(), true)) {
- renderBlocks.add(renderBlockPool.get().set(bp.add(h, vOffset, -h)));
- }
-
- if (BlockUtils.place(bp.add(-h, vOffset, h), item, rotate.get(), 50, renderSwing.get(), true)) {
- renderBlocks.add(renderBlockPool.get().set(bp.add(-h, vOffset, h)));
- }
-
- if (BlockUtils.place(bp.add(h, vOffset, h), item, rotate.get(), 50, renderSwing.get(), true)) {
- renderBlocks.add(renderBlockPool.get().set(bp.add(h, vOffset, h)));
- }
-
- if (BlockUtils.place(bp.add(-h, vOffset, -h), item, rotate.get(), 50, renderSwing.get(), true)) {
- renderBlocks.add(renderBlockPool.get().set(bp.add(-h, vOffset, -h)));
- }
-
- }
- }
- }
+ if(horizontalRadius.get() > 1) {
+
+ for (int v = 0; v < verticalRadius.get(); v++) {
+ int vOffset;
+ if (placementMode.get() == PlaceMode.BelowFeet) {
+ vOffset = -v;
+ } else if (placementMode.get() == PlaceMode.AboveHead) {
+ vOffset = v + aboveHeadDistance.get()+2;
+ } else {
+ continue; // Skip the loop iteration if the placement mode is not valid
+ }
+
+ for (int h = 1; h < horizontalRadius.get(); h++) {
+ for (int d = -h + 1; d <= h - 1; d++) {
+ //Front
+ if (BlockUtils.place(bp.add(h, vOffset, d), item, rotate.get(), 50, renderSwing.get(), true)) {
+ renderBlocks.add(renderBlockPool.get().set(bp.add(h, vOffset, d)));
+ }
+ //Back
+ if (BlockUtils.place(bp.add(-h, vOffset, d), item, rotate.get(), 50, renderSwing.get(), true)) {
+ renderBlocks.add(renderBlockPool.get().set(bp.add(-h, vOffset, d)));
+ }
+
+ //Left
+ if (BlockUtils.place(bp.add(d, vOffset, h), item, rotate.get(), 50, renderSwing.get(), true)) {
+ renderBlocks.add(renderBlockPool.get().set(bp.add(d, vOffset, h)));
+ }
+
+ //Right
+ if (BlockUtils.place(bp.add(d, vOffset, -h), item, rotate.get(), 50, renderSwing.get(), true)) {
+ renderBlocks.add(renderBlockPool.get().set(bp.add(d, vOffset, -h)));
+ }
+ }
+ //Diagonals
+ if (BlockUtils.place(bp.add(h, vOffset, -h), item, rotate.get(), 50, renderSwing.get(), true)) {
+ renderBlocks.add(renderBlockPool.get().set(bp.add(h, vOffset, -h)));
+ }
+
+ if (BlockUtils.place(bp.add(-h, vOffset, h), item, rotate.get(), 50, renderSwing.get(), true)) {
+ renderBlocks.add(renderBlockPool.get().set(bp.add(-h, vOffset, h)));
+ }
+
+ if (BlockUtils.place(bp.add(h, vOffset, h), item, rotate.get(), 50, renderSwing.get(), true)) {
+ renderBlocks.add(renderBlockPool.get().set(bp.add(h, vOffset, h)));
+ }
+
+ if (BlockUtils.place(bp.add(-h, vOffset, -h), item, rotate.get(), 50, renderSwing.get(), true)) {
+ renderBlocks.add(renderBlockPool.get().set(bp.add(-h, vOffset, -h)));
+ }
+
+ }
+ }
+ }
}
@EventHandler
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/CaveDisturbanceDetector.java b/src/main/java/pwn/noobs/trouserstreak/modules/CaveDisturbanceDetector.java
new file mode 100644
index 00000000..a6eb3618
--- /dev/null
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/CaveDisturbanceDetector.java
@@ -0,0 +1,423 @@
+//made by etianl :D
+package pwn.noobs.trouserstreak.modules;
+
+import meteordevelopment.meteorclient.events.game.GameLeftEvent;
+import meteordevelopment.meteorclient.events.game.OpenScreenEvent;
+import meteordevelopment.meteorclient.events.packets.PacketEvent;
+import meteordevelopment.meteorclient.events.render.Render3DEvent;
+import meteordevelopment.meteorclient.events.world.TickEvent;
+import meteordevelopment.meteorclient.renderer.ShapeMode;
+import meteordevelopment.meteorclient.settings.*;
+import meteordevelopment.meteorclient.systems.modules.Module;
+import meteordevelopment.meteorclient.utils.player.ChatUtils;
+import meteordevelopment.meteorclient.utils.render.RenderUtils;
+import meteordevelopment.meteorclient.utils.render.color.Color;
+import meteordevelopment.meteorclient.utils.render.color.SettingColor;
+import meteordevelopment.orbit.EventHandler;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.client.gui.screen.DisconnectedScreen;
+import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
+import net.minecraft.nbt.NbtCompound;
+import net.minecraft.network.packet.c2s.play.AcknowledgeChunksC2SPacket;
+import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
+import net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket;
+import net.minecraft.text.Text;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.Box;
+import net.minecraft.util.math.ChunkPos;
+import net.minecraft.util.math.Vec3d;
+import net.minecraft.world.World;
+import net.minecraft.world.chunk.WorldChunk;
+import pwn.noobs.trouserstreak.Trouser;
+
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+public class CaveDisturbanceDetector extends Module {
+ private final SettingGroup sgGeneral = settings.getDefaultGroup();
+ private final SettingGroup sgRender = settings.createGroup("Render");
+ private final Setting chatFeedback = sgGeneral.add(new BoolSetting.Builder()
+ .name("Chat feedback")
+ .description("Displays info for you.")
+ .defaultValue(false)
+ .build()
+ );
+ private final Setting displaycoords = sgGeneral.add(new BoolSetting.Builder()
+ .name("DisplayCoords")
+ .description("Displays coords of air disturbances in chat.")
+ .defaultValue(true)
+ .build()
+ );
+ public final Setting FPdistance = sgGeneral.add(new IntSetting.Builder()
+ .name("False Positive Distance")
+ .description("If extra normal air within this range of the cave air disturbance then ignore the disturbance")
+ .defaultValue(1)
+ .min(1)
+ .sliderRange(1,10)
+ .build()
+ );
+ private final Setting removerenderdist = sgRender.add(new BoolSetting.Builder()
+ .name("RemoveOutsideRenderDistance")
+ .description("Removes the cached disturbances when they leave the defined render distance.")
+ .defaultValue(true)
+ .build()
+ );
+ public final Setting renderDistance = sgRender.add(new IntSetting.Builder()
+ .name("Render-Distance(Chunks)")
+ .description("How many chunks from the character to render the detected disturbances.")
+ .defaultValue(32)
+ .min(6)
+ .sliderRange(6,1024)
+ .build()
+ );
+ private final Setting trcr = sgRender.add(new BoolSetting.Builder()
+ .name("Tracers")
+ .description("Show tracers to the air disturbances.")
+ .defaultValue(true)
+ .build()
+ );
+ private final Setting nearesttrcr = sgRender.add(new BoolSetting.Builder()
+ .name("Tracer to nearest Disturbance Only")
+ .description("Show only one tracer to the nearest air disturbance.")
+ .defaultValue(false)
+ .build()
+ );
+ private final Setting shapeMode = sgRender.add(new EnumSetting.Builder()
+ .name("shape-mode")
+ .description("How the shapes are rendered.")
+ .defaultValue(ShapeMode.Both)
+ .build()
+ );
+ private final Setting sideColor = sgRender.add(new ColorSetting.Builder()
+ .name("air-disturbance-side-color")
+ .description("Color of possible air disturbances.")
+ .defaultValue(new SettingColor(255, 0, 130, 55))
+ .visible(() -> (shapeMode.get() == ShapeMode.Sides || shapeMode.get() == ShapeMode.Both))
+ .build()
+ );
+ private final Setting lineColor = sgRender.add(new ColorSetting.Builder()
+ .name("air-disturbance-line-color")
+ .description("Color of possible air disturbances.")
+ .defaultValue(new SettingColor(255, 0, 130, 200))
+ .visible(() -> (shapeMode.get() == ShapeMode.Lines || shapeMode.get() == ShapeMode.Both || trcr.get()))
+ .build()
+ );
+ private static final ExecutorService taskExecutor = Executors.newCachedThreadPool();
+ private final Set scannedChunks = Collections.synchronizedSet(new HashSet<>());
+ private final Set scannedAir = Collections.synchronizedSet(new HashSet<>());
+ private final Set disturbanceLocations = Collections.synchronizedSet(new HashSet<>());
+ private int closestX=2000000000;
+ private int closestY=2000000000;
+ private int closestZ=2000000000;
+ private double distance=2000000000;
+
+ public CaveDisturbanceDetector() {
+ super(Trouser.Main,"CaveDisturbanceDetector", "Scans for single air blocks within the cave air blocks found in caves and underground structures in 1.13+ chunks. There are several false positives.");
+ }
+
+ @Override
+ public void onActivate() {
+ clearChunkData();
+ scanTheAir();
+ }
+ private void scanTheAir() {
+ if (mc.world == null) return;
+ int renderdistance = renderDistance.get();
+ ChunkPos playerChunkPos = new ChunkPos(mc.player.getBlockPos());
+ List chunksToProcess = new ArrayList<>();
+
+ for (int chunkX = playerChunkPos.x - renderdistance; chunkX <= playerChunkPos.x + renderdistance; chunkX++) {
+ for (int chunkZ = playerChunkPos.z - renderdistance; chunkZ <= playerChunkPos.z + renderdistance; chunkZ++) {
+ chunksToProcess.add(new ChunkPos(chunkX, chunkZ));
+ }
+ }
+
+ chunksToProcess.parallelStream().forEach(chunkPos -> {
+ WorldChunk chunk = mc.world.getChunk(chunkPos.x, chunkPos.z);
+ if (chunk != null && !scannedChunks.contains(chunk.getPos())) {
+ processChunk(chunk);
+ scannedChunks.add(chunk.getPos());
+ }
+ });
+ }
+ @Override
+ public void onDeactivate() {
+ clearChunkData();
+ }
+ @EventHandler
+ private void onScreenOpen(OpenScreenEvent event) {
+ if (event.screen instanceof DisconnectedScreen || event.screen instanceof DownloadingTerrainScreen) clearChunkData();
+ }
+ @EventHandler
+ private void onGameLeft(GameLeftEvent event) {
+ clearChunkData();
+ }
+ private void clearChunkData(){
+ scannedChunks.clear();
+ scannedAir.clear();
+ disturbanceLocations.clear();
+ closestX=2000000000;
+ closestY=2000000000;
+ closestZ=2000000000;
+ distance=2000000000;
+ }
+ @EventHandler
+ private void onPreTick(TickEvent.Pre event) {
+ if (nearesttrcr.get()){
+ try {
+ if (disturbanceLocations.stream().toList().size() > 0) {
+ for (int b = 0; b < disturbanceLocations.stream().toList().size(); b++) {
+ if (distance > Math.sqrt(Math.pow(disturbanceLocations.stream().toList().get(b).getX() - mc.player.getBlockX(), 2) + Math.pow(disturbanceLocations.stream().toList().get(b).getZ() - mc.player.getBlockZ(), 2))) {
+ closestX = disturbanceLocations.stream().toList().get(b).getX();
+ closestY = disturbanceLocations.stream().toList().get(b).getY();
+ closestZ = disturbanceLocations.stream().toList().get(b).getZ();
+ distance = Math.sqrt(Math.pow(disturbanceLocations.stream().toList().get(b).getX() - mc.player.getBlockX(), 2) + Math.pow(disturbanceLocations.stream().toList().get(b).getZ() - mc.player.getBlockZ(), 2));
+ }
+ }
+ distance = 2000000000;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ if (removerenderdist.get())removeChunksOutsideRenderDistance();
+ }
+
+ @EventHandler
+ private void onReadPacket(PacketEvent.Receive event) {
+ if (event.packet instanceof AcknowledgeChunksC2SPacket)return; //for some reason this packet keeps getting cast to other packets
+ if (!(event.packet instanceof AcknowledgeChunksC2SPacket) && !(event.packet instanceof PlayerMoveC2SPacket) && event.packet instanceof ChunkDataS2CPacket packet && mc.world != null) {
+ ChunkPos playerActivityPos = new ChunkPos(packet.getChunkX(), packet.getChunkZ());
+
+ if (mc.world.getChunkManager().getChunk(packet.getChunkX(), packet.getChunkZ()) == null) {
+ WorldChunk chunk = new WorldChunk(mc.world, playerActivityPos);
+ try {
+ CompletableFuture future = CompletableFuture.runAsync(() -> {
+ chunk.loadFromPacket(packet.getChunkData().getSectionsDataBuf(), new NbtCompound(),
+ packet.getChunkData().getBlockEntities(packet.getChunkX(), packet.getChunkZ()));
+ }, taskExecutor);
+ future.join();
+ } catch (CompletionException e) {}
+ if (chunk != null && !scannedChunks.contains(chunk.getPos())) {
+ processChunk(chunk);
+ scannedChunks.add(chunk.getPos());
+ }
+ }
+ }
+ }
+
+ private void processChunk(WorldChunk chunk) {
+ int minY = mc.world.getBottomY();
+ int maxY = 180;
+ if (mc.world.getRegistryKey() == World.NETHER) maxY = 126;
+
+ for (int x = 0; x < 16; x++) {
+ for (int z = 0; z < 16; z++) {
+ for (int y = minY; y <= maxY; y++) {
+ BlockPos blockPos = new BlockPos(chunk.getPos().getStartX() + x, y, chunk.getPos().getStartZ() + z);
+ BlockState blockState = chunk.getBlockState(blockPos);
+
+ if (blockState.getBlock() == Blocks.CAVE_AIR) {
+ isSurroundingBlockRegAir(blockPos);
+ }
+ }
+ }
+ }
+ }
+
+ private void isSurroundingBlockRegAir(BlockPos bPos) {
+ for (int dir = 1; dir < 6; dir++) {
+ switch (dir){
+ case 1 -> {
+ BlockPos Air = bPos.north();
+ if (!scannedAir.contains(Air)) {
+ BlockPos BlockPastTheAir = Air.add(0,0,-1);
+ if (mc.world.getBlockState(Air).getBlock() == Blocks.AIR && mc.world.getBlockState(BlockPastTheAir).getBlock() != Blocks.AIR) {
+ if (mc.world.getBlockState(Air.add(1,0,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(-1,0,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,1,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,-1,0)).getBlock() != Blocks.AIR)
+ {
+ if (!FPcheck(Air))disturbanceFound(Air);
+ }
+ }
+ }
+ scannedAir.add(Air);
+ }
+ case 2 -> {
+ BlockPos Air = bPos.south();
+ if (!scannedAir.contains(Air)) {
+ BlockPos BlockPastTheAir = Air.add(0,0,1);
+ if (mc.world.getBlockState(Air).getBlock() == Blocks.AIR && mc.world.getBlockState(BlockPastTheAir).getBlock() != Blocks.AIR) {
+ if (mc.world.getBlockState(Air.add(1,0,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(-1,0,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,1,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,-1,0)).getBlock() != Blocks.AIR)
+ {
+ if (!FPcheck(Air))disturbanceFound(Air);
+ }
+ }
+ }
+ scannedAir.add(Air);
+ }
+ case 3 -> {
+ BlockPos Air = bPos.west();
+ if (!scannedAir.contains(Air)) {
+ BlockPos BlockPastTheAir = Air.add(-1,0,0);
+ if (mc.world.getBlockState(Air).getBlock() == Blocks.AIR && mc.world.getBlockState(BlockPastTheAir).getBlock() != Blocks.AIR) {
+ if (mc.world.getBlockState(Air.add(0,1,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,-1,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,0,1)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,0,-1)).getBlock() != Blocks.AIR)
+ {
+ if (!FPcheck(Air))disturbanceFound(Air);
+ }
+ }
+ }
+ scannedAir.add(Air);
+ }
+ case 4 -> {
+ BlockPos Air = bPos.east();
+ if (!scannedAir.contains(Air)) {
+ BlockPos BlockPastTheAir = Air.add(1,0,0);
+ if (mc.world.getBlockState(Air).getBlock() == Blocks.AIR && mc.world.getBlockState(BlockPastTheAir).getBlock() != Blocks.AIR) {
+ if (mc.world.getBlockState(Air.add(0,1,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,-1,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,0,1)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,0,-1)).getBlock() != Blocks.AIR)
+ {
+ if (!FPcheck(Air))disturbanceFound(Air);
+ }
+ }
+ }
+ scannedAir.add(Air);
+ }
+ case 5 -> {
+ BlockPos Air = bPos.up();
+ if (!scannedAir.contains(Air)) {
+ BlockPos BlockPastTheAir = Air.add(0,1,0);
+ if (mc.world.getBlockState(Air).getBlock() == Blocks.AIR && mc.world.getBlockState(BlockPastTheAir).getBlock() != Blocks.AIR) {
+ if (mc.world.getBlockState(Air.add(1,0,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(-1,0,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,0,1)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,0,-1)).getBlock() != Blocks.AIR)
+ {
+ if (!FPcheck(Air))disturbanceFound(Air);
+ }
+ }
+ }
+ scannedAir.add(Air);
+ }
+ case 6 -> {
+ BlockPos Air = bPos.down();
+ if (!scannedAir.contains(Air)) {
+ BlockPos BlockPastTheAir = Air.add(0,-1,0);
+ if (mc.world.getBlockState(Air).getBlock() == Blocks.AIR && mc.world.getBlockState(BlockPastTheAir).getBlock() != Blocks.AIR) {
+ if (mc.world.getBlockState(Air.add(1,0,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(-1,0,0)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,0,1)).getBlock() != Blocks.AIR &&
+ mc.world.getBlockState(Air.add(0,0,-1)).getBlock() != Blocks.AIR)
+ {
+ if (!FPcheck(Air))disturbanceFound(Air);
+ }
+ }
+ }
+ scannedAir.add(Air);
+ }
+ }
+ }
+ }
+ private boolean FPcheck(BlockPos disturbance){
+ boolean extraAirFound = false;
+ for (int x = -FPdistance.get(); x < FPdistance.get()+1; x++) {
+ for (int y = -FPdistance.get(); y < FPdistance.get()+1; y++) {
+ for (int z = -FPdistance.get(); z < FPdistance.get()+1; z++) {
+ BlockPos bpos = new BlockPos(disturbance.add(x,y,z));
+ if (bpos.equals(disturbance))continue;
+ if (mc.world.getBlockState(bpos).getBlock() == Blocks.AIR){
+ extraAirFound = true;
+ break;
+ }
+ }
+ }
+ }
+ return extraAirFound;
+ }
+ private void disturbanceFound(BlockPos disturbance){
+ if (!disturbanceLocations.contains(disturbance)){
+ disturbanceLocations.add(disturbance);
+ if (chatFeedback.get()){
+ if (displaycoords.get())
+ ChatUtils.sendMsg(Text.of("Disturbance in the Cave Air found: " + disturbance));
+ else if (!displaycoords.get()) ChatUtils.sendMsg(Text.of("Disturbance in the Cave Air found!"));
+ }
+ }
+ }
+
+ @EventHandler
+ private void onRender(Render3DEvent event) {
+ if ((sideColor.get().a > 5 || lineColor.get().a > 5) && mc.player != null) {
+ synchronized (disturbanceLocations) {
+ if (!nearesttrcr.get()) {
+ for (BlockPos pos : disturbanceLocations) {
+ BlockPos playerPos = new BlockPos(mc.player.getBlockX(), pos.getY(), mc.player.getBlockZ());
+ if (pos != null && playerPos.isWithinDistance(pos, renderDistance.get() * 16)) {
+ int startX = pos.getX();
+ int startY = pos.getY();
+ int startZ = pos.getZ();
+ int endX = pos.getX();
+ int endY = pos.getY();
+ int endZ = pos.getZ();
+ render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), sideColor.get(), lineColor.get(), shapeMode.get(), event);
+ }
+ }
+ } else if (nearesttrcr.get()){
+ for (BlockPos pos : disturbanceLocations) {
+ BlockPos playerPos = new BlockPos(mc.player.getBlockX(), pos.getY(), mc.player.getBlockZ());
+ if (pos != null && playerPos.isWithinDistance(pos, renderDistance.get() * 16)) {
+ int startX = pos.getX();
+ int startY = pos.getY();
+ int startZ = pos.getZ();
+ int endX = pos.getX();
+ int endY = pos.getY();
+ int endZ = pos.getZ();
+ render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), sideColor.get(), lineColor.get(), shapeMode.get(), event);
+ }
+ }
+ render2(new Box(new Vec3d(closestX+1, closestY+1, closestZ+1), new Vec3d (closestX, closestY, closestZ)), sideColor.get(), lineColor.get(),ShapeMode.Sides, event);
+ }
+ }
+ }
+ }
+ private void render(Box box, Color sides, Color lines, ShapeMode shapeMode, Render3DEvent event) {
+ if (trcr.get() && Math.abs(box.minX- RenderUtils.center.x)<=renderDistance.get()*16 && Math.abs(box.minZ-RenderUtils.center.z)<=renderDistance.get()*16)
+ if (!nearesttrcr.get())
+ event.renderer.line(RenderUtils.center.x, RenderUtils.center.y, RenderUtils.center.z, box.minX+0.5, box.minY+((box.maxY-box.minY)/2), box.minZ+0.5, lines);
+ event.renderer.box(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, sides, new Color(0,0,0,0), shapeMode, 0);
+ }
+ private void render2(Box box, Color sides, Color lines, ShapeMode shapeMode, Render3DEvent event) {
+ if (trcr.get() && Math.abs(box.minX-RenderUtils.center.x)<=renderDistance.get()*16 && Math.abs(box.minZ-RenderUtils.center.z)<=renderDistance.get()*16)
+ event.renderer.line(RenderUtils.center.x, RenderUtils.center.y, RenderUtils.center.z, box.minX+0.5, box.minY+((box.maxY-box.minY)/2), box.minZ+0.5, lines);
+ event.renderer.box(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, sides, new Color(0,0,0,0), shapeMode, 0);
+ }
+ private void removeChunksOutsideRenderDistance() {
+ double renderDistanceBlocks = renderDistance.get() * 16;
+
+ removechunksOutsideRenderDistance(scannedChunks, mc.player.getBlockPos(), renderDistanceBlocks);
+ removeChunksOutsideRenderDistance(disturbanceLocations, renderDistanceBlocks);
+ removeChunksOutsideRenderDistance(scannedAir, renderDistanceBlocks);
+ }
+ private void removeChunksOutsideRenderDistance(Set chunkSet, double renderDistanceBlocks) {
+ chunkSet.removeIf(blockPos -> {
+ BlockPos playerPos = new BlockPos(mc.player.getBlockX(), blockPos.getY(), mc.player.getBlockZ());
+ return !playerPos.isWithinDistance(blockPos, renderDistanceBlocks);
+ });
+ }
+ private void removechunksOutsideRenderDistance(Set chunkSet, BlockPos playerPos, double renderDistanceBlocks) {
+ chunkSet.removeIf(c -> !playerPos.isWithinDistance(new BlockPos(c.getCenterX(), mc.player.getBlockY(), c.getCenterZ()), renderDistanceBlocks));
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/ForceOPBook.java b/src/main/java/pwn/noobs/trouserstreak/modules/ForceOPBook.java
index e8d1222c..dd415d2e 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/ForceOPBook.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/ForceOPBook.java
@@ -62,7 +62,8 @@ public ForceOPBook() {
@Override
public void onActivate() {
- if (mc.player != null && mc.interactionManager != null && !mc.player.getAbilities().creativeMode) {
+ if (mc.player == null || mc.interactionManager == null) return;
+ if (!mc.player.getAbilities().creativeMode) {
error("You need creative mode to make the book.");
toggle();
return;
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/ForceOPSign.java b/src/main/java/pwn/noobs/trouserstreak/modules/ForceOPSign.java
index ab90678a..10af3661 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/ForceOPSign.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/ForceOPSign.java
@@ -197,8 +197,9 @@ public ForceOPSign() {
@Override
public void onActivate() {
+ if (mc.player == null) return;
if (versionwarning.get()) error("!!!You need TrouserStreak for Minecraft 1.20.4 to make it work on versions less than 1.20.5!!!");
- if (mc.player != null && !mc.player.getAbilities().creativeMode) {
+ if (!mc.player.getAbilities().creativeMode) {
error("You need creative mode to make the sign.");
toggle();
return;
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/HandOfGod.java b/src/main/java/pwn/noobs/trouserstreak/modules/HandOfGod.java
index 97784560..93a7c65e 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/HandOfGod.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/HandOfGod.java
@@ -192,7 +192,7 @@ public class HandOfGod extends Module {
.defaultValue(17)
.min(1)
.sliderMax(30)
- .visible(rndplyr::get)
+ .visible(pReplace::get)
.build()
);
public final Setting pheight = sgPcentered.add(new IntSetting.Builder()
@@ -201,7 +201,7 @@ public class HandOfGod extends Module {
.defaultValue(11)
.min(1)
.sliderMax(30)
- .visible(rndplyr::get)
+ .visible(pReplace::get)
.build()
);
public final Setting pdepth = sgPcentered.add(new IntSetting.Builder()
@@ -210,7 +210,7 @@ public class HandOfGod extends Module {
.defaultValue(17)
.min(1)
.sliderMax(30)
- .visible(rndplyr::get)
+ .visible(pReplace::get)
.build()
);
public final Setting tickdelay = sgPcentered.add(new IntSetting.Builder()
@@ -219,7 +219,7 @@ public class HandOfGod extends Module {
.defaultValue(2)
.min(0)
.sliderMax(100)
- .visible(rndplyr::get)
+ .visible(pReplace::get)
.build()
);
public final Setting mgcersr = sgPcentered.add(new BoolSetting.Builder()
@@ -538,7 +538,6 @@ private void onMouseButton(MouseButtonEvent event) {
String repblockName = repblock.replace("}", "");
switch (mc.player.getHorizontalFacing()){
case NORTH, SOUTH -> {
- //they both int, why you want to round it?
int x1 = pos.getX() + cwidth.get();
int y1 = pos.getY() + cheight.get();
int z1 = pos.getZ() + cdepth.get();
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/LavaAura.java b/src/main/java/pwn/noobs/trouserstreak/modules/LavaAura.java
index 9cd994d8..33cd5c8b 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/LavaAura.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/LavaAura.java
@@ -253,77 +253,77 @@ private void onTick(TickEvent.Pre event) {
BlockPos targetBlockPos = BlockPos.ofFloored(targetPos);
if (mc.world.getBlockState(targetBlockPos).getBlock() != Blocks.WATER && mc.world.getBlockState(targetBlockPos).getBlock() != Blocks.LAVA) {
- Block blockBelow = mc.world.getBlockState(targetBlockPos.down()).getBlock();
- if (mode.get() == Mode.LAVA) {
- if (nolavaburning.get() && !entity.isOnFire() && placementTicks >= placelavatickdelay.get()){
- mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, targetPos);
- placeLava();
- placementTicks=0;
- }
- else if (!nolavaburning.get() && placementTicks >= placelavatickdelay.get()){
+ Block blockBelow = mc.world.getBlockState(targetBlockPos.down()).getBlock();
+ if (mode.get() == Mode.LAVA) {
+ if (nolavaburning.get() && !entity.isOnFire() && placementTicks >= placelavatickdelay.get()){
+ mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, targetPos);
+ placeLava();
+ placementTicks=0;
+ }
+ else if (!nolavaburning.get() && placementTicks >= placelavatickdelay.get()){
+ mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, targetPos);
+ placeLava();
+ placementTicks=0;
+ }
+ } else if ((!mc.player.isSneaking() &&
+ !(blockBelow instanceof AbstractFurnaceBlock ||
+ blockBelow instanceof AbstractSignBlock ||
+ blockBelow instanceof AnvilBlock ||
+ blockBelow instanceof BarrelBlock ||
+ blockBelow instanceof BeaconBlock ||
+ blockBelow instanceof BedBlock ||
+ blockBelow instanceof BellBlock ||
+ blockBelow instanceof BrewingStandBlock ||
+ blockBelow instanceof ButtonBlock ||
+ blockBelow instanceof CakeBlock ||
+ blockBelow instanceof CampfireBlock ||
+ blockBelow instanceof CandleBlock ||
+ blockBelow instanceof CandleCakeBlock ||
+ blockBelow instanceof CartographyTableBlock ||
+ blockBelow instanceof ChestBlock ||
+ (mc.player.hasPermissionLevel(2) && blockBelow instanceof CommandBlock) ||
+ blockBelow instanceof ComparatorBlock ||
+ blockBelow instanceof CrafterBlock ||
+ blockBelow instanceof CraftingTableBlock ||
+ blockBelow instanceof DaylightDetectorBlock ||
+ blockBelow instanceof DecoratedPotBlock ||
+ blockBelow instanceof DispenserBlock ||
+ blockBelow instanceof DoorBlock ||
+ blockBelow instanceof DragonEggBlock ||
+ blockBelow instanceof EnchantingTableBlock ||
+ blockBelow instanceof EnderChestBlock ||
+ blockBelow instanceof FenceBlock ||
+ blockBelow instanceof FenceGateBlock ||
+ blockBelow instanceof GrindstoneBlock ||
+ blockBelow instanceof HangingSignBlock ||
+ blockBelow instanceof HopperBlock ||
+ blockBelow instanceof LecternBlock ||
+ blockBelow instanceof LeverBlock ||
+ (mc.player.hasPermissionLevel(2) && blockBelow instanceof LightBlock) ||
+ blockBelow instanceof LoomBlock ||
+ blockBelow instanceof NoteBlock ||
+ blockBelow instanceof RedstoneOreBlock ||
+ blockBelow instanceof RedstoneWireBlock ||
+ blockBelow instanceof RepeaterBlock ||
+ blockBelow instanceof RespawnAnchorBlock ||
+ blockBelow instanceof ShulkerBoxBlock ||
+ blockBelow instanceof SmithingTableBlock ||
+ blockBelow instanceof StonecutterBlock ||
+ blockBelow instanceof SweetBerryBushBlock ||
+ blockBelow instanceof TntBlock ||
+ blockBelow instanceof TrapdoorBlock ||
+ blockBelow instanceof WallHangingSignBlock) &&
+ !blockHasOnUseMethod(mc.world.getBlockState(targetBlockPos).getBlock()) && mode.get() == Mode.FIRE) ||
+ mc.player.isSneaking() && mode.get() == Mode.FIRE) {
+ if (placementTicks >= placefiretickdelay.get()){
+ if (!norotate.get())
mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, targetPos);
- placeLava();
- placementTicks=0;
- }
- } else if ((!mc.player.isSneaking() &&
- !(blockBelow instanceof AbstractFurnaceBlock ||
- blockBelow instanceof AbstractSignBlock ||
- blockBelow instanceof AnvilBlock ||
- blockBelow instanceof BarrelBlock ||
- blockBelow instanceof BeaconBlock ||
- blockBelow instanceof BedBlock ||
- blockBelow instanceof BellBlock ||
- blockBelow instanceof BrewingStandBlock ||
- blockBelow instanceof ButtonBlock ||
- blockBelow instanceof CakeBlock ||
- blockBelow instanceof CampfireBlock ||
- blockBelow instanceof CandleBlock ||
- blockBelow instanceof CandleCakeBlock ||
- blockBelow instanceof CartographyTableBlock ||
- blockBelow instanceof ChestBlock ||
- (mc.player.hasPermissionLevel(2) && blockBelow instanceof CommandBlock) ||
- blockBelow instanceof ComparatorBlock ||
- blockBelow instanceof CrafterBlock ||
- blockBelow instanceof CraftingTableBlock ||
- blockBelow instanceof DaylightDetectorBlock ||
- blockBelow instanceof DecoratedPotBlock ||
- blockBelow instanceof DispenserBlock ||
- blockBelow instanceof DoorBlock ||
- blockBelow instanceof DragonEggBlock ||
- blockBelow instanceof EnchantingTableBlock ||
- blockBelow instanceof EnderChestBlock ||
- blockBelow instanceof FenceBlock ||
- blockBelow instanceof FenceGateBlock ||
- blockBelow instanceof GrindstoneBlock ||
- blockBelow instanceof HangingSignBlock ||
- blockBelow instanceof HopperBlock ||
- blockBelow instanceof LecternBlock ||
- blockBelow instanceof LeverBlock ||
- (mc.player.hasPermissionLevel(2) && blockBelow instanceof LightBlock) ||
- blockBelow instanceof LoomBlock ||
- blockBelow instanceof NoteBlock ||
- blockBelow instanceof RedstoneOreBlock ||
- blockBelow instanceof RedstoneWireBlock ||
- blockBelow instanceof RepeaterBlock ||
- blockBelow instanceof RespawnAnchorBlock ||
- blockBelow instanceof ShulkerBoxBlock ||
- blockBelow instanceof SmithingTableBlock ||
- blockBelow instanceof StonecutterBlock ||
- blockBelow instanceof SweetBerryBushBlock ||
- blockBelow instanceof TntBlock ||
- blockBelow instanceof TrapdoorBlock ||
- blockBelow instanceof WallHangingSignBlock) &&
- !blockHasOnUseMethod(mc.world.getBlockState(targetBlockPos).getBlock()) && mode.get() == Mode.FIRE) ||
- mc.player.isSneaking() && mode.get() == Mode.FIRE) {
- if (placementTicks >= placefiretickdelay.get()){
- if (!norotate.get())
- mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, targetPos);
- if (noburnburning.get() && !entity.isOnFire()) placeFire(targetBlockPos);
- else if (!noburnburning.get()) placeFire(targetBlockPos);
- placementTicks=0;
- }
+ if (noburnburning.get() && !entity.isOnFire()) placeFire(targetBlockPos);
+ else if (!noburnburning.get()) placeFire(targetBlockPos);
+ placementTicks=0;
}
}
+ }
}
}
@@ -331,70 +331,70 @@ else if (!nolavaburning.get() && placementTicks >= placelavatickdelay.get()){
if (distance <= range.get() && distance > noburnrange.get()) {
BlockPos targetBlockPos = BlockPos.ofFloored(targetPos);
- Block blockBelow = mc.world.getBlockState(targetBlockPos.down()).getBlock();
+ Block blockBelow = mc.world.getBlockState(targetBlockPos.down()).getBlock();
- if ((!mc.player.isSneaking() &&
- !(blockBelow instanceof AbstractFurnaceBlock ||
- blockBelow instanceof AbstractSignBlock ||
- blockBelow instanceof AnvilBlock ||
- blockBelow instanceof BarrelBlock ||
- blockBelow instanceof BeaconBlock ||
- blockBelow instanceof BedBlock ||
- blockBelow instanceof BellBlock ||
- blockBelow instanceof BrewingStandBlock ||
- blockBelow instanceof ButtonBlock ||
- blockBelow instanceof CakeBlock ||
- blockBelow instanceof CampfireBlock ||
- blockBelow instanceof CandleBlock ||
- blockBelow instanceof CandleCakeBlock ||
- blockBelow instanceof CartographyTableBlock ||
- blockBelow instanceof ChestBlock ||
- (mc.player.hasPermissionLevel(2) && blockBelow instanceof CommandBlock) ||
- blockBelow instanceof ComparatorBlock ||
- blockBelow instanceof CrafterBlock ||
- blockBelow instanceof CraftingTableBlock ||
- blockBelow instanceof DaylightDetectorBlock ||
- blockBelow instanceof DecoratedPotBlock ||
- blockBelow instanceof DispenserBlock ||
- blockBelow instanceof DoorBlock ||
- blockBelow instanceof DragonEggBlock ||
- blockBelow instanceof EnchantingTableBlock ||
- blockBelow instanceof EnderChestBlock ||
- blockBelow instanceof FenceBlock ||
- blockBelow instanceof FenceGateBlock ||
- blockBelow instanceof GrindstoneBlock ||
- blockBelow instanceof HangingSignBlock ||
- blockBelow instanceof HopperBlock ||
- blockBelow instanceof LecternBlock ||
- blockBelow instanceof LeverBlock ||
- (mc.player.hasPermissionLevel(2) && blockBelow instanceof LightBlock) ||
- blockBelow instanceof LoomBlock ||
- blockBelow instanceof NoteBlock ||
- blockBelow instanceof RedstoneOreBlock ||
- blockBelow instanceof RedstoneWireBlock ||
- blockBelow instanceof RepeaterBlock ||
- blockBelow instanceof RespawnAnchorBlock ||
- blockBelow instanceof ShulkerBoxBlock ||
- blockBelow instanceof SmithingTableBlock ||
- blockBelow instanceof StonecutterBlock ||
- blockBelow instanceof SweetBerryBushBlock ||
- blockBelow instanceof TntBlock ||
- blockBelow instanceof TrapdoorBlock ||
- blockBelow instanceof WallHangingSignBlock) &&
- mc.world.getBlockState(targetBlockPos).getBlock() != Blocks.WATER &&
- mc.world.getBlockState(targetBlockPos).getBlock() != Blocks.LAVA &&
- !blockHasOnUseMethod(mc.world.getBlockState(targetBlockPos).getBlock())) ||
- (mc.player.isSneaking() &&
- mc.world.getBlockState(targetBlockPos).getBlock() != Blocks.WATER &&
- mc.world.getBlockState(targetBlockPos).getBlock() != Blocks.LAVA)) {
- if (placementTicks >= placefiretickdelay.get()){
- if (!norotate.get())
- mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, targetPos);
- if (noburnburning.get() && !entity.isOnFire()) placeFire(targetBlockPos);
- else if (!noburnburning.get()) placeFire(targetBlockPos);
- placementTicks=0;
- }
+ if ((!mc.player.isSneaking() &&
+ !(blockBelow instanceof AbstractFurnaceBlock ||
+ blockBelow instanceof AbstractSignBlock ||
+ blockBelow instanceof AnvilBlock ||
+ blockBelow instanceof BarrelBlock ||
+ blockBelow instanceof BeaconBlock ||
+ blockBelow instanceof BedBlock ||
+ blockBelow instanceof BellBlock ||
+ blockBelow instanceof BrewingStandBlock ||
+ blockBelow instanceof ButtonBlock ||
+ blockBelow instanceof CakeBlock ||
+ blockBelow instanceof CampfireBlock ||
+ blockBelow instanceof CandleBlock ||
+ blockBelow instanceof CandleCakeBlock ||
+ blockBelow instanceof CartographyTableBlock ||
+ blockBelow instanceof ChestBlock ||
+ (mc.player.hasPermissionLevel(2) && blockBelow instanceof CommandBlock) ||
+ blockBelow instanceof ComparatorBlock ||
+ blockBelow instanceof CrafterBlock ||
+ blockBelow instanceof CraftingTableBlock ||
+ blockBelow instanceof DaylightDetectorBlock ||
+ blockBelow instanceof DecoratedPotBlock ||
+ blockBelow instanceof DispenserBlock ||
+ blockBelow instanceof DoorBlock ||
+ blockBelow instanceof DragonEggBlock ||
+ blockBelow instanceof EnchantingTableBlock ||
+ blockBelow instanceof EnderChestBlock ||
+ blockBelow instanceof FenceBlock ||
+ blockBelow instanceof FenceGateBlock ||
+ blockBelow instanceof GrindstoneBlock ||
+ blockBelow instanceof HangingSignBlock ||
+ blockBelow instanceof HopperBlock ||
+ blockBelow instanceof LecternBlock ||
+ blockBelow instanceof LeverBlock ||
+ (mc.player.hasPermissionLevel(2) && blockBelow instanceof LightBlock) ||
+ blockBelow instanceof LoomBlock ||
+ blockBelow instanceof NoteBlock ||
+ blockBelow instanceof RedstoneOreBlock ||
+ blockBelow instanceof RedstoneWireBlock ||
+ blockBelow instanceof RepeaterBlock ||
+ blockBelow instanceof RespawnAnchorBlock ||
+ blockBelow instanceof ShulkerBoxBlock ||
+ blockBelow instanceof SmithingTableBlock ||
+ blockBelow instanceof StonecutterBlock ||
+ blockBelow instanceof SweetBerryBushBlock ||
+ blockBelow instanceof TntBlock ||
+ blockBelow instanceof TrapdoorBlock ||
+ blockBelow instanceof WallHangingSignBlock) &&
+ mc.world.getBlockState(targetBlockPos).getBlock() != Blocks.WATER &&
+ mc.world.getBlockState(targetBlockPos).getBlock() != Blocks.LAVA &&
+ !blockHasOnUseMethod(mc.world.getBlockState(targetBlockPos).getBlock())) ||
+ (mc.player.isSneaking() &&
+ mc.world.getBlockState(targetBlockPos).getBlock() != Blocks.WATER &&
+ mc.world.getBlockState(targetBlockPos).getBlock() != Blocks.LAVA)) {
+ if (placementTicks >= placefiretickdelay.get()){
+ if (!norotate.get())
+ mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, targetPos);
+ if (noburnburning.get() && !entity.isOnFire()) placeFire(targetBlockPos);
+ else if (!noburnburning.get()) placeFire(targetBlockPos);
+ placementTicks=0;
}
+ }
}
}
}
@@ -476,13 +476,13 @@ else if (!nolavaburning.get() && placementTicks >= placelavatickdelay.get()){
blockBelow instanceof TrapdoorBlock ||
blockBelow instanceof WallHangingSignBlock) &&
!blockHasOnUseMethod(mc.world.getBlockState(blockPos).getBlock())) || mc.player.isSneaking()) {
- if (placementTicks >= placefiretickdelay.get()){
- if (!norotate.get())mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, new Vec3d(blockPos.getX(), blockPos.getY(), blockPos.getZ()));
- placeFire(blockPos.up());
- placementTicks=0;
- lavaPlaced.add(blockPos);
- }
- }
+ if (placementTicks >= placefiretickdelay.get()){
+ if (!norotate.get())mc.player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, new Vec3d(blockPos.getX(), blockPos.getY(), blockPos.getZ()));
+ placeFire(blockPos.up());
+ placementTicks=0;
+ lavaPlaced.add(blockPos);
+ }
+ }
};
}
}
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/NewerNewChunks.java b/src/main/java/pwn/noobs/trouserstreak/modules/NewerNewChunks.java
index c526b072..54b433f8 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/NewerNewChunks.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/NewerNewChunks.java
@@ -627,13 +627,13 @@ private void onReadPacket(PacketEvent.Receive event) {
if (event.packet instanceof AcknowledgeChunksC2SPacket )return; //for some reason this packet keeps getting cast to other packets
if (!(event.packet instanceof AcknowledgeChunksC2SPacket) && event.packet instanceof ChunkDeltaUpdateS2CPacket packet && liquidexploit.get()) {
- packet.visitUpdates((pos, state) -> {
+ packet.visitUpdates((pos, state) -> {
ChunkPos chunkPos = new ChunkPos(pos);
if (!state.getFluidState().isEmpty() && !state.getFluidState().isStill()) {
for (Direction dir: searchDirs) {
try {
if (mc.world != null && mc.world.getBlockState(pos.offset(dir)).getFluidState().isStill() && (!OldGenerationOldChunks.contains(chunkPos) && !beingUpdatedOldChunks.contains(chunkPos) && !newChunks.contains(chunkPos) && !oldChunks.contains(chunkPos))) {
- tickexploitChunks.remove(chunkPos);
+ tickexploitChunks.remove(chunkPos);
newChunks.add(chunkPos);
if (save.get()){
saveData(Paths.get("NewChunkData.txt"), chunkPos);
@@ -646,7 +646,7 @@ private void onReadPacket(PacketEvent.Receive event) {
});
}
else if (!(event.packet instanceof AcknowledgeChunksC2SPacket) && event.packet instanceof BlockUpdateS2CPacket packet) {
- ChunkPos chunkPos = new ChunkPos(packet.getPos());
+ ChunkPos chunkPos = new ChunkPos(packet.getPos());
if (blockupdateexploit.get()){
try {
if (!OldGenerationOldChunks.contains(chunkPos) && !beingUpdatedOldChunks.contains(chunkPos) && !tickexploitChunks.contains(chunkPos) && !oldChunks.contains(chunkPos) && !newChunks.contains(chunkPos)){
@@ -662,7 +662,7 @@ else if (!(event.packet instanceof AcknowledgeChunksC2SPacket) && event.packet i
for (Direction dir: searchDirs) {
try {
if (mc.world != null && mc.world.getBlockState(packet.getPos().offset(dir)).getFluidState().isStill() && (!OldGenerationOldChunks.contains(chunkPos) && !beingUpdatedOldChunks.contains(chunkPos) && !newChunks.contains(chunkPos) && !oldChunks.contains(chunkPos))) {
- tickexploitChunks.remove(chunkPos);
+ tickexploitChunks.remove(chunkPos);
newChunks.add(chunkPos);
if (save.get()){
saveData(Paths.get("NewChunkData.txt"), chunkPos);
@@ -674,7 +674,7 @@ else if (!(event.packet instanceof AcknowledgeChunksC2SPacket) && event.packet i
}
}
else if (!(event.packet instanceof AcknowledgeChunksC2SPacket) && !(event.packet instanceof PlayerMoveC2SPacket) && event.packet instanceof ChunkDataS2CPacket packet && mc.world != null) {
- ChunkPos oldpos = new ChunkPos(packet.getChunkX(), packet.getChunkZ());
+ ChunkPos oldpos = new ChunkPos(packet.getChunkX(), packet.getChunkZ());
if (mc.world.getChunkManager().getChunk(packet.getChunkX(), packet.getChunkZ()) == null) {
WorldChunk chunk = new WorldChunk(mc.world, oldpos);
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/OPServerKillModule.java b/src/main/java/pwn/noobs/trouserstreak/modules/OPServerKillModule.java
index d4a2f4c1..a56ee33b 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/OPServerKillModule.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/OPServerKillModule.java
@@ -86,7 +86,7 @@ public void onActivate() {
toggle();
error("Must have permission level 2 or higher");
}
- ticks=0;
+ ticks=0;
}
@EventHandler
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/OnlinePlayerActivityDetector.java b/src/main/java/pwn/noobs/trouserstreak/modules/OnlinePlayerActivityDetector.java
index a773a485..78cc37f6 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/OnlinePlayerActivityDetector.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/OnlinePlayerActivityDetector.java
@@ -216,7 +216,7 @@ private void onReadPacket(PacketEvent.Receive event) {
}, taskExecutor);
future.join();
} catch (CompletionException e) {}
-
+
ChunkSection[] sections = chunk.getSectionArray();
try {
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/PortalPatternFinder.java b/src/main/java/pwn/noobs/trouserstreak/modules/PortalPatternFinder.java
new file mode 100644
index 00000000..77ab25ad
--- /dev/null
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/PortalPatternFinder.java
@@ -0,0 +1,542 @@
+//made by etianl :D
+package pwn.noobs.trouserstreak.modules;
+
+import meteordevelopment.meteorclient.events.game.GameLeftEvent;
+import meteordevelopment.meteorclient.events.game.OpenScreenEvent;
+import meteordevelopment.meteorclient.events.packets.PacketEvent;
+import meteordevelopment.meteorclient.events.render.Render3DEvent;
+import meteordevelopment.meteorclient.events.world.TickEvent;
+import meteordevelopment.meteorclient.renderer.ShapeMode;
+import meteordevelopment.meteorclient.settings.*;
+import meteordevelopment.meteorclient.systems.modules.Module;
+import meteordevelopment.meteorclient.utils.player.ChatUtils;
+import meteordevelopment.meteorclient.utils.render.RenderUtils;
+import meteordevelopment.meteorclient.utils.render.color.Color;
+import meteordevelopment.meteorclient.utils.render.color.SettingColor;
+import meteordevelopment.orbit.EventHandler;
+import net.minecraft.block.BlockState;
+import net.minecraft.block.Blocks;
+import net.minecraft.client.gui.screen.DisconnectedScreen;
+import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
+import net.minecraft.nbt.NbtCompound;
+import net.minecraft.network.packet.c2s.play.AcknowledgeChunksC2SPacket;
+import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
+import net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket;
+import net.minecraft.text.Text;
+import net.minecraft.util.math.*;
+import net.minecraft.world.World;
+import net.minecraft.world.chunk.*;
+import pwn.noobs.trouserstreak.Trouser;
+
+import java.util.*;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.CompletionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+public class PortalPatternFinder extends Module {
+ private final SettingGroup sgGeneral = settings.getDefaultGroup();
+ private final SettingGroup sgRender = settings.createGroup("Render");
+ private final Setting displaycoords = sgGeneral.add(new BoolSetting.Builder()
+ .name("DisplayCoords")
+ .description("Displays coords of portal patterns in chat.")
+ .defaultValue(true)
+ .build()
+ );
+ private final Setting ignorecorners = sgGeneral.add(new BoolSetting.Builder()
+ .name("ignore-corner-blocks")
+ .description("Also matches portal patterns that are missing the corner blocks.")
+ .defaultValue(true)
+ .build()
+ );
+ private final Setting falsepositives1 = sgGeneral.add(new BoolSetting.Builder()
+ .name("False Positive Removal")
+ .description("Removes false positives in relation to the air above and below the portal pattern.")
+ .defaultValue(true)
+ .build()
+ );
+ public final Setting nonAirPercent = sgGeneral.add(new IntSetting.Builder()
+ .name("Non-Air Percent")
+ .description("What percentage of the blocks in the portal shape can be non-air.")
+ .defaultValue(20)
+ .min(0)
+ .sliderRange(0, 100)
+ .build()
+ );
+ public final Setting percent = sgGeneral.add(new IntSetting.Builder()
+ .name("Adjacent Air Percent")
+ .description("What percentage of the blocks in the portal shape that is allowed to have air blocks adjacent to it.")
+ .defaultValue(15)
+ .min(0)
+ .sliderRange(0,100)
+ .build()
+ );
+ public final Setting pWidth = sgGeneral.add(new IntSetting.Builder()
+ .name("Portal Width")
+ .description("finds portals that are up to this large")
+ .defaultValue(5)
+ .min(4)
+ .sliderRange(4,8)
+ .build()
+ );
+ public final Setting pHeight = sgGeneral.add(new IntSetting.Builder()
+ .name("Portal Height")
+ .description("finds portals that are up to this large")
+ .defaultValue(5)
+ .min(5)
+ .sliderRange(5,8)
+ .build()
+ );
+ private final Setting removerenderdist = sgRender.add(new BoolSetting.Builder()
+ .name("RemoveOutsideRenderDistance")
+ .description("Removes the cached portal patterns when they leave the defined render distance.")
+ .defaultValue(true)
+ .build()
+ );
+ public final Setting renderDistance = sgRender.add(new IntSetting.Builder()
+ .name("Render-Distance(Chunks)")
+ .description("How many chunks from the character to render the portal patterns.")
+ .defaultValue(32)
+ .min(6)
+ .sliderRange(6,1024)
+ .build()
+ );
+ private final Setting trcr = sgRender.add(new BoolSetting.Builder()
+ .name("Tracers")
+ .description("Show tracers to the portal patterns.")
+ .defaultValue(true)
+ .build()
+ );
+ private final Setting nearesttrcr = sgRender.add(new BoolSetting.Builder()
+ .name("Tracer to nearest Portal Only")
+ .description("Show only one tracer to the nearest portal pattern.")
+ .defaultValue(false)
+ .build()
+ );
+ private final Setting shapeMode = sgRender.add(new EnumSetting.Builder()
+ .name("shape-mode")
+ .description("How the shapes are rendered.")
+ .defaultValue(ShapeMode.Both)
+ .build()
+ );
+ private final Setting portalSideColor = sgRender.add(new ColorSetting.Builder()
+ .name("possible-portal-side-color")
+ .description("Color of possible portal locations.")
+ .defaultValue(new SettingColor(170, 0, 255, 55))
+ .visible(() -> (shapeMode.get() == ShapeMode.Sides || shapeMode.get() == ShapeMode.Both))
+ .build()
+ );
+ private final Setting portalLineColor = sgRender.add(new ColorSetting.Builder()
+ .name("possible-portal-line-color")
+ .description("Color of possible portal locations.")
+ .defaultValue(new SettingColor(170, 0, 255, 200))
+ .visible(() -> (shapeMode.get() == ShapeMode.Lines || shapeMode.get() == ShapeMode.Both || trcr.get()))
+ .build()
+ );
+ private static final ExecutorService taskExecutor = Executors.newCachedThreadPool();
+ private final Set scannedChunks = Collections.synchronizedSet(new HashSet<>());
+ private final Set possiblePortalLocations = Collections.synchronizedSet(new HashSet<>());
+ private int closestPortalX=2000000000;
+ private int closestPortalY=2000000000;
+ private int closestPortalZ=2000000000;
+ private double PortalDistance=2000000000;
+
+ public PortalPatternFinder() {
+ super(Trouser.Main,"PortalPatternFinder", "Scans for the shapes of broken/removed Nether Portals within the cave air blocks found in caves and underground structures in 1.13+ chunks. **May be useful for finding portal skips in the Nether**");
+ }
+
+ @Override
+ public void onActivate() {
+ clearChunkData();
+ scanTheAir();
+ }
+ private void scanTheAir() {
+ if (mc.world == null) return;
+ int renderdistance = renderDistance.get();
+ ChunkPos playerChunkPos = new ChunkPos(mc.player.getBlockPos());
+ List chunksToProcess = new ArrayList<>();
+
+ for (int chunkX = playerChunkPos.x - renderdistance; chunkX <= playerChunkPos.x + renderdistance; chunkX++) {
+ for (int chunkZ = playerChunkPos.z - renderdistance; chunkZ <= playerChunkPos.z + renderdistance; chunkZ++) {
+ chunksToProcess.add(new ChunkPos(chunkX, chunkZ));
+ }
+ }
+
+ chunksToProcess.parallelStream().forEach(chunkPos -> {
+ WorldChunk chunk = mc.world.getChunk(chunkPos.x, chunkPos.z);
+ if (chunk != null && !scannedChunks.contains(chunk.getPos())) {
+ processChunk(chunk);
+ scannedChunks.add(chunk.getPos());
+ }
+ });
+ }
+ @Override
+ public void onDeactivate() {
+ clearChunkData();
+ }
+ @EventHandler
+ private void onScreenOpen(OpenScreenEvent event) {
+ if (event.screen instanceof DisconnectedScreen || event.screen instanceof DownloadingTerrainScreen) clearChunkData();
+ }
+ @EventHandler
+ private void onGameLeft(GameLeftEvent event) {
+ clearChunkData();
+ }
+ private void clearChunkData(){
+ scannedChunks.clear();
+ possiblePortalLocations.clear();
+ closestPortalX=2000000000;
+ closestPortalY=2000000000;
+ closestPortalZ=2000000000;
+ PortalDistance=2000000000;
+ }
+ @EventHandler
+ private void onPreTick(TickEvent.Pre event) {
+ if (nearesttrcr.get()){
+ try {
+ if (possiblePortalLocations.stream().toList().size() > 0) {
+ for (int b = 0; b < possiblePortalLocations.stream().toList().size(); b++) {
+ if (PortalDistance > Math.sqrt(Math.pow(possiblePortalLocations.stream().toList().get(b).getCenter().x-1 - mc.player.getBlockX(), 2) + Math.pow(possiblePortalLocations.stream().toList().get(b).getCenter().z-1 - mc.player.getBlockZ(), 2))) {
+ closestPortalX = Math.round((float) possiblePortalLocations.stream().toList().get(b).getCenter().x-1);
+ closestPortalY = Math.round((float) possiblePortalLocations.stream().toList().get(b).getCenter().y-1);
+ closestPortalZ = Math.round((float) possiblePortalLocations.stream().toList().get(b).getCenter().z-1);
+ PortalDistance = Math.sqrt(Math.pow(possiblePortalLocations.stream().toList().get(b).getCenter().x-1 - mc.player.getBlockX(), 2) + Math.pow(possiblePortalLocations.stream().toList().get(b).getCenter().z-1 - mc.player.getBlockZ(), 2));
+ }
+ }
+ PortalDistance = 2000000000;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ if (removerenderdist.get())removeChunksOutsideRenderDistance();
+ }
+ @EventHandler
+ private void onReadPacket(PacketEvent.Receive event) {
+ if (event.packet instanceof AcknowledgeChunksC2SPacket)return; //for some reason this packet keeps getting cast to other packets
+ if (!(event.packet instanceof AcknowledgeChunksC2SPacket) && !(event.packet instanceof PlayerMoveC2SPacket) && event.packet instanceof ChunkDataS2CPacket packet && mc.world != null) {
+ ChunkPos playerActivityPos = new ChunkPos(packet.getChunkX(), packet.getChunkZ());
+
+ if (mc.world.getChunkManager().getChunk(packet.getChunkX(), packet.getChunkZ()) == null) {
+ WorldChunk chunk = new WorldChunk(mc.world, playerActivityPos);
+ try {
+ CompletableFuture future = CompletableFuture.runAsync(() -> {
+ chunk.loadFromPacket(packet.getChunkData().getSectionsDataBuf(), new NbtCompound(),
+ packet.getChunkData().getBlockEntities(packet.getChunkX(), packet.getChunkZ()));
+ }, taskExecutor);
+ future.join();
+ } catch (CompletionException e) {}
+ if (chunk != null && !scannedChunks.contains(chunk.getPos())) {
+ processChunk(chunk);
+ scannedChunks.add(chunk.getPos());
+ }
+ }
+ }
+ }
+
+ private void processChunk(WorldChunk chunk) {
+ int minY = mc.world.getBottomY();
+ int maxY = 180;
+ if (mc.world.getRegistryKey() == World.NETHER) maxY = 126;
+
+ for (int x = 0; x < 16; x++) {
+ for (int z = 0; z < 16; z++) {
+ for (int y = minY; y <= maxY; y++) {
+ BlockPos blockPos = new BlockPos(chunk.getPos().getStartX() + x, y, chunk.getPos().getStartZ() + z);
+ BlockState blockState = chunk.getBlockState(blockPos);
+
+ if (blockState.getBlock() == Blocks.CAVE_AIR) {
+ isSurroundingBlockRegAir(blockPos);
+ }
+ }
+ }
+ }
+ }
+
+ private void isSurroundingBlockRegAir(BlockPos bPos) {
+ BlockPos airPos=bPos.north();
+ BlockPos blockPastTheAir=bPos.north().add(0, 0, -1);
+ for (int dir = 1; dir <= 4; dir++) {
+ switch (dir) {
+ case 1 -> {
+ airPos = bPos.north();
+ blockPastTheAir = bPos.north().add(0, 0, -1);
+ }
+ case 2 -> {
+ airPos = bPos.south();
+ blockPastTheAir = bPos.south().add(0, 0, 1);
+ }
+ case 3 -> {
+ airPos = bPos.west();
+ blockPastTheAir = bPos.west().add(-1, 0, 0);
+ }
+ case 4 -> {
+ airPos = bPos.east();
+ blockPastTheAir = bPos.east().add(1, 0, 0);
+ }
+ }
+ if (mc.world.getBlockState(airPos).getBlock() == Blocks.AIR && mc.world.getBlockState(blockPastTheAir).getBlock() != Blocks.AIR) findAirShape(airPos);
+ }
+ }
+
+ private void findAirShape(BlockPos pos) {
+ final int squareWidth = pWidth.get();
+ final int squareHeight = pHeight.get();
+ int areaWidth = (squareWidth / 2) + 1;
+ int areaHeight = (squareHeight / 2) + 1;
+
+ List AirBlockPatternWEast = new ArrayList<>();
+ List AirBlockPatternNouth = new ArrayList<>();
+ int AirBlockPatternWEastREJECT = 0;
+ int AirBlockPatternNouthREJECT = 0;
+ int AirBlockPatternWEastREJECT2 = 0;
+ int AirBlockPatternNouthREJECT2 = 0;
+
+ for (int x = -areaWidth; x <= areaWidth; x++) {
+ for (int y = -areaHeight; y <= areaHeight; y++) {
+ BlockPos bPos = new BlockPos(pos.getX() + x, pos.getY() + y, pos.getZ());
+ if (mc.world.getBlockState(bPos).getBlock() == Blocks.AIR) {
+ int nonairblockonsides = 0;
+ BlockPos[] surroundingPositions = new BlockPos[] {
+ bPos.north(),
+ bPos.south()
+ };
+ for (BlockPos posi : surroundingPositions) {
+ if (mc.world.getBlockState(posi).getBlock() != Blocks.AIR) {
+ nonairblockonsides++;
+ }
+ }
+ if (nonairblockonsides>=2)AirBlockPatternWEast.add(bPos);
+ else {
+ AirBlockPatternWEastREJECT++;
+ AirBlockPatternWEast.add(bPos);
+ }
+ } else if (mc.world.getBlockState(bPos).getBlock() != Blocks.AIR && mc.world.getBlockState(bPos).getBlock() != Blocks.CAVE_AIR) {
+ AirBlockPatternWEastREJECT2++;
+ AirBlockPatternWEast.add(bPos);
+ }
+ }
+ }
+ for (int z = -areaWidth; z <= areaWidth; z++) {
+ for (int y = -areaHeight; y <= areaHeight; y++) {
+ BlockPos bPos = new BlockPos(pos.getX(), pos.getY() + y, pos.getZ() + z);
+ if (mc.world.getBlockState(bPos).getBlock() == Blocks.AIR) {
+ int nonairblockonsides = 0;
+ BlockPos[] surroundingPositions = new BlockPos[] {
+ bPos.west(),
+ bPos.east()
+ };
+ for (BlockPos posi : surroundingPositions) {
+ if (mc.world.getBlockState(posi).getBlock() != Blocks.AIR) {
+ nonairblockonsides++;
+ }
+ }
+ if (nonairblockonsides>=2)AirBlockPatternNouth.add(bPos);
+ else {
+ AirBlockPatternNouthREJECT++;
+ AirBlockPatternNouth.add(bPos);
+ }
+ } else if (mc.world.getBlockState(bPos).getBlock() != Blocks.AIR && mc.world.getBlockState(bPos).getBlock() != Blocks.CAVE_AIR) {
+ AirBlockPatternNouthREJECT2++;
+ AirBlockPatternNouth.add(bPos);
+ }
+ }
+ }
+
+ if (((double) AirBlockPatternWEastREJECT2 / (AirBlockPatternWEast.size()-AirBlockPatternWEastREJECT)) * 100 <= nonAirPercent.get() && ((double) AirBlockPatternWEastREJECT / AirBlockPatternWEast.size()) * 100 <= percent.get()) {
+ for (BlockPos block : AirBlockPatternWEast) {
+ for (int currentWidth = 4; currentWidth <= squareWidth; currentWidth++) {
+ for (int currentHeight = 5; currentHeight <= squareHeight; currentHeight++) {
+ if (isValidWEastPortalShape(AirBlockPatternWEast, block, currentWidth, currentHeight)) {
+ BlockPos boxStart = block;
+ BlockPos boxEnd = new BlockPos(boxStart.getX() + currentWidth - 1, boxStart.getY() + currentHeight - 1, boxStart.getZ());
+ boolean airfoundaboveorbelow = false;
+
+ if (falsepositives1.get()) {
+ for (int x = 0; x < currentWidth; x++) {
+ BlockPos blockPos = boxStart.add(x, -1, 0);
+ if (mc.world.getBlockState(blockPos).getBlock() == Blocks.AIR) airfoundaboveorbelow = true;
+ }
+ for (int x = 0; x < currentWidth; x++) {
+ BlockPos blockPos = boxStart.add(x, currentHeight + 1, 0);
+ if (mc.world.getBlockState(blockPos).getBlock() == Blocks.AIR) airfoundaboveorbelow = true;
+ }
+ if (airfoundaboveorbelow) continue;
+ }
+
+ Box portalBox = new Box(
+ new Vec3d(boxStart.getX(), boxStart.getY(), boxStart.getZ()),
+ new Vec3d(boxEnd.getX() + 1, boxEnd.getY() + 1, boxEnd.getZ() + 1)
+ );
+
+ boolean intersects = false;
+ for (Box existingBox : possiblePortalLocations) {
+ if (portalBox.intersects(existingBox)) {
+ intersects = true;
+ break;
+ }
+ }
+
+ if (!intersects) portalFound(portalBox);
+ }
+ }
+ }
+ }
+ }
+
+ if (((double) AirBlockPatternNouthREJECT2 / (AirBlockPatternNouth.size()-AirBlockPatternNouthREJECT)) * 100 <= nonAirPercent.get() && ((double) AirBlockPatternNouthREJECT / AirBlockPatternNouth.size()) * 100 <= percent.get()) {
+ for (BlockPos block : AirBlockPatternNouth) {
+ for (int currentWidth = 4; currentWidth <= squareWidth; currentWidth++) {
+ for (int currentHeight = 5; currentHeight <= squareHeight; currentHeight++) {
+ if (isValidNouthPortalShape(AirBlockPatternNouth, block, currentWidth, currentHeight)) {
+ BlockPos boxStart = block;
+ BlockPos boxEnd = new BlockPos(boxStart.getX(), boxStart.getY() + currentHeight - 1, boxStart.getZ() + currentWidth - 1);
+ boolean airfoundaboveorbelow = false;
+
+ if (falsepositives1.get()) {
+ for (int z = 0; z < currentWidth; z++) {
+ BlockPos blockPos = boxStart.add(0, -1, z);
+ if (mc.world.getBlockState(blockPos).getBlock() == Blocks.AIR)
+ airfoundaboveorbelow = true;
+ }
+ for (int z = 0; z < currentWidth; z++) {
+ BlockPos blockPos = boxStart.add(0, currentHeight + 1, z);
+ if (mc.world.getBlockState(blockPos).getBlock() == Blocks.AIR)
+ airfoundaboveorbelow = true;
+ }
+ if (airfoundaboveorbelow) continue;
+ }
+
+ Box portalBox = new Box(
+ new Vec3d(boxStart.getX(), boxStart.getY(), boxStart.getZ()),
+ new Vec3d(boxEnd.getX() + 1, boxEnd.getY() + 1, boxEnd.getZ() + 1)
+ );
+
+ boolean intersects = false;
+ for (Box existingBox : possiblePortalLocations) {
+ if (portalBox.intersects(existingBox)) {
+ intersects = true;
+ break;
+ }
+ }
+
+ if (!intersects) portalFound(portalBox);
+ }
+ }
+ }
+ }
+ }
+ }
+ private void portalFound(Box portalBox){
+ possiblePortalLocations.add(portalBox);
+ if (displaycoords.get())
+ ChatUtils.sendMsg(Text.of("Possible portal found: " + portalBox.getCenter()));
+ else if (!displaycoords.get()) ChatUtils.sendMsg(Text.of("Possible portal found!"));
+ }
+
+ private boolean isValidWEastPortalShape(List portalBlocks, BlockPos startBlock, Integer squareWidth, Integer squareHeight) {
+ for (int currentWidth = 4; currentWidth <= squareWidth; currentWidth++) {
+ for (int currentHeight = 5; currentHeight <= squareHeight; currentHeight++) {
+ boolean validShape = true;
+
+ for (int dx = 0; dx < currentWidth; dx++) {
+ for (int dy = 0; dy < currentHeight; dy++) {
+ BlockPos checkPos = startBlock.add(dx, dy, 0);
+
+ if (ignorecorners.get() && ((dx == 0 && dy == 0) || (dx == currentWidth - 1 && dy == 0) ||
+ (dx == 0 && dy == currentHeight - 1) || (dx == currentWidth - 1 && dy == currentHeight - 1))) {
+ continue;
+ }
+
+ if (!portalBlocks.contains(checkPos)) {
+ validShape = false;
+ break;
+ }
+ }
+ if (!validShape) break;
+ }
+
+ if (validShape) return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean isValidNouthPortalShape(List portalBlocks, BlockPos startBlock, Integer squareWidth, Integer squareHeight) {
+ for (int currentWidth = 4; currentWidth <= squareWidth; currentWidth++) {
+ for (int currentHeight = 5; currentHeight <= squareHeight; currentHeight++) {
+ boolean validShape = true;
+
+ for (int dz = 0; dz < currentWidth; dz++) {
+ for (int dy = 0; dy < currentHeight; dy++) {
+ BlockPos checkPos = startBlock.add(0, dy, dz);
+
+ if (ignorecorners.get() && ((dz == 0 && dy == 0) || (dz == currentWidth - 1 && dy == 0) ||
+ (dz == 0 && dy == currentHeight - 1) || (dz == currentWidth - 1 && dy == currentHeight - 1))) {
+ continue;
+ }
+
+ if (!portalBlocks.contains(checkPos)) {
+ validShape = false;
+ break;
+ }
+ }
+ if (!validShape) break;
+ }
+
+ if (validShape) return true;
+ }
+ }
+ return false;
+ }
+
+ @EventHandler
+ private void onRender(Render3DEvent event) {
+ if (portalSideColor.get().a > 5 || portalLineColor.get().a > 5) {
+ synchronized (possiblePortalLocations) {
+ if (!nearesttrcr.get()) {
+ for (Box box : possiblePortalLocations) {
+ BlockPos playerPos = new BlockPos(mc.player.getBlockX(), Math.round((float)box.getCenter().getY()), mc.player.getBlockZ());
+ if (box != null && playerPos.isWithinDistance(box.getCenter(), renderDistance.get() * 16)) {
+ render(box, portalSideColor.get(), portalLineColor.get(), shapeMode.get(), event);
+ }
+ }
+ } else if (nearesttrcr.get()) {
+ for (Box box : possiblePortalLocations) {
+ BlockPos playerPos = new BlockPos(mc.player.getBlockX(), Math.round((float)box.getCenter().getY()), mc.player.getBlockZ());
+ if (box != null && playerPos.isWithinDistance(box.getCenter(), renderDistance.get() * 16)) {
+ render(box, portalSideColor.get(), portalLineColor.get(), shapeMode.get(), event);
+ }
+ }
+ render2(new Box(new Vec3d(closestPortalX, closestPortalY, closestPortalZ), new Vec3d (closestPortalX, closestPortalY, closestPortalZ)), portalSideColor.get(), portalLineColor.get(),ShapeMode.Sides, event);
+ }
+ }
+ }
+ }
+ private void render(Box box, Color sides, Color lines, ShapeMode shapeMode, Render3DEvent event) {
+ if (trcr.get() && Math.abs(box.minX- RenderUtils.center.x)<=renderDistance.get()*16 && Math.abs(box.minZ-RenderUtils.center.z)<=renderDistance.get()*16)
+ if (!nearesttrcr.get())
+ event.renderer.line(RenderUtils.center.x, RenderUtils.center.y, RenderUtils.center.z, box.minX+0.5, box.minY+((box.maxY-box.minY)/2), box.minZ+0.5, lines);
+ event.renderer.box(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, sides, new Color(0,0,0,0), shapeMode, 0);
+ }
+ private void render2(Box box, Color sides, Color lines, ShapeMode shapeMode, Render3DEvent event) {
+ if (trcr.get() && Math.abs(box.minX-RenderUtils.center.x)<=renderDistance.get()*16 && Math.abs(box.minZ-RenderUtils.center.z)<=renderDistance.get()*16)
+ event.renderer.line(RenderUtils.center.x, RenderUtils.center.y, RenderUtils.center.z, box.minX+0.5, box.minY+((box.maxY-box.minY)/2), box.minZ+0.5, lines);
+ event.renderer.box(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, sides, new Color(0,0,0,0), shapeMode, 0);
+ }
+ private void removeChunksOutsideRenderDistance() {
+ double renderDistanceBlocks = renderDistance.get() * 16;
+
+ removechunksOutsideRenderDistance(scannedChunks, mc.player.getBlockPos(), renderDistanceBlocks);
+ removeChunksOutsideRenderDistance(possiblePortalLocations, renderDistanceBlocks);
+ }
+ private void removeChunksOutsideRenderDistance(Set boxSet, double renderDistanceBlocks) {
+ boxSet.removeIf(box -> {
+ BlockPos playerPos = new BlockPos(mc.player.getBlockX(), Math.round((float)box.getCenter().getY()), mc.player.getBlockZ());
+ return !playerPos.isWithinDistance(box.getCenter(), renderDistanceBlocks);
+ });
+ }
+ private void removechunksOutsideRenderDistance(Set chunkSet, BlockPos playerPos, double renderDistanceBlocks) {
+ chunkSet.removeIf(c -> !playerPos.isWithinDistance(new BlockPos(c.getCenterX(), mc.player.getBlockY(), c.getCenterZ()), renderDistanceBlocks));
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/PotESP.java b/src/main/java/pwn/noobs/trouserstreak/modules/PotESP.java
index 291afaf8..c24404e4 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/PotESP.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/PotESP.java
@@ -1,17 +1,22 @@
//made by etianl :D
package pwn.noobs.trouserstreak.modules;
+import meteordevelopment.meteorclient.events.game.GameLeftEvent;
+import meteordevelopment.meteorclient.events.game.OpenScreenEvent;
import meteordevelopment.meteorclient.events.render.Render3DEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.renderer.ShapeMode;
import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
+import meteordevelopment.meteorclient.utils.render.RenderUtils;
import meteordevelopment.meteorclient.utils.render.color.Color;
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.DecoratedPotBlockEntity;
+import net.minecraft.client.gui.screen.DisconnectedScreen;
+import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.text.Text;
@@ -48,7 +53,7 @@ public class PotESP extends Module {
);
public final Setting renderDistance = sgRender.add(new IntSetting.Builder()
.name("Render-Distance(Chunks)")
- .description("How many chunks from the character to render the detected chunks.")
+ .description("How many chunks from the character to render the detected pots.")
.defaultValue(32)
.min(6)
.sliderRange(6,1024)
@@ -56,10 +61,22 @@ public class PotESP extends Module {
);
private final Setting removerenderdist = sgRender.add(new BoolSetting.Builder()
.name("RemoveOutsideRenderDistance")
- .description("Removes the cached chunks when they leave the defined render distance.")
+ .description("Removes the cached pots when they leave the defined render distance.")
.defaultValue(true)
.build()
);
+ private final Setting trcr = sgRender.add(new BoolSetting.Builder()
+ .name("Tracers")
+ .description("Show tracers to the pots.")
+ .defaultValue(true)
+ .build()
+ );
+ private final Setting nearesttrcr = sgRender.add(new BoolSetting.Builder()
+ .name("Tracer to nearest Pot Only")
+ .description("Show only one tracer to the nearest pot.")
+ .defaultValue(false)
+ .build()
+ );
private final Setting shapeMode = sgRender.add(new EnumSetting.Builder()
.name("shape-mode")
.description("How the shapes are rendered.")
@@ -77,10 +94,9 @@ public class PotESP extends Module {
.name("pot-line-color")
.description("Color of the dank pot.")
.defaultValue(new SettingColor(255, 135, 125, 235))
- .visible(() -> (shapeMode.get() == ShapeMode.Lines || shapeMode.get() == ShapeMode.Both))
+ .visible(() -> (shapeMode.get() == ShapeMode.Lines || shapeMode.get() == ShapeMode.Both || trcr.get()))
.build()
);
-
private final Set potLocations = Collections.synchronizedSet(new HashSet<>());
private static final Set- naturalPot = new HashSet<>();
static {
@@ -95,20 +111,40 @@ public class PotESP extends Module {
naturalPot.add(Items.DIAMOND_BLOCK);
naturalPot.add(Items.MUSIC_DISC_CREATOR_MUSIC_BOX);
}
+ private int closestPotX=2000000000;
+ private int closestPotY=2000000000;
+ private int closestPotZ=2000000000;
+ private double PotDistance=2000000000;
public PotESP() {
super(Trouser.Main,"PotESP", "Finds the dank pots... In Minecraft (Locates decorated pots with un-natural items in them)");
}
@Override
public void onActivate() {
- potLocations.clear();
+ clearChunkData();
}
@Override
public void onDeactivate() {
+ clearChunkData();
+ }
+ @EventHandler
+ private void onScreenOpen(OpenScreenEvent event) {
+ if (event.screen instanceof DisconnectedScreen || event.screen instanceof DownloadingTerrainScreen) clearChunkData();
+ }
+ @EventHandler
+ private void onGameLeft(GameLeftEvent event) {
+ clearChunkData();
+ }
+ private void clearChunkData(){
potLocations.clear();
+ closestPotX=2000000000;
+ closestPotY=2000000000;
+ closestPotZ=2000000000;
+ PotDistance=2000000000;
}
@EventHandler
private void onPreTick(TickEvent.Pre event) {
if (mc.world == null) return;
+
int renderDistance = mc.options.getViewDistance().getValue();
ChunkPos playerChunkPos = new ChunkPos(mc.player.getBlockPos());
for (int chunkX = playerChunkPos.x - renderDistance; chunkX <= playerChunkPos.x + renderDistance; chunkX++) {
@@ -134,30 +170,71 @@ private void onPreTick(TickEvent.Pre event) {
}
}
}
+ if (nearesttrcr.get()){
+ try {
+ if (potLocations.stream().toList().size() > 0) {
+ for (int b = 0; b < potLocations.stream().toList().size(); b++) {
+ if (PotDistance > Math.sqrt(Math.pow(potLocations.stream().toList().get(b).getX() - mc.player.getBlockX(), 2) + Math.pow(potLocations.stream().toList().get(b).getZ() - mc.player.getBlockZ(), 2))) {
+ closestPotX = potLocations.stream().toList().get(b).getX();
+ closestPotY = potLocations.stream().toList().get(b).getY();
+ closestPotZ = potLocations.stream().toList().get(b).getZ();
+ PotDistance = Math.sqrt(Math.pow(potLocations.stream().toList().get(b).getX() - mc.player.getBlockX(), 2) + Math.pow(potLocations.stream().toList().get(b).getZ() - mc.player.getBlockZ(), 2));
+ }
+ }
+ PotDistance = 2000000000;
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
if (removerenderdist.get())removeChunksOutsideRenderDistance();
}
@EventHandler
private void onRender(Render3DEvent event) {
if ((potSideColor.get().a > 5 || potLineColor.get().a > 5) && mc.player != null) {
synchronized (potLocations) {
- for (BlockPos pos : potLocations) {
+ if (!nearesttrcr.get()) {
+ for (BlockPos pos : potLocations) {
BlockPos playerPos = new BlockPos(mc.player.getBlockX(), pos.getY(), mc.player.getBlockZ());
- if (pos != null && playerPos.isWithinDistance(pos, renderDistance.get() * 16)) {
- int startX = pos.getX();
- int startY = pos.getY();
- int startZ = pos.getZ();
- int endX = pos.getX();
- int endY = pos.getY();
- int endZ = pos.getZ();
- render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), potSideColor.get(), potLineColor.get(), shapeMode.get(), event);
+ if (pos != null && playerPos.isWithinDistance(pos, renderDistance.get() * 16)) {
+ int startX = pos.getX();
+ int startY = pos.getY();
+ int startZ = pos.getZ();
+ int endX = pos.getX();
+ int endY = pos.getY();
+ int endZ = pos.getZ();
+ render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), potSideColor.get(), potLineColor.get(), shapeMode.get(), event);
+ }
}
+ } else if (nearesttrcr.get()){
+ for (BlockPos pos : potLocations) {
+ BlockPos playerPos = new BlockPos(mc.player.getBlockX(), pos.getY(), mc.player.getBlockZ());
+ if (pos != null && playerPos.isWithinDistance(pos, renderDistance.get() * 16)) {
+ int startX = pos.getX();
+ int startY = pos.getY();
+ int startZ = pos.getZ();
+ int endX = pos.getX();
+ int endY = pos.getY();
+ int endZ = pos.getZ();
+ render(new Box(new Vec3d(startX+1, startY+1, startZ+1), new Vec3d(endX, endY, endZ)), potSideColor.get(), potLineColor.get(), shapeMode.get(), event);
+ }
+ }
+ render2(new Box(new Vec3d(closestPotX+1, closestPotY+1, closestPotZ+1), new Vec3d (closestPotX, closestPotY, closestPotZ)), potSideColor.get(), potLineColor.get(),ShapeMode.Sides, event);
}
}
}
}
private void render(Box box, Color sides, Color lines, ShapeMode shapeMode, Render3DEvent event) {
- event.renderer.box(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, sides, lines, shapeMode, 0);
+ if (trcr.get() && Math.abs(box.minX- RenderUtils.center.x)<=renderDistance.get()*16 && Math.abs(box.minZ-RenderUtils.center.z)<=renderDistance.get()*16)
+ if (!nearesttrcr.get())
+ event.renderer.line(RenderUtils.center.x, RenderUtils.center.y, RenderUtils.center.z, box.minX+0.5, box.minY+((box.maxY-box.minY)/2), box.minZ+0.5, lines);
+ event.renderer.box(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, sides, new Color(0,0,0,0), shapeMode, 0);
+ }
+ private void render2(Box box, Color sides, Color lines, ShapeMode shapeMode, Render3DEvent event) {
+ if (trcr.get() && Math.abs(box.minX-RenderUtils.center.x)<=renderDistance.get()*16 && Math.abs(box.minZ-RenderUtils.center.z)<=renderDistance.get()*16)
+ event.renderer.line(RenderUtils.center.x, RenderUtils.center.y, RenderUtils.center.z, box.minX+0.5, box.minY+((box.maxY-box.minY)/2), box.minZ+0.5, lines);
+ event.renderer.box(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ, sides, new Color(0,0,0,0), shapeMode, 0);
}
private void removeChunksOutsideRenderDistance() {
double renderDistanceBlocks = renderDistance.get() * 16;
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/RedstoneNuker.java b/src/main/java/pwn/noobs/trouserstreak/modules/RedstoneNuker.java
index 6eaa635f..89f5209d 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/RedstoneNuker.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/RedstoneNuker.java
@@ -482,7 +482,7 @@ else if (sortMode.get() != SortMode.None)
@EventHandler
private void onTick(TickEvent.Post event) {
- if (Modules.get().isActive(InfinityMiner.class)) return;
+ if (Modules.get().isActive(InfinityMiner.class) || mc.world == null || mc.player == null) return;
if (switchBack.get() && !mc.options.attackKey.isPressed() && wasPressed && InvUtils.previousSlot != -1) {
InvUtils.swapBack();
@@ -502,7 +502,7 @@ private void onTick(TickEvent.Post event) {
@EventHandler(priority = EventPriority.HIGH)
private void onStartBreakingBlock(StartBreakingBlockEvent event) {
- if (Modules.get().isActive(InfinityMiner.class) || mc.world == null || mc.player == null) return;
+ if (Modules.get().isActive(InfinityMiner.class)) return;
// Get blockState
BlockState blockState = mc.world.getBlockState(event.blockPos);
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/ShulkerDupe.java b/src/main/java/pwn/noobs/trouserstreak/modules/ShulkerDupe.java
index ebee4835..c1909188 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/ShulkerDupe.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/ShulkerDupe.java
@@ -60,9 +60,9 @@ private void onTick(TickEvent.Pre event) {
Modules.get().get(Timer.class).toggle();
}
for (int i = 0; i < 8; i++) {
- if (autoT.get() && (mc.player.getInventory().getStack(0).getItem() instanceof PickaxeItem || mc.player.getInventory().getStack(1).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(2).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(3).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(4).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(5).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(6).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(7).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(8).getItem() instanceof PickaxeItem) && !(mc.player.getInventory().getMainHandStack().getItem() instanceof PickaxeItem)){
- mc.player.getInventory().selectedSlot++;
- if (mc.player.getInventory().selectedSlot>8) mc.player.getInventory().selectedSlot=0;
+ if (autoT.get() && (mc.player.getInventory().getStack(0).getItem() instanceof PickaxeItem || mc.player.getInventory().getStack(1).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(2).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(3).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(4).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(5).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(6).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(7).getItem() instanceof PickaxeItem ||mc.player.getInventory().getStack(8).getItem() instanceof PickaxeItem) && !(mc.player.getInventory().getMainHandStack().getItem() instanceof PickaxeItem)){
+ mc.player.getInventory().selectedSlot++;
+ if (mc.player.getInventory().selectedSlot>8) mc.player.getInventory().selectedSlot=0;
}
}
} else if (!shouldDupe| !shouldDupeAll){
@@ -79,7 +79,7 @@ private void onTick(TickEvent.Post event) {
HitResult wow = mc.crosshairTarget;
BlockHitResult a = (BlockHitResult) wow;
if (shouldDupe| shouldDupeAll){
- mc.interactionManager.updateBlockBreakingProgress(a.getBlockPos(), Direction.DOWN);
+ mc.interactionManager.updateBlockBreakingProgress(a.getBlockPos(), Direction.DOWN);
}
}
}
@@ -88,17 +88,17 @@ private void onTick(TickEvent.Post event) {
public void onSendPacket(PacketEvent.Sent event) {
if (event.packet instanceof PlayerActionC2SPacket && mc.interactionManager != null && mc.player != null) {
if (shouldDupeAll){
- if (((PlayerActionC2SPacket) event.packet).getAction() == PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK) {
- for (int i = 0; i < 27; i++) {
- mc.interactionManager.clickSlot(mc.player.currentScreenHandler.syncId, i, 0, SlotActionType.QUICK_MOVE, mc.player);
+ if (((PlayerActionC2SPacket) event.packet).getAction() == PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK) {
+ for (int i = 0; i < 27; i++) {
+ mc.interactionManager.clickSlot(mc.player.currentScreenHandler.syncId, i, 0, SlotActionType.QUICK_MOVE, mc.player);
+ }
+ shouldDupeAll=false;
}
- shouldDupeAll=false;
- }
} else if (shouldDupe){
- if (((PlayerActionC2SPacket) event.packet).getAction() == PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK) {
+ if (((PlayerActionC2SPacket) event.packet).getAction() == PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK) {
mc.interactionManager.clickSlot(mc.player.currentScreenHandler.syncId, 0, 0, SlotActionType.QUICK_MOVE, mc.player);
shouldDupe=false;
- }
+ }
}
}
}
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/StorageLooter.java b/src/main/java/pwn/noobs/trouserstreak/modules/StorageLooter.java
index be3aa435..6595f91d 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/StorageLooter.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/StorageLooter.java
@@ -386,7 +386,7 @@ private int getEntityId(PlayerInteractEntityC2SPacket packet) {
}
@EventHandler
private void onTickPre(TickEvent.Pre event) {
- if (!hasEnoughFreeSlots() && stopLoot.get() || mc.player == null || mc.world == null) return;
+ if ((!hasEnoughFreeSlots() && stopLoot.get()) || mc.player == null || mc.world == null) return;
updateReach();
int bottomlimit = (int) (mc.player.getBlockY() - Math.round(Math.ceil(reach)));
if (!isContainerScreen(mc.player.currentScreenHandler)) autoStealTicks = 0;
@@ -395,7 +395,7 @@ private void onTickPre(TickEvent.Pre event) {
Block block = blockState.getBlock();
if (isValidContainerBlock(block) && containerList.get().contains(block.asItem())) {
- if (isContainerScreen(mc.player.currentScreenHandler)) {
+ if (mc.player.currentScreenHandler != null && isContainerScreen(mc.player.currentScreenHandler)) {
if (autoStealTicks == 0) {
processContainerItems();
}
@@ -410,7 +410,7 @@ else if (autoStealTicks>=autoStealDelay.get()){
}
for (Entity entity : mc.world.getEntities()) {
if (entity.getBlockPos().equals(lastInteractedBlockPos) && entity instanceof ChestMinecartEntity && containerList.get().contains(Items.CHEST_MINECART)) {
- if (isContainerScreen(mc.player.currentScreenHandler)) {
+ if (mc.player.currentScreenHandler != null && isContainerScreen(mc.player.currentScreenHandler)) {
if (autoStealTicks == 0) {
processContainerItems();
}
@@ -743,7 +743,7 @@ private void processChestsAfterDelay() {
chestsToProcess.entrySet().removeIf(entry -> {
int delay = entry.getValue();
if (delay <= 0) {
- if (isContainerScreen(mc.player.currentScreenHandler)) {
+ if (mc.player.currentScreenHandler != null && isContainerScreen(mc.player.currentScreenHandler)) {
processContainerItems();
mc.player.closeHandledScreen();
if (rotate.get()){
@@ -1019,6 +1019,7 @@ private int getItemCount(Item item, List
- itemList) {
assert mc.player != null;
int count = 0;
String itemName = item.toString().toLowerCase();
+
for (ItemStack stack : mc.player.getInventory().main) {
Item stackItem = stack.getItem();
if (isSameItem(stackItem, item, itemName)) {
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/TPFly.java b/src/main/java/pwn/noobs/trouserstreak/modules/TPFly.java
index 7910e002..af051309 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/TPFly.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/TPFly.java
@@ -203,25 +203,25 @@ private void onTick(TickEvent.Post event) {
if (mc.player.getMovementDirection() == Direction.NORTH) {
BlockPos pos12 = playerPos.add(new Vec3i(0,0,-Range));
if (mc.world.getBlockState(pos12).isReplaceable() && mc.world.getBlockState(pos12).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()-Range);
+ mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()-Range);
}
}
if (mc.player.getMovementDirection() == Direction.SOUTH) {
BlockPos pos13 = playerPos.add(new Vec3i(0,0,Range));
if (mc.world.getBlockState(pos13).isReplaceable() && mc.world.getBlockState(pos13).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()+Range);
+ mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()+Range);
}
}
if (mc.player.getMovementDirection() == Direction.EAST) {
BlockPos pos14 = playerPos.add(new Vec3i(Range,0,0));
if (mc.world.getBlockState(pos14).isReplaceable() && mc.world.getBlockState(pos14).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX()+Range,mc.player.getY(),mc.player.getZ());
+ mc.player.setPos(mc.player.getX()+Range,mc.player.getY(),mc.player.getZ());
}
}
if (mc.player.getMovementDirection() == Direction.WEST) {
BlockPos pos15 = playerPos.add(new Vec3i(-Range,0,0));
if (mc.world.getBlockState(pos15).isReplaceable() && mc.world.getBlockState(pos15).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX()-Range,mc.player.getY(),mc.player.getZ());
+ mc.player.setPos(mc.player.getX()-Range,mc.player.getY(),mc.player.getZ());
}
}
}
@@ -230,25 +230,25 @@ private void onTick(TickEvent.Post event) {
if (mc.player.getMovementDirection() == Direction.NORTH) {
BlockPos pos16 = playerPos.add(new Vec3i(0,0,Range));
if (mc.world.getBlockState(pos16).isReplaceable() && mc.world.getBlockState(pos16).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()+Range);
+ mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()+Range);
}
}
if (mc.player.getMovementDirection() == Direction.SOUTH) {
BlockPos pos17 = playerPos.add(new Vec3i(0,0,-Range));
if (mc.world.getBlockState(pos17).isReplaceable() && mc.world.getBlockState(pos17).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()-Range);
+ mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()-Range);
}
}
if (mc.player.getMovementDirection() == Direction.EAST) {
BlockPos pos18 = playerPos.add(new Vec3i(-Range,0,0));
if (mc.world.getBlockState(pos18).isReplaceable() && mc.world.getBlockState(pos18).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX()-Range,mc.player.getY(),mc.player.getZ());
+ mc.player.setPos(mc.player.getX()-Range,mc.player.getY(),mc.player.getZ());
}
}
if (mc.player.getMovementDirection() == Direction.WEST) {
BlockPos pos19 = playerPos.add(new Vec3i(Range,0,0));
if (mc.world.getBlockState(pos19).isReplaceable() && mc.world.getBlockState(pos19).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX()+Range,mc.player.getY(),mc.player.getZ());
+ mc.player.setPos(mc.player.getX()+Range,mc.player.getY(),mc.player.getZ());
}
}
}
@@ -257,25 +257,25 @@ private void onTick(TickEvent.Post event) {
if (mc.player.getMovementDirection() == Direction.NORTH) {
BlockPos pos20 = playerPos.add(new Vec3i(0,0,-Range));
if (mc.world.getBlockState(pos20).isReplaceable() && mc.world.getBlockState(pos20).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX()-Range,mc.player.getY(),mc.player.getZ());
+ mc.player.setPos(mc.player.getX()-Range,mc.player.getY(),mc.player.getZ());
}
}
if (mc.player.getMovementDirection() == Direction.SOUTH) {
BlockPos pos21 = playerPos.add(new Vec3i(0,0,Range));
if (mc.world.getBlockState(pos21).isReplaceable() && mc.world.getBlockState(pos21).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX()+Range,mc.player.getY(),mc.player.getZ());
+ mc.player.setPos(mc.player.getX()+Range,mc.player.getY(),mc.player.getZ());
}
}
if (mc.player.getMovementDirection() == Direction.EAST) {
BlockPos pos22 = playerPos.add(new Vec3i(Range,0,0));
if (mc.world.getBlockState(pos22).isReplaceable() && mc.world.getBlockState(pos22).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()-Range);
+ mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()-Range);
}
}
if (mc.player.getMovementDirection() == Direction.WEST) {
BlockPos pos23 = playerPos.add(new Vec3i(-Range,0,0));
if (mc.world.getBlockState(pos23).isReplaceable() && mc.world.getBlockState(pos23).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()+Range);
+ mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()+Range);
}
}
}
@@ -284,25 +284,25 @@ private void onTick(TickEvent.Post event) {
if (mc.player.getMovementDirection() == Direction.NORTH) {
BlockPos pos24 = playerPos.add(new Vec3i(0,0,-Range));
if (mc.world.getBlockState(pos24).isReplaceable() && mc.world.getBlockState(pos24).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX()+Range,mc.player.getY(),mc.player.getZ());
+ mc.player.setPos(mc.player.getX()+Range,mc.player.getY(),mc.player.getZ());
}
}
if (mc.player.getMovementDirection() == Direction.SOUTH) {
BlockPos pos25 = playerPos.add(new Vec3i(0,0,Range));
if (mc.world.getBlockState(pos25).isReplaceable() && mc.world.getBlockState(pos25).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX()-Range,mc.player.getY(),mc.player.getZ());
+ mc.player.setPos(mc.player.getX()-Range,mc.player.getY(),mc.player.getZ());
}
}
if (mc.player.getMovementDirection() == Direction.EAST) {
BlockPos pos26 = playerPos.add(new Vec3i(Range,0,0));
if (mc.world.getBlockState(pos26).isReplaceable() && mc.world.getBlockState(pos26).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()+Range);
+ mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()+Range);
}
}
if (mc.player.getMovementDirection() == Direction.WEST) {
BlockPos pos27 = playerPos.add(new Vec3i(-Range,0,0));
if (mc.world.getBlockState(pos27).isReplaceable() && mc.world.getBlockState(pos27).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()-Range);
+ mc.player.setPos(mc.player.getX(),mc.player.getY(),mc.player.getZ()-Range);
}
}
}
@@ -316,7 +316,7 @@ private void onTick(TickEvent.Post event) {
BlockPos pos10 = playerPos.add(new Vec3i(0,5,0));
BlockPos pos11 = playerPos.add(new Vec3i(0,6,0));
if (mc.world.getBlockState(pos6).isReplaceable() && mc.world.getBlockState(pos7).isReplaceable() && mc.world.getBlockState(pos8).isReplaceable() && mc.world.getBlockState(pos9).isReplaceable() && mc.world.getBlockState(pos10).isReplaceable() && mc.world.getBlockState(pos11).isReplaceable() && mc.world.getBlockState(pos6).getBlock() != Blocks.LAVA && mc.world.getBlockState(pos7).getBlock() != Blocks.LAVA && mc.world.getBlockState(pos8).getBlock() != Blocks.LAVA && mc.world.getBlockState(pos9).getBlock() != Blocks.LAVA && mc.world.getBlockState(pos10).getBlock() != Blocks.LAVA && mc.world.getBlockState(pos11).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX(),mc.player.getY()+upRange,mc.player.getZ());
+ mc.player.setPos(mc.player.getX(),mc.player.getY()+upRange,mc.player.getZ());
}
} else if (mode.get() == Modes.WASDFly && mc.options.jumpKey.isPressed() && mc.options.backKey.isPressed()){
@@ -358,7 +358,7 @@ private void onTick(TickEvent.Post event) {
BlockPos pos4 = playerPos.add(new Vec3i(0,-5,0));
BlockPos pos5 = playerPos.add(new Vec3i(0,-6,0));
if (mc.world.getBlockState(pos).isReplaceable() && mc.world.getBlockState(pos1).isReplaceable() && mc.world.getBlockState(pos2).isReplaceable() && mc.world.getBlockState(pos3).isReplaceable() && mc.world.getBlockState(pos4).isReplaceable() && mc.world.getBlockState(pos5).isReplaceable() && mc.world.getBlockState(pos).getBlock() != Blocks.LAVA && mc.world.getBlockState(pos1).getBlock() != Blocks.LAVA && mc.world.getBlockState(pos2).getBlock() != Blocks.LAVA && mc.world.getBlockState(pos3).getBlock() != Blocks.LAVA && mc.world.getBlockState(pos4).getBlock() != Blocks.LAVA && mc.world.getBlockState(pos5).getBlock() != Blocks.LAVA){
- mc.player.setPos(mc.player.getX(),mc.player.getY()-downRange,mc.player.getZ());
+ mc.player.setPos(mc.player.getX(),mc.player.getY()-downRange,mc.player.getZ());
}
} else if (mode.get() == Modes.WASDFly && mc.options.sneakKey.isPressed() && mc.options.backKey.isPressed()){
mc.player.setPos(mc.player.getX(),mc.player.getY()-downRange,mc.player.getZ());
diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/TrouserBuild.java b/src/main/java/pwn/noobs/trouserstreak/modules/TrouserBuild.java
index b692d2ad..b2d53443 100644
--- a/src/main/java/pwn/noobs/trouserstreak/modules/TrouserBuild.java
+++ b/src/main/java/pwn/noobs/trouserstreak/modules/TrouserBuild.java
@@ -354,27 +354,27 @@ private void onPreTick(TickEvent.Pre event) {
if (playerdir == Direction.NORTH){
//1st row
if (ett){
- if (blockticks==tickdelay.get() && mc.world.getBlockState(Nettpos).isReplaceable()){
+ if (blockticks== tickdelay.get() && mc.world.getBlockState(Nettpos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Nettpos), Direction.DOWN, Nettpos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tva){
- if (blockticks==tickdelay.get() && mc.world.getBlockState(Ntvapos).isReplaceable()){
+ if (blockticks== tickdelay.get() && mc.world.getBlockState(Ntvapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Ntvapos), Direction.DOWN, Ntvapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tree){
- if (blockticks==tickdelay.get() && mc.world.getBlockState(Ntreepos).isReplaceable()){
+ if (blockticks== tickdelay.get() && mc.world.getBlockState(Ntreepos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Ntreepos), Direction.DOWN, Ntreepos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fyra){
- if (blockticks==tickdelay.get() && mc.world.getBlockState(Nfyrapos).isReplaceable()){
+ if (blockticks== tickdelay.get() && mc.world.getBlockState(Nfyrapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Nfyrapos), Direction.DOWN, Nfyrapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fem){
- if (blockticks==tickdelay.get() && mc.world.getBlockState(Nfempos).isReplaceable()){
+ if (blockticks== tickdelay.get() && mc.world.getBlockState(Nfempos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Nfempos), Direction.DOWN, Nfempos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
@@ -491,27 +491,27 @@ private void onPreTick(TickEvent.Pre event) {
if (playerdir == Direction.SOUTH){
//1st row
if (ett){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Settpos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Settpos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Settpos), Direction.DOWN, Settpos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tva){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Stvapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Stvapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Stvapos), Direction.DOWN, Stvapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tree){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Streepos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Streepos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Streepos), Direction.DOWN, Streepos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fyra){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Sfyrapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Sfyrapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Sfyrapos), Direction.DOWN, Sfyrapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fem){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Sfempos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Sfempos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Sfempos), Direction.DOWN, Sfempos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
@@ -628,27 +628,27 @@ private void onPreTick(TickEvent.Pre event) {
if (playerdir == Direction.EAST){
//1st row
if (ett){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Eettpos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Eettpos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Eettpos), Direction.DOWN, Eettpos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tva){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Etvapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Etvapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Etvapos), Direction.DOWN, Etvapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tree){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Etreepos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Etreepos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Etreepos), Direction.DOWN, Etreepos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fyra){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Efyrapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Efyrapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Efyrapos), Direction.DOWN, Efyrapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fem){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Efempos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Efempos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Efempos), Direction.DOWN, Efempos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
@@ -765,27 +765,27 @@ private void onPreTick(TickEvent.Pre event) {
if (playerdir == Direction.WEST){
//1st row
if (ett){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Wettpos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Wettpos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Wettpos), Direction.DOWN, Wettpos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tva){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Wtvapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Wtvapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Wtvapos), Direction.DOWN, Wtvapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tree){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Wtreepos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Wtreepos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Wtreepos), Direction.DOWN, Wtreepos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fyra){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Wfyrapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Wfyrapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Wfyrapos), Direction.DOWN, Wfyrapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fem){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Wfempos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Wfempos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Wfempos), Direction.DOWN, Wfempos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
@@ -1009,27 +1009,27 @@ private void onPreTick(TickEvent.Pre event) {
if (playerdir == Direction.NORTH){
//1st row
if (ett){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Nettpos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Nettpos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Nettpos), Direction.DOWN, Nettpos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tva){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Ntvapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Ntvapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Ntvapos), Direction.DOWN, Ntvapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tree){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Ntreepos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Ntreepos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Ntreepos), Direction.DOWN, Ntreepos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fyra){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Nfyrapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Nfyrapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Nfyrapos), Direction.DOWN, Nfyrapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fem){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Nfempos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Nfempos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Nfempos), Direction.DOWN, Nfempos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
@@ -1146,27 +1146,27 @@ private void onPreTick(TickEvent.Pre event) {
if (playerdir == Direction.SOUTH){
//1st row
if (ett){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Settpos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Settpos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Settpos), Direction.DOWN, Settpos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tva){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Stvapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Stvapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Stvapos), Direction.DOWN, Stvapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tree){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Streepos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Streepos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Streepos), Direction.DOWN, Streepos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fyra){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Sfyrapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Sfyrapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Sfyrapos), Direction.DOWN, Sfyrapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fem){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Sfempos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Sfempos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Sfempos), Direction.DOWN, Sfempos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
@@ -1283,27 +1283,27 @@ private void onPreTick(TickEvent.Pre event) {
if (playerdir == Direction.EAST){
//1st row
if (ett){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Eettpos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Eettpos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Eettpos), Direction.DOWN, Eettpos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tva){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Etvapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Etvapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Etvapos), Direction.DOWN, Etvapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tree){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Etreepos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Etreepos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Etreepos), Direction.DOWN, Etreepos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fyra){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Efyrapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Efyrapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Efyrapos), Direction.DOWN, Efyrapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fem){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Efempos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Efempos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Efempos), Direction.DOWN, Efempos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
@@ -1420,27 +1420,27 @@ private void onPreTick(TickEvent.Pre event) {
if (playerdir == Direction.WEST){
//1st row
if (ett){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Wettpos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Wettpos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Wettpos), Direction.DOWN, Wettpos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tva){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Wtvapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Wtvapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Wtvapos), Direction.DOWN, Wtvapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (tree){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Wtreepos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Wtreepos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Wtreepos), Direction.DOWN, Wtreepos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fyra){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Wfyrapos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Wfyrapos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Wfyrapos), Direction.DOWN, Wfyrapos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
if (fem){
- if (blockticks== tickdelay.get() && mc.world.getBlockState(Wfempos).isReplaceable()){
+ if (blockticks==tickdelay.get() && mc.world.getBlockState(Wfempos).isReplaceable()){
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(Vec3d.of(Wfempos), Direction.DOWN, Wfempos, false));
mc.player.swingHand(Hand.MAIN_HAND);}
}
diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json
index 43dcb7d1..3b46e07c 100644
--- a/src/main/resources/fabric.mod.json
+++ b/src/main/resources/fabric.mod.json
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "streak-addon",
- "version": "1.3.8",
+ "version": "1.3.9",
"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": [