Skip to content

Commit

Permalink
1.0.8 Fix derpy booleans, Make Chunk Tracing Great Again
Browse files Browse the repository at this point in the history
 fixed booleans that I broke
  • Loading branch information
etianl authored Jul 19, 2024
1 parent f422b84 commit 784cdf3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ yarn_mappings=1.21+build.2
loader_version=0.15.11

# Mod Properties
mod_version=1.0.7-1.21
mod_version=1.0.8-1.21
maven_group=pwn.noobs
archives_base_name=1trouser-streak

Expand Down
31 changes: 22 additions & 9 deletions src/main/java/pwn/noobs/trouserstreak/modules/NewerNewChunks.java
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ else if (!(event.packet instanceof PlayerMoveC2SPacket) && event.packet instance
}
}
}
if (!olderOldChunks.contains(oldpos) && oldchunksdetector.get() && !oldChunks.contains(oldpos) && !tickexploitChunks.contains(oldpos) && !newChunks.contains(oldpos) && foundAnyOre && isNewGeneration && mc.world.getRegistryKey().getValue().toString().toLowerCase().contains("overworld")) {
if (!olderOldChunks.contains(oldpos) && oldchunksdetector.get() && !oldChunks.contains(oldpos) && !tickexploitChunks.contains(oldpos) && !newChunks.contains(oldpos) && foundAnyOre && !isNewGeneration && mc.world.getRegistryKey().getValue().toString().toLowerCase().contains("overworld")) {
olderOldChunks.add(oldpos);
if (save.get()){
saveOlderOldChunkData(oldpos);
Expand Down Expand Up @@ -863,8 +863,8 @@ else if (!(event.packet instanceof PlayerMoveC2SPacket) && event.packet instance
if (biomeBitsPerEntry == 0) {
// Single valued palette
int singleBiomeValue = bufferCopy.readVarInt();
//Registry<Biome> biomeRegistry = mc.world.getRegistryManager().get(RegistryKeys.BIOME);
//Biome biome = biomeRegistry.get(singleBiomeValue);
Registry<Biome> biomeRegistry = mc.world.getRegistryManager().get(RegistryKeys.BIOME);
Biome biome = biomeRegistry.get(singleBiomeValue);
//System.out.println("Section: " + loops + " | Single Biome Value: " + singleBiomeValue + " | Biome: " + biome.toString());
bufferCopy.readVarInt(); // Data Array Length (should be 0)
} else if (biomeBitsPerEntry >= 1 && biomeBitsPerEntry <= 3) {
Expand All @@ -877,8 +877,8 @@ else if (!(event.packet instanceof PlayerMoveC2SPacket) && event.packet instance
break;
}
int biomePaletteEntry = bufferCopy.readVarInt();
//Registry<Biome> biomeRegistry = mc.world.getRegistryManager().get(RegistryKeys.BIOME);
//Biome biome = biomeRegistry.get(biomePaletteEntry);
Registry<Biome> biomeRegistry = mc.world.getRegistryManager().get(RegistryKeys.BIOME);
Biome biome = biomeRegistry.get(biomePaletteEntry);
//System.out.println("Section: " + loops + " | Biome palette entry " + i + ": " + biomePaletteEntry + " | Biome: " + biome.toString());
}

Expand Down Expand Up @@ -920,7 +920,7 @@ else if (!(event.packet instanceof PlayerMoveC2SPacket) && event.packet instance
if (loops > 0) {
if (mc.world.getRegistryKey() == World.NETHER){
double oldpercentage = ((double) oldChunkQuantifier / loops) * 100;
//System.out.println("Percentage: " + percentage);
//System.out.println("Percentage: " + oldpercentage);
if (oldpercentage >= 25) {
isNewChunk = false;
if (!olderOldChunks.contains(oldpos) && !oldChunks.contains(oldpos) && !tickexploitChunks.contains(oldpos) && !newChunks.contains(oldpos)) {
Expand All @@ -942,8 +942,21 @@ else if (!(event.packet instanceof PlayerMoveC2SPacket) && event.packet instance
}
} catch (Exception e) {
e.printStackTrace();
//System.out.println("newChunkQuantifier: " + newChunkQuantifier + ", loops: " + loops);
if (loops > 0) {
if (mc.world.getRegistryKey() == World.NETHER){
double oldpercentage = ((double) oldChunkQuantifier / loops) * 100;
//System.out.println("Percentage: " + percentage);
if (oldpercentage >= 25) {
isNewChunk = false;
if (!olderOldChunks.contains(oldpos) && !oldChunks.contains(oldpos) && !tickexploitChunks.contains(oldpos) && !newChunks.contains(oldpos)) {
olderOldChunks.add(oldpos);
if (save.get()){
saveOlderOldChunkData(oldpos);
}
return;
}
}
}
if (mc.world.getRegistryKey() == World.OVERWORLD){
double percentage = ((double) newChunkQuantifier / loops) * 100;
//System.out.println("Percentage: " + percentage);
if (percentage >= 65) {
Expand All @@ -953,7 +966,7 @@ else if (!(event.packet instanceof PlayerMoveC2SPacket) && event.packet instance
}
}
if (firstchunkappearsnew) isNewChunk = true;
if (isNewChunk) {
if (!isNewChunk) {
try {
if (!olderOldChunks.contains(oldpos) && !tickexploitChunks.contains(oldpos) && !oldChunks.contains(oldpos) && !newChunks.contains(oldpos)) {
oldChunks.add(oldpos);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "streak-addon",
"version": "1.0.7",
"version": "1.0.8",
"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": [
Expand Down

0 comments on commit 784cdf3

Please sign in to comment.