Skip to content

Commit

Permalink
0.9.0 NewerNewChunks fix, InstamineNuker module added
Browse files Browse the repository at this point in the history
- Added the **InstaMineNuker** module, which sends packets to instantly mine the blocks around you until they are gone. There is an option in it to make it only target instamineable blocks such as crops, grass, slimeblocks, and more. (Credits to etianl and to Meteor Client, as well as Meteor Rejects for some borrowed code)
*note* InstaMineNuker is not compatible with AutoTool for now
**NewerNewChunks fixes**
- Fixed a bug with the pre-1.17 old chunk detection that caused all the chunks in the nether, end, and flat worlds to be marked as old.
- Stopped block checks for the pre-1.17 old chunk detector if a block is found that it is looking for per chunk (improve performance maybe?).
- Added a line to the .world command which tells you if the chunk you are in is new or old generation (pre or post 1.17 generation). Do this at spawn to see if old world.
  • Loading branch information
etianl authored Mar 21, 2024
1 parent 6d22f72 commit 9e0d459
Show file tree
Hide file tree
Showing 7 changed files with 353 additions and 6 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ This will return the lowest block placed with AutoMountain until AutoLavacast is
- **HandOfGod:** Runs the "/fill" command on the world around you or around everyone else in different ways as you move around, and as you click. Destroy and modify the world with ease! Operator status required. (Credits to etianl :D)
- **Inventory Dupe (1.17):** Duplicates things in your crafting slots when the module is enabled and the Dupe button is pressed in your inventory. Only works on Minecraft servers on the version 1.17, not any version before or after.(Credit to ItsVen and Da0neDatGotAway for original creation of the dupe, and to B2H990 for making the fabric mod. Credits to etianl for porting to Meteor.)
- **InstaKill:** Shoots arrows and tridents with incredible power and velocity. Enabling multiple buttons causes the amount of packets to add up. (Credits to Saturn5Vfive)
- **InstaMineNuker:** Sends packets to instantly mine the blocks around you until they are gone. There is an option in it to make it only target instamineable blocks such as crops, grass, slimeblocks, and more.. (Credits to etianl and to Meteor Client, as well as Meteor Rejects for some borrowed code)
- **LavaAura:** Automatically places and picks up lava buckets at an entity's position on a tick delay, or sets the entity on fire using flint and steel or fire charges. Also has the option of placing lavabuckets or fire on every block face which may be useful in creative mode. (Credits to etianl :D)
- **LecternCrash:** Crash 1.18.X vanilla servers and possibly below. (Credits to Coderx-Gamer)
- **NbtEditor:** Requires Creative mode. Generates custom entities in the form of a custom spawn egg, and it can also generate items with custom enchantments and potions with custom effects all based on the settings you configure. (Credits to etianl :D)
Expand Down
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.20.4+build.3
loader_version=0.15.3

# Mod Properties
mod_version=0.8.9-1.20.4
mod_version=0.9.0-1.20.4
maven_group=pwn.noobs
archives_base_name=1trouser-streak

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/pwn/noobs/trouserstreak/Trouser.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ public void onInitialize() {
Modules.get().add(new TrailMaker());
Modules.get().add(new NewerNewChunks());
Modules.get().add(new SuperInstaMine());
Modules.get().add(new InstaMineNuker());
Modules.get().add(new BaseFinder());
Modules.get().add(new Teleport());
Modules.get().add(new TPFly());
Modules.get().add(new HandOfGod());
Modules.get().add(new InstaMineNuker());
Modules.get().add(new OPServerKillModule());
Modules.get().add(new OPplayerTPmodule());
Modules.get().add(new ExplosionAura());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.command.CommandSource;
import net.minecraft.scoreboard.ScoreHolder;
import net.minecraft.scoreboard.Scoreboard;
import net.minecraft.text.Text;
import net.minecraft.util.WorldSavePath;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.GameRules;
import net.minecraft.world.chunk.WorldChunk;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.Set;

import static meteordevelopment.meteorclient.MeteorClient.mc;

Expand All @@ -36,8 +39,31 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
for (ScoreHolder holder : scoreHolders) {
namesBuilder.append(holder.getNameForScoreboard()).append(", ");
}

String getKnownPlayers = namesBuilder.toString();
int chunkX = (int) mc.player.getX() >> 4;
int chunkZ = (int) mc.player.getZ() >> 4;
WorldChunk chunk = mc.world.getChunk(chunkX, chunkZ);

boolean foundAnyOre = false;
boolean isNewGeneration = false;
for (int x = 0; x < 16; x++) {
for (int y = mc.world.getBottomY(); y < mc.world.getTopY(); y++) {
for (int z = 0; z < 16; z++) {
if (!foundAnyOre && isOreBlock(chunk.getBlockState(new BlockPos(x, y, z)).getBlock()) && mc.world.getRegistryKey().getValue().toString().toLowerCase().contains("overworld")) {
foundAnyOre = true;
}
if (!isNewGeneration && y < 256 && y >= 0 && (chunk.getBlockState(new BlockPos(x, y, z)).getBlock() == Blocks.COPPER_ORE || chunk.getBlockState(new BlockPos(x, y, z)).getBlock() == Blocks.DEEPSLATE_COPPER_ORE) && mc.world.getRegistryKey().getValue().toString().toLowerCase().contains("overworld")) {
isNewGeneration = true;
}
}
}
}

if (!isNewGeneration) {
ChatUtils.sendMsg(Text.of("This chunk is pre 1.17 generation!"));
} else {
ChatUtils.sendMsg(Text.of("This chunk is new generation! (post-1.17)"));
}
ChatUtils.sendMsg(Text.of("East World Border X: "+(int) mc.world.getWorldBorder().getBoundEast()+", West World Border X: "+(int) mc.world.getWorldBorder().getBoundWest()+", South World Border Z: "+(int) mc.world.getWorldBorder().getBoundSouth()+", North World Border Z: "+(int) mc.world.getWorldBorder().getBoundNorth()));
ChatUtils.sendMsg(Text.of("WorldSpawn Location: x"+mc.world.getLevelProperties().getSpawnX()+" y"+mc.world.getLevelProperties().getSpawnY()+" z"+mc.world.getLevelProperties().getSpawnZ()));
ChatUtils.sendMsg(Text.of("Difficulty: "+mc.world.getDifficulty().toString()));
Expand All @@ -57,6 +83,30 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
}

String getKnownPlayers = namesBuilder.toString();
int chunkX = (int) mc.player.getX() >> 4;
int chunkZ = (int) mc.player.getZ() >> 4;
WorldChunk chunk = mc.world.getChunk(chunkX, chunkZ);

boolean foundAnyOre = false;
boolean isNewGeneration = false;
for (int x = 0; x < 16; x++) {
for (int y = mc.world.getBottomY(); y < mc.world.getTopY(); y++) {
for (int z = 0; z < 16; z++) {
if (!foundAnyOre && isOreBlock(chunk.getBlockState(new BlockPos(x, y, z)).getBlock()) && mc.world.getRegistryKey().getValue().toString().toLowerCase().contains("overworld")) {
foundAnyOre = true;
}
if (!isNewGeneration && y < 256 && y >= 0 && (chunk.getBlockState(new BlockPos(x, y, z)).getBlock() == Blocks.COPPER_ORE || chunk.getBlockState(new BlockPos(x, y, z)).getBlock() == Blocks.DEEPSLATE_COPPER_ORE) && mc.world.getRegistryKey().getValue().toString().toLowerCase().contains("overworld")) {
isNewGeneration = true;
}
}
}
}

if (!isNewGeneration) {
ChatUtils.sendMsg(Text.of("This chunk is pre 1.17 generation!"));
} else {
ChatUtils.sendMsg(Text.of("This chunk is new generation! (post-1.17)"));
}
ChatUtils.sendMsg(Text.of("East World Border X: "+(int) mc.world.getWorldBorder().getBoundEast()+", West World Border X: "+(int) mc.world.getWorldBorder().getBoundWest()+", South World Border Z: "+(int) mc.world.getWorldBorder().getBoundSouth()+", North World Border Z: "+(int) mc.world.getWorldBorder().getBoundNorth()));
ChatUtils.sendMsg(Text.of("WorldSpawn Location: x"+mc.world.getLevelProperties().getSpawnX()+" y"+mc.world.getLevelProperties().getSpawnY()+" z"+mc.world.getLevelProperties().getSpawnZ()));
ChatUtils.sendMsg(Text.of("Difficulty: "+mc.world.getDifficulty().toString()));
Expand All @@ -82,6 +132,13 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
try {
new File("SavedWorldInfo/"+serverip+"/").mkdirs();
FileWriter writer = new FileWriter("SavedWorldInfo/"+serverip+"/WorldInfoData.txt", true);
if (!isNewGeneration) {
writer.write("This chunk is pre 1.17 generation!");
writer.write("\r\n"); // write new line
} else {
writer.write("This chunk is new generation! (post-1.17)");
writer.write("\r\n"); // write new line
}
writer.write("East World Border X: "+(int) mc.world.getWorldBorder().getBoundEast()+", West World Border X: "+(int) mc.world.getWorldBorder().getBoundWest()+", South World Border Z: "+(int) mc.world.getWorldBorder().getBoundSouth()+", North World Border Z: "+(int) mc.world.getWorldBorder().getBoundNorth());
writer.write("\r\n"); // write new line
writer.write("WorldSpawn Location: x"+mc.world.getLevelProperties().getSpawnX()+" y"+mc.world.getLevelProperties().getSpawnY()+" z"+mc.world.getLevelProperties().getSpawnZ());
Expand All @@ -104,4 +161,21 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
return SINGLE_SUCCESS;
}));
}
private boolean isOreBlock(Block block) {
return block == Blocks.COAL_ORE
|| block == Blocks.COPPER_ORE
|| block == Blocks.DEEPSLATE_COPPER_ORE
|| block == Blocks.IRON_ORE
|| block == Blocks.DEEPSLATE_IRON_ORE
|| block == Blocks.GOLD_ORE
|| block == Blocks.DEEPSLATE_GOLD_ORE
|| block == Blocks.LAPIS_ORE
|| block == Blocks.DEEPSLATE_LAPIS_ORE
|| block == Blocks.DIAMOND_ORE
|| block == Blocks.DEEPSLATE_DIAMOND_ORE
|| block == Blocks.REDSTONE_ORE
|| block == Blocks.DEEPSLATE_REDSTONE_ORE
|| block == Blocks.EMERALD_ORE
|| block == Blocks.DEEPSLATE_EMERALD_ORE;
}
}
Loading

0 comments on commit 9e0d459

Please sign in to comment.