Skip to content

Commit

Permalink
1.1.4 NewChunks and BaseFinder performance improvements
Browse files Browse the repository at this point in the history
- Updated the taskExecutor in **NewerNewChunks** to ensure all chunks are processed. This helps to eliminate the few false positives that were in association with the chunk data not loading in properly. 
- Replaced the PacketByteBuf reading with direct reading of the values we wanted to read by using an accessWidener in the code. This may improve performance because the client already interprets the bytes we are serializing.
- Adjusted the min and max setting for block scanning with BaseFinder. They now are based on how many blocks above or below the current build limit in the world to start scanning blocks. This should improve performance in the nether and end dimensions.
- Updated the taskexecutors in **NewerNewChunks** and **BaseFinder** to use a CachedThreadPool Executor instead of SingleThreadExecutor. This way they can share their tasks if both modules are running at the same time which improves chunk loading and detection with both modules when run at the same time.
  • Loading branch information
etianl authored Aug 5, 2024
1 parent 4754dd7 commit 50d32d5
Show file tree
Hide file tree
Showing 8 changed files with 99 additions and 237 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
[![Github All Releases](https://img.shields.io/github/downloads/etianl/Trouser-Streak/total.svg)]()

<div align="center">
<h1>Trouser-Streak</h1>
<p><strong>Official Griefing Utilities of <a href="https://www.youtube.com/@mountainsoflavainc.6913">Mountains of Lava Inc.</a></strong></p> <p>Trouser-Streak is a compilation of modules, updated to the latest version and optimized for maximum grief. I did not make all of these.</p>
<p>I frequently release updates, please check back here often! :)</p>
<h1><strong>Trouser-Streak</strong></h1>
<p><strong>Official Griefing Utilities of <a href="https://www.youtube.com/@mountainsoflavainc.6913">Mountains of Lava Inc.</a></strong></p>
<p><strong>Trouser-Streak</strong> is a compilation of modules for <strong><a href="https://meteorclient.com/">Meteor Client</a></strong>. <strong><em>Updated to the latest version and optimized for maximum grief!</em></strong></p>
<p>I frequently release updates, please check back here often :)</p>
<img src="src/main/resources/assets/icon/icon.png" alt="Trouser-Streak Logo" width="28%"/>
</div>

Total Downloads: [![Github All Releases](https://img.shields.io/github/downloads/etianl/Trouser-Streak/total.svg)]()
</div>

***A few of these modules were not made by me!***
## Credits to the people I skidded from:
In no particular order
- [DAMcraft (ServerSeeker)](https://github.com/DAMcraft/MeteorServerSeeker)
Expand Down
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ repositories {
maven { url "https://maven.meteordev.org/snapshots" }
}

loom {
accessWidenerPath = file("src/main/resources/streak-addon.accesswidener")
}

dependencies {
// Fabric
minecraft "com.mojang:minecraft:${project.minecraft_version}"
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ org.gradle.jvmargs=-Xmx2G

# Fabric (https://fabricmc.net/versions.html)
minecraft_version=1.21
yarn_mappings=1.21+build.2
yarn_mappings=1.21+build.9
loader_version=0.15.11

# Mod Properties
mod_version=1.1.3-1.21
mod_version=1.1.4-1.21
maven_group=pwn.noobs
archives_base_name=1trouser-streak

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/pwn/noobs/trouserstreak/Trouser.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ public String getPackage() {
return "pwn.noobs.trouserstreak";
}

}
}
30 changes: 16 additions & 14 deletions src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/*
Expand All @@ -64,18 +64,18 @@ public class BaseFinder extends Module {

// general
private final Setting<Integer> minY = sgGeneral.add(new IntSetting.Builder()
.name("Detection Y Minimum")
.description("Scans blocks from this Y value and up.")
.min(-64)
.sliderRange(-64,319)
.defaultValue(-64)
.name("Detection Y Minimum OffSet")
.description("Scans blocks above or at this this many blocks from minimum build limit.")
.min(0)
.sliderRange(0,319)
.defaultValue(0)
.build());
private final Setting<Integer> maxY = sgGeneral.add(new IntSetting.Builder()
.name("Detection Y Maximum")
.description("Scans blocks below or at this Y value.")
.min(-64)
.sliderRange(-64,319)
.defaultValue(319)
.name("Detection Y Maximum OffSet")
.description("Scans blocks below or at this this many blocks from maximum build limit.")
.min(0)
.sliderRange(0,319)
.defaultValue(0)
.build());
private final Setting<Boolean> skybuildfind = sgDetectors.add(new BoolSetting.Builder()
.name("Sky Build Finder")
Expand Down Expand Up @@ -437,7 +437,7 @@ public WWidget getWidget(GuiTheme theme) {
.visible(() -> trcr.get())
.build()
);
private final Executor taskExecutor = Executors.newSingleThreadExecutor();
private static final ExecutorService taskExecutor = Executors.newCachedThreadPool();
private int basefoundspamTicks=0;
private boolean basefound=false;
private int deletewarningTicks=666;
Expand All @@ -456,7 +456,7 @@ public WWidget getWidget(GuiTheme theme) {
private int found6 = 0;
private boolean checkingchunk7=false;
private int found7 = 0;
public ChunkPos LastBaseFound = new ChunkPos(2000000000, 2000000000);
private ChunkPos LastBaseFound = new ChunkPos(2000000000, 2000000000);
private int closestbaseX=2000000000;
private int closestbaseZ=2000000000;
private double basedistance=2000000000;
Expand Down Expand Up @@ -688,9 +688,11 @@ private void onReadPacket(PacketEvent.Receive event) {
}

if (Blawcks1.get().size()>0 || Blawcks2.get().size()>0 || Blawcks3.get().size()>0 || Blawcks4.get().size()>0 || Blawcks5.get().size()>0 || Blawcks6.get().size()>0 || Blawcks7.get().size()>0){
int Ymin = mc.world.getBottomY()+minY.get();
int Ymax = mc.world.getTopY()-maxY.get();
try {
for (int x = 0; x < 16; x++) {
for (int y = minY.get()-1; y < maxY.get()+1; y++) {
for (int y = Ymin; y < Ymax; y++) {
for (int z = 0; z < 16; z++) {
BlockState blerks = chunk.getBlockState(new BlockPos(x, y, z));
blockposi=new BlockPos(x, y, z);
Expand Down
Loading

0 comments on commit 50d32d5

Please sign in to comment.