diff --git a/README.md b/README.md index b82193147..0477de47a 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/gradle.properties b/gradle.properties index a809785f7..0563bdb4d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/pwn/noobs/trouserstreak/Trouser.java b/src/main/java/pwn/noobs/trouserstreak/Trouser.java index ffc063b15..7ca5e4e47 100644 --- a/src/main/java/pwn/noobs/trouserstreak/Trouser.java +++ b/src/main/java/pwn/noobs/trouserstreak/Trouser.java @@ -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()); diff --git a/src/main/java/pwn/noobs/trouserstreak/commands/WorldInfoCommand.java b/src/main/java/pwn/noobs/trouserstreak/commands/WorldInfoCommand.java index 4d088faa1..c98004b99 100644 --- a/src/main/java/pwn/noobs/trouserstreak/commands/WorldInfoCommand.java +++ b/src/main/java/pwn/noobs/trouserstreak/commands/WorldInfoCommand.java @@ -3,12 +3,16 @@ 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; @@ -16,7 +20,6 @@ import java.nio.file.Files; import java.nio.file.Paths; import java.util.Collection; -import java.util.Set; import static meteordevelopment.meteorclient.MeteorClient.mc; @@ -36,8 +39,31 @@ public void build(LiteralArgumentBuilder 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())); @@ -57,6 +83,30 @@ public void build(LiteralArgumentBuilder 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())); @@ -82,6 +132,13 @@ public void build(LiteralArgumentBuilder 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()); @@ -104,4 +161,21 @@ public void build(LiteralArgumentBuilder 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; + } } \ No newline at end of file diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/InstaMineNuker.java b/src/main/java/pwn/noobs/trouserstreak/modules/InstaMineNuker.java new file mode 100644 index 000000000..3342c6746 --- /dev/null +++ b/src/main/java/pwn/noobs/trouserstreak/modules/InstaMineNuker.java @@ -0,0 +1,248 @@ +package pwn.noobs.trouserstreak.modules; + +import meteordevelopment.meteorclient.events.entity.player.StartBreakingBlockEvent; +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.misc.Pool; +import meteordevelopment.meteorclient.utils.player.Rotations; +import meteordevelopment.meteorclient.utils.render.color.Color; +import meteordevelopment.meteorclient.utils.render.color.SettingColor; +import meteordevelopment.meteorclient.utils.world.BlockUtils; +import meteordevelopment.orbit.EventHandler; +import net.minecraft.block.*; +import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket; +import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; +import net.minecraft.util.Hand; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import pwn.noobs.trouserstreak.Trouser; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; + +public class InstaMineNuker extends Module { + private final SettingGroup sgGeneral = settings.getDefaultGroup(); + private final SettingGroup sgRender = settings.createGroup("Render"); + + // General + private final Setting onlyInstamineable = sgGeneral.add(new BoolSetting.Builder() + .name("Only break Instamineable blocks") + .description("Only breaks the Instamineable blocks") + .defaultValue(false) + .build() + ); + private final Setting> skippableBlox = sgGeneral.add(new BlockListSetting.Builder() + .name("Blocks to Skip") + .description("Skips instamining this block.") + .build() + ); + private final Setting range = sgGeneral.add(new IntSetting.Builder() + .name("range") + .description("The break range.") + .defaultValue(4) + .min(0) + .build() + ); + private final Setting nobelowfeet = sgGeneral.add(new BoolSetting.Builder() + .name("Don't break below feet") + .description("Don't target blocks below feet") + .defaultValue(false) + .build() + ); + private final Setting delay = sgGeneral.add(new IntSetting.Builder() + .name("delay") + .description("Delay in ticks between breaking blocks.") + .defaultValue(0) + .build() + ); + private final Setting maxBlocksPerTick = sgGeneral.add(new IntSetting.Builder() + .name("max-blocks-per-tick") + .description("Maximum blocks to try to break per tick.") + .defaultValue(4) + .min(1) + .sliderRange(1, 100) + .build() + ); + private final Setting swing = sgGeneral.add(new BoolSetting.Builder() + .name("Swing Hand") + .description("Do or Do Not swing hand when instamining.") + .defaultValue(true) + .build() + ); + private final Setting rotate = sgGeneral.add(new BoolSetting.Builder() + .name("rotate") + .description("Faces the blocks being mined server side.") + .defaultValue(true) + .build() + ); + private final Setting shapeModeBreak = sgRender.add(new EnumSetting.Builder() + .name("nuke-block-mode") + .description("How the shapes for broken blocks 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(255, 0, 0, 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(255, 0, 0, 255)) + .build() + ); + private Direction direction; + private int ticks; + private final Pool renderBlockPool = new Pool<>(RenderBlock::new); + private final List renderBlocks = new ArrayList<>(); + + + public InstaMineNuker() { + super(Trouser.Main, "InstaMineNuker", "Sends packets to break blocks around you."); + } + + @Override + public void onActivate() { + ticks = 0; + for (RenderBlock renderBlock : renderBlocks) renderBlockPool.free(renderBlock); + renderBlocks.clear(); + } + + @Override + public void onDeactivate() { + for (RenderBlock renderBlock : renderBlocks) renderBlockPool.free(renderBlock); + renderBlocks.clear(); + } + + @EventHandler + private void onRender(Render3DEvent event) { + // Broken block + renderBlocks.sort(Comparator.comparingInt(o -> -o.ticks)); + renderBlocks.forEach(renderBlock -> renderBlock.render(event, sideColor.get(), lineColor.get(), shapeModeBreak.get())); + + } + @EventHandler + private void onStartBreakingBlock(StartBreakingBlockEvent event) { + direction = event.direction; + } + @EventHandler + private void onTickPre(TickEvent.Pre event) { + ticks++; + renderBlocks.forEach(RenderBlock::tick); + renderBlocks.removeIf(renderBlock -> renderBlock.ticks <= 0); + int count = 0; + int bottomlimit = mc.player.getBlockY() - range.get(); + if (nobelowfeet.get()) bottomlimit = mc.player.getBlockY(); + if (ticks>=delay.get()){ + // Create a list of all the blocks within the specified range + List blocks = new ArrayList<>(); + for (int x = mc.player.getBlockX() - range.get(); x <= mc.player.getBlockX() + range.get(); x++) { + for (int y = bottomlimit; y <= mc.player.getBlockY() + range.get(); y++) { + for (int z = mc.player.getBlockZ() - range.get(); z <= mc.player.getBlockZ() + range.get(); z++) { + BlockPos blockPos = new BlockPos(x, y, z); + double distance = mc.player.getPos().distanceTo(blockPos.toCenterPos()); + if (distance <= range.get()) blocks.add(blockPos); + } + } + } + + // Sort the blocks by distance from the player + blocks.sort(Comparator.comparingDouble(pos -> pos.getSquaredDistance(mc.player.getPos()))); + + for (BlockPos blockPos : blocks) { + if (count >= maxBlocksPerTick.get()) break; + // Get the block at the current coordinates + if (onlyInstamineable.get()){ + if (!skippableBlox.get().contains(mc.world.getBlockState(blockPos).getBlock()) && rotate.get() && BlockUtils.canBreak(blockPos) && BlockUtils.canInstaBreak(blockPos)){ + renderBlocks.add(renderBlockPool.get().set(blockPos)); + Rotations.rotate(Rotations.getYaw(blockPos), Rotations.getPitch(blockPos), () -> mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, direction))); + if (swing.get()){ + mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND)); + mc.player.swingHand(Hand.MAIN_HAND); + } + } + else if (!skippableBlox.get().contains(mc.world.getBlockState(blockPos).getBlock()) && !rotate.get() && BlockUtils.canBreak(blockPos) && BlockUtils.canInstaBreak(blockPos)){ + renderBlocks.add(renderBlockPool.get().set(blockPos)); + mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, direction)); + if (swing.get()){ + mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND)); + mc.player.swingHand(Hand.MAIN_HAND); + } + } + if (!skippableBlox.get().contains(mc.world.getBlockState(blockPos).getBlock()) && rotate.get() && BlockUtils.canBreak(blockPos) && BlockUtils.canInstaBreak(blockPos)){ + Rotations.rotate(Rotations.getYaw(blockPos), Rotations.getPitch(blockPos), () -> mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, direction))); + count++; + } + else if (!skippableBlox.get().contains(mc.world.getBlockState(blockPos).getBlock()) && !rotate.get() && BlockUtils.canBreak(blockPos) && BlockUtils.canInstaBreak(blockPos)){ + mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, direction)); + count++; + } + } else if (!onlyInstamineable.get()) { + if (!skippableBlox.get().contains(mc.world.getBlockState(blockPos).getBlock()) && rotate.get() && BlockUtils.canBreak(blockPos)){ + renderBlocks.add(renderBlockPool.get().set(blockPos)); + Rotations.rotate(Rotations.getYaw(blockPos), Rotations.getPitch(blockPos), () -> mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, direction))); + if (swing.get()){ + mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND)); + mc.player.swingHand(Hand.MAIN_HAND); + } + } + else if (!skippableBlox.get().contains(mc.world.getBlockState(blockPos).getBlock()) && !rotate.get() && BlockUtils.canBreak(blockPos)){ + renderBlocks.add(renderBlockPool.get().set(blockPos)); + mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, direction)); + if (swing.get()){ + mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND)); + mc.player.swingHand(Hand.MAIN_HAND); + } + } + if (!skippableBlox.get().contains(mc.world.getBlockState(blockPos).getBlock()) && rotate.get() && BlockUtils.canBreak(blockPos)){ + Rotations.rotate(Rotations.getYaw(blockPos), Rotations.getPitch(blockPos), () -> mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, direction))); + count++; + } + else if (!skippableBlox.get().contains(mc.world.getBlockState(blockPos).getBlock()) && !rotate.get() && BlockUtils.canBreak(blockPos)){ + mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, direction)); + count++; + } + + + } + } + ticks=0; + } + } + + + public static class RenderBlock { + public BlockPos.Mutable pos = new BlockPos.Mutable(); + public int ticks; + + public RenderBlock set(BlockPos blockPos) { + pos.set(blockPos); + ticks = 8; + + return this; + } + + public void tick() { + ticks--; + } + + public void render(Render3DEvent event, Color sides, Color lines, ShapeMode shapeMode) { + int preSideA = sides.a; + int preLineA = lines.a; + + sides.a *= (double) ticks / 8; + lines.a *= (double) ticks / 8; + + event.renderer.box(pos, sides, lines, shapeMode, 0); + + sides.a = preSideA; + lines.a = preLineA; + } + } +} \ No newline at end of file diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/NewerNewChunks.java b/src/main/java/pwn/noobs/trouserstreak/modules/NewerNewChunks.java index 35e99435f..2014f6d5f 100644 --- a/src/main/java/pwn/noobs/trouserstreak/modules/NewerNewChunks.java +++ b/src/main/java/pwn/noobs/trouserstreak/modules/NewerNewChunks.java @@ -15,6 +15,7 @@ import meteordevelopment.meteorclient.utils.render.color.Color; import meteordevelopment.meteorclient.utils.render.color.SettingColor; import meteordevelopment.orbit.EventHandler; +import net.minecraft.block.Block; import net.minecraft.block.Blocks; import net.minecraft.client.gui.screen.DisconnectedScreen; import net.minecraft.client.gui.screen.DownloadingTerrainScreen; @@ -218,6 +219,8 @@ public WWidget getWidget(GuiTheme theme) { private ChunkPos chunkPos; private ChunkPos oldpos; private boolean isNewGeneration; + private boolean foundAnyOre; + private final Set newChunks = Collections.synchronizedSet(new HashSet<>()); private final Set oldChunks = Collections.synchronizedSet(new HashSet<>()); private final Set olderoldChunks = Collections.synchronizedSet(new HashSet<>()); @@ -604,6 +607,7 @@ else if (event.packet instanceof ChunkDataS2CPacket && mc.world != null) { return; } isNewGeneration = false; + foundAnyOre = 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++) { @@ -615,11 +619,12 @@ else if (event.packet instanceof ChunkDataS2CPacket && mc.world != null) { } return; } - if (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 (!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 (oldchunksdetector.get() && !oldChunks.contains(oldpos) && !tickexploitChunks.contains(oldpos) && !olderoldChunks.contains(oldpos) && !newChunks.contains(oldpos) && isNewGeneration == false) { + if (oldchunksdetector.get() && !oldChunks.contains(oldpos) && !tickexploitChunks.contains(oldpos) && !olderoldChunks.contains(oldpos) && !newChunks.contains(oldpos) && foundAnyOre == true && isNewGeneration == false && mc.world.getRegistryKey().getValue().toString().toLowerCase().contains("overworld")) { oldChunks.add(oldpos); if (save.get()){ saveOldChunkData(); @@ -628,6 +633,23 @@ else if (event.packet instanceof ChunkDataS2CPacket && mc.world != null) { } } } + 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; + } private void loadData() { try { List allLines = Files.readAllLines(Paths.get("NewChunks/"+serverip+"/"+world+"/OldChunkData.txt")); diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index a571009ed..53d3009a9 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": "0.8.9", + "version": "0.9.0", "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": [