diff --git a/src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java b/src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java index e27807fa..ef00f7b1 100644 --- a/src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java +++ b/src/main/java/pwn/noobs/trouserstreak/modules/BaseFinder.java @@ -124,7 +124,7 @@ public class BaseFinder extends Module { .min(-64) .sliderRange(-64, 319) .defaultValue(260) - .visible(() -> skybuildfind.get()) + .visible(skybuildfind::get) .build()); private final Setting bedrockfind = sgDetectors.add(new BoolSetting.Builder() .name("Bedrock Finder") @@ -137,7 +137,7 @@ public class BaseFinder extends Module { .min(0) .sliderRange(0, 384) .defaultValue(4) - .visible(() -> bedrockfind.get()) + .visible(bedrockfind::get) .build()); private final Setting spawner = sgDetectors.add(new BoolSetting.Builder() .name("Unnatural Spawner Finder") @@ -215,6 +215,11 @@ private Set> getDefaultCreatures() { .sliderRange(0,300) .defaultValue(5) .build()); + private final Setting list1Activar = sglists.add(new BoolSetting.Builder() + .name("List #1 Activate") + .description("Activates checks for List #1") + .defaultValue(true) + .build()); private final Setting> Blawcks1 = sglists.add(new BlockListSetting.Builder() .name("Block List #1 (Default)") .description("If the total amount of any of these found is greater than the Number specified, throw a base location.") @@ -247,49 +252,86 @@ private Set> getDefaultCreatures() { Blocks.LAVA_CAULDRON, Blocks.POWDER_SNOW_CAULDRON, Blocks.ACTIVATOR_RAIL, Blocks.BEACON, Blocks.BEEHIVE, Blocks.REPEATING_COMMAND_BLOCK, Blocks.COMMAND_BLOCK, Blocks.CHAIN_COMMAND_BLOCK, Blocks.EMERALD_BLOCK, Blocks.IRON_BLOCK, Blocks.NETHERITE_BLOCK, Blocks.RAW_GOLD_BLOCK, Blocks.CONDUIT, Blocks.DAYLIGHT_DETECTOR, Blocks.DETECTOR_RAIL, Blocks.DRIED_KELP_BLOCK, Blocks.DROPPER, Blocks.ENCHANTING_TABLE, Blocks.PIGLIN_HEAD, Blocks.PIGLIN_WALL_HEAD, Blocks.CREEPER_HEAD, Blocks.CREEPER_WALL_HEAD, Blocks.DRAGON_WALL_HEAD, Blocks.DRAGON_HEAD, Blocks.PLAYER_HEAD, Blocks.PLAYER_WALL_HEAD, Blocks.ZOMBIE_HEAD, Blocks.ZOMBIE_WALL_HEAD, Blocks.SKELETON_WALL_SKULL, Blocks.WITHER_SKELETON_SKULL, Blocks.WITHER_SKELETON_WALL_SKULL, Blocks.HEAVY_CORE, Blocks.HONEY_BLOCK, Blocks.HONEYCOMB_BLOCK, Blocks.JUKEBOX, Blocks.LIGHTNING_ROD, Blocks.LODESTONE, Blocks.OBSERVER, Blocks.POWERED_RAIL, Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE, Blocks.LIGHT_WEIGHTED_PRESSURE_PLATE, Blocks.POLISHED_BLACKSTONE_PRESSURE_PLATE, Blocks.BIRCH_PRESSURE_PLATE, Blocks.JUNGLE_PRESSURE_PLATE, Blocks.DARK_OAK_PRESSURE_PLATE, Blocks.MANGROVE_PRESSURE_PLATE, Blocks.CRIMSON_PRESSURE_PLATE, Blocks.WARPED_PRESSURE_PLATE, Blocks.RESPAWN_ANCHOR, Blocks.CALIBRATED_SCULK_SENSOR, Blocks.SNIFFER_EGG - ) + ) + .visible(list1Activar::get) .filter(this::filterBlocks) .build() ); + private final Setting list2Activar = sglists.add(new BoolSetting.Builder() + .name("List #2 Activate") + .description("Activates checks for List #2") + .defaultValue(true) + .build()); private final Setting> Blawcks2 = sglists.add(new BlockListSetting.Builder() .name("Block List #2 (Default)") .description("If the total amount of any of these found is greater than the Number specified, throw a base location.") .defaultValue(Blocks.SPRUCE_WALL_SIGN, Blocks.POLISHED_DIORITE, Blocks.NOTE_BLOCK, Blocks.MANGROVE_WOOD, Blocks.WEATHERED_COPPER) + .visible(list2Activar::get) .filter(this::filterBlocks) .build() ); + private final Setting list3Activar = sglists.add(new BoolSetting.Builder() + .name("List #3 Activate") + .description("Activates checks for List #3") + .defaultValue(true) + .build()); private final Setting> Blawcks3 = sglists.add(new BlockListSetting.Builder() .name("Block List #3 (Default)") .description("If the total amount of any of these found is greater than the Number specified, throw a base location.") .defaultValue(Blocks.CRAFTING_TABLE, Blocks.BREWING_STAND, Blocks.ENDER_CHEST, Blocks.SMOOTH_QUARTZ, Blocks.REDSTONE_BLOCK, Blocks.DIAMOND_BLOCK, Blocks.BROWN_STAINED_GLASS) + .visible(list3Activar::get) .filter(this::filterBlocks) .build() ); + private final Setting list4Activar = sglists.add(new BoolSetting.Builder() + .name("List #4 Activate") + .description("Activates checks for List #4") + .defaultValue(true) + .build()); private final Setting> Blawcks4 = sglists.add(new BlockListSetting.Builder() .name("Block List #4 (Default)") .description("If the total amount of any of these found is greater than the Number specified, throw a base location.") .defaultValue(Blocks.OAK_WALL_SIGN, Blocks.TRAPPED_CHEST, Blocks.IRON_TRAPDOOR, Blocks.LAPIS_BLOCK) + .visible(list4Activar::get) .filter(this::filterBlocks) .build() ); + private final Setting list5Activar = sglists.add(new BoolSetting.Builder() + .name("List #5 Activate") + .description("Activates checks for List #5") + .defaultValue(true) + .build()); private final Setting> Blawcks5 = sglists.add(new BlockListSetting.Builder() .name("Block List #5 (Default)") .description("If the total amount of any of these found is greater than the Number specified, throw a base location.") .defaultValue(Blocks.QUARTZ_BLOCK, Blocks.BLACK_BED, Blocks.GRAY_BED, Blocks.LIGHT_BLUE_BED, Blocks.LIGHT_GRAY_BED, Blocks.PINK_BED, Blocks.RED_BED, Blocks.WHITE_BED, Blocks.YELLOW_BED, Blocks.ORANGE_BED, Blocks.BLUE_BED, Blocks.CYAN_BED, Blocks.GREEN_BED, Blocks.LIME_BED, Blocks.PURPLE_BED, Blocks.MAGENTA_BED, Blocks.BROWN_BED, Blocks.WHITE_CONCRETE) + .visible(list5Activar::get) .filter(this::filterBlocks) .build() ); + private final Setting list6Activar = sglists.add(new BoolSetting.Builder() + .name("List #6 Activate") + .description("Activates checks for List #6") + .defaultValue(true) + .build()); private final Setting> Blawcks6 = sglists.add(new BlockListSetting.Builder() .name("Block List #6 (Default)") .description("If the total amount of any of these found is greater than the Number specified, throw a base location.") .defaultValue(Blocks.REDSTONE_TORCH, Blocks.REDSTONE_WALL_TORCH, Blocks.FURNACE, Blocks.HOPPER) + .visible(list6Activar::get) .filter(this::filterBlocks) .build() ); + private final Setting list7Activar = sglists.add(new BoolSetting.Builder() + .name("List #7 Activate") + .description("Activates checks for List #7") + .defaultValue(true) + .build()); private final Setting> Blawcks7 = sglists.add(new BlockListSetting.Builder() .name("Block List #7 (Extra Custom)") .description("If the total amount of any of these found is greater than the Number specified, throw a base location.") .defaultValue() + .visible(list7Activar::get) .filter(this::filterBlocks) .build() ); @@ -299,6 +341,7 @@ private Set> getDefaultCreatures() { .min(1) .sliderRange(1,100) .defaultValue(1) + .visible(list1Activar::get) .build()); private final Setting blowkfind2 = sglists.add(new IntSetting.Builder() .name("(List #2) Number Of Blocks to Find") @@ -306,6 +349,7 @@ private Set> getDefaultCreatures() { .min(1) .sliderRange(1,100) .defaultValue(6) + .visible(list2Activar::get) .build()); private final Setting blowkfind3 = sglists.add(new IntSetting.Builder() .name("(List #3) Number Of Blocks to Find") @@ -313,6 +357,7 @@ private Set> getDefaultCreatures() { .min(1) .sliderRange(1,100) .defaultValue(4) + .visible(list3Activar::get) .build()); private final Setting blowkfind4 = sglists.add(new IntSetting.Builder() .name("(List #4) Number Of Blocks to Find") @@ -320,6 +365,7 @@ private Set> getDefaultCreatures() { .min(1) .sliderRange(1,100) .defaultValue(2) + .visible(list4Activar::get) .build()); private final Setting blowkfind5 = sglists.add(new IntSetting.Builder() .name("(List #5) Number Of Blocks to Find") @@ -327,6 +373,7 @@ private Set> getDefaultCreatures() { .min(1) .sliderRange(1,100) .defaultValue(12) + .visible(list5Activar::get) .build()); private final Setting blowkfind6 = sglists.add(new IntSetting.Builder() .name("(List #6) Number Of Blocks to Find") @@ -334,6 +381,7 @@ private Set> getDefaultCreatures() { .min(1) .sliderRange(1,100) .defaultValue(12) + .visible(list6Activar::get) .build()); private final Setting blowkfind7 = sglists.add(new IntSetting.Builder() .name("(List #7) Number Of Blocks to Find") @@ -341,6 +389,7 @@ private Set> getDefaultCreatures() { .min(1) .sliderRange(1,100) .defaultValue(1) + .visible(list7Activar::get) .build()); private final Setting remove = sgcacheCdata.add(new BoolSetting.Builder() .name("RemoveOnModuleDisabled") @@ -376,7 +425,7 @@ private Set> getDefaultCreatures() { .name("AutoReloadBases") .description("Reloads the bases automatically from your savefiles on a delay.") .defaultValue(false) - .visible(() -> load.get()) + .visible(load::get) .build() ); private final Setting removedelay = sgCdata.add(new IntSetting.Builder() @@ -532,7 +581,7 @@ public WWidget getWidget(GuiTheme theme) { .description("How far from the base chunk to still render a tracer.") .defaultValue(32) .sliderRange(1,1024) - .visible(() -> trcr.get()) + .visible(trcr::get) .build() ); private final Setting baseChunksSideColor = sgRender.add(new ColorSetting.Builder() @@ -545,7 +594,7 @@ public WWidget getWidget(GuiTheme theme) { .name("Base-chunks-tracer-color") .description("Color of tracers to the chunks that may contain bases or builds.") .defaultValue(new SettingColor(255, 127, 0, 255, true)) - .visible(() -> trcr.get()) + .visible(trcr::get) .build() ); private static final ExecutorService taskExecutor = Executors.newCachedThreadPool(); @@ -613,7 +662,7 @@ public void onActivate() { clearChunkData(); } if (save.get() || load.get()) { - if (mc.isInSingleplayer()==true){ + if (mc.isInSingleplayer()){ String[] array = mc.getServer().getSavePath(WorldSavePath.ROOT).toString().replace(':', '_').split("/|\\\\"); serverip=array[array.length-2]; world= mc.world.getRegistryKey().getValue().toString().replace(':', '_'); @@ -670,7 +719,7 @@ private void onGameLeft(GameLeftEvent event) { private void onPreTick(TickEvent.Pre event) { world = mc.world.getRegistryKey().getValue().toString().replace(':', '_'); - if (basefound == true && basefoundspamTicks < bsefndtickdelay.get()) basefoundspamTicks++; + if (basefound && basefoundspamTicks < bsefndtickdelay.get()) basefoundspamTicks++; else if (basefoundspamTicks >= bsefndtickdelay.get()) { basefound = false; basefoundspamTicks = 0; @@ -725,7 +774,7 @@ else if (basefoundspamTicks >= bsefndtickdelay.get()) { } if (save.get() || load.get()) { - if (mc.isInSingleplayer() == true) { + if (mc.isInSingleplayer()) { String[] array = mc.getServer().getSavePath(WorldSavePath.ROOT).toString().replace(':', '_').split("/|\\\\"); serverip = array[array.length - 2]; world = mc.world.getRegistryKey().getValue().toString().replace(':', '_'); @@ -747,7 +796,7 @@ else if (basefoundspamTicks >= bsefndtickdelay.get()) { } } //autoreload when entering different dimensions - if (load.get() && worldchange == true) { + if (load.get() && worldchange) { if (worldleaveremove.get()) { clearChunkData(); } @@ -755,7 +804,7 @@ else if (basefoundspamTicks >= bsefndtickdelay.get()) { worldchange = false; } if (!save.get()) saveDataWasOn = false; - if (save.get() && justenabledsavedata <= 2 && saveDataWasOn == false) { + if (save.get() && justenabledsavedata <= 2 && !saveDataWasOn) { justenabledsavedata++; if (justenabledsavedata == 1) { synchronized (baseChunks) { @@ -905,8 +954,7 @@ private void render2(Box box, Color sides, Color lines, ShapeMode shapeMode, Ren @EventHandler private void onReadPacket(PacketEvent.Receive event) { if (event.packet instanceof PlayerMoveC2SPacket) return; //this keeps getting cast to the chunkdata for no reason - if (!(event.packet instanceof PlayerMoveC2SPacket) && event.packet instanceof ChunkDataS2CPacket && mc.world != null) { - ChunkDataS2CPacket packet = (ChunkDataS2CPacket) event.packet; + if (!(event.packet instanceof PlayerMoveC2SPacket) && event.packet instanceof ChunkDataS2CPacket packet && mc.world != null) { basepos = new ChunkPos(packet.getChunkX(), packet.getChunkZ()); @@ -920,7 +968,7 @@ private void onReadPacket(PacketEvent.Receive event) { future.join(); } catch (CompletionException e) {} - if (bubblesFinder.get() || spawner.get() || signFinder.get() || portalFinder.get() || roofDetector.get() || bedrockfind.get() || skybuildfind.get() || 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){ + if (bubblesFinder.get() || spawner.get() || signFinder.get() || portalFinder.get() || roofDetector.get() || bedrockfind.get() || skybuildfind.get() || !Blawcks1.get().isEmpty() || !Blawcks2.get().isEmpty() || !Blawcks3.get().isEmpty() || !Blawcks4.get().isEmpty() || !Blawcks5.get().isEmpty() || !Blawcks6.get().isEmpty() || !Blawcks7.get().isEmpty()){ int Ymin = mc.world.getBottomY()+minY.get(); int Ymax = mc.world.getTopYInclusive()-maxY.get(); try { @@ -959,15 +1007,15 @@ private void onReadPacket(PacketEvent.Receive event) { for (Text line : lines) { if (line.getLiteralString().length() != 0 && (line.getString() != "<----" && i == 1) && (line.getString() != "---->" && i == 2)){ //handling for arrows is for igloos signtextfound = true; - if (signtextfound == true) break; + if (signtextfound) break; } i++; } for (Text line2 : lines2) { - if (signtextfound == true) break; + if (signtextfound) break; if (line2.getLiteralString().length() != 0){ signtextfound = true; - if (signtextfound == true) break; + if (signtextfound) break; } } } else if (blockEntity instanceof HangingSignBlockEntity) { @@ -978,18 +1026,18 @@ private void onReadPacket(PacketEvent.Receive event) { for (Text line : lines) { if (line.getLiteralString().length() != 0){ //handling for arrows is for igloos signtextfound = true; - if (signtextfound == true) break; + if (signtextfound) break; } } for (Text line2 : lines2) { - if (signtextfound == true) break; + if (signtextfound) break; if (line2.getLiteralString().length() != 0){ signtextfound = true; - if (signtextfound == true) break; + if (signtextfound) break; } } } - if (signtextfound == true && !baseChunks.contains(basepos)){ + if (signtextfound && !baseChunks.contains(basepos)){ baseChunks.add(basepos); if (save.get()) { saveBaseChunkData(basepos); @@ -1015,7 +1063,7 @@ private void onReadPacket(PacketEvent.Receive event) { } } } - if (bubblesFinder.get() && blerks.getBlock() instanceof BubbleColumnBlock && blerks.get(BubbleColumnBlock.DRAG) == false) { + if (bubblesFinder.get() && blerks.getBlock() instanceof BubbleColumnBlock && !blerks.get(BubbleColumnBlock.DRAG)) { if (!baseChunks.contains(basepos)){ baseChunks.add(basepos); if (save.get()) { @@ -1076,49 +1124,49 @@ private void onReadPacket(PacketEvent.Receive event) { if (mc.world.getRegistryKey() == World.OVERWORLD && (blerks.getBlock()==Blocks.MOSSY_COBBLESTONE || blerks.getBlock()==Blocks.COBWEB || blerks.getBlock()==Blocks.STONE_BRICK_STAIRS || blerks.getBlock()==Blocks.BUDDING_AMETHYST))spawnernaturalblocks=true; else if (mc.world.getRegistryKey() == World.NETHER && (blerks.getBlock()==Blocks.NETHER_BRICK_FENCE || blerks.getBlock()==Blocks.CHAIN))spawnernaturalblocks=true; } - if (Blawcks1.get().size()>0){ + if (list1Activar.get() && !Blawcks1.get().isEmpty()){ if (Blawcks1.get().contains(blerks.getBlock())) { blockpositions1.add(blockposi); found1= blockpositions1.size(); lastblockfound1=blerks.getBlock().toString(); } } - if (Blawcks2.get().size()>0){ + if (list2Activar.get() && !Blawcks2.get().isEmpty()){ if (Blawcks2.get().contains(blerks.getBlock())) { blockpositions2.add(blockposi); found2= blockpositions2.size(); lastblockfound2=blerks.getBlock().toString(); } } - if (Blawcks3.get().size()>0){ + if (list3Activar.get() && !Blawcks3.get().isEmpty()){ if (Blawcks3.get().contains(blerks.getBlock())) { blockpositions3.add(blockposi); found3= blockpositions3.size(); lastblockfound3=blerks.getBlock().toString(); } } - if (Blawcks4.get().size()>0){ + if (list4Activar.get() && !Blawcks4.get().isEmpty()){ if (Blawcks4.get().contains(blerks.getBlock())) { blockpositions4.add(blockposi); found4= blockpositions4.size(); lastblockfound4=blerks.getBlock().toString(); } } - if (Blawcks5.get().size()>0){ + if (list5Activar.get() && !Blawcks5.get().isEmpty()){ if (Blawcks5.get().contains(blerks.getBlock())) { blockpositions5.add(blockposi); found5= blockpositions5.size(); lastblockfound5=blerks.getBlock().toString(); } } - if (Blawcks6.get().size()>0){ + if (list6Activar.get() && !Blawcks6.get().isEmpty()){ if (Blawcks6.get().contains(blerks.getBlock())) { blockpositions6.add(blockposi); found6= blockpositions6.size(); lastblockfound6=blerks.getBlock().toString(); } } - if (Blawcks7.get().size()>0){ + if (list7Activar.get() && !Blawcks7.get().isEmpty()){ if (Blawcks7.get().contains(blerks.getBlock())) { blockpositions7.add(blockposi); found7= blockpositions7.size(); @@ -1127,21 +1175,21 @@ private void onReadPacket(PacketEvent.Receive event) { } } } - if (Blawcks1.get().size()>0)checkingchunk1=true; - if (Blawcks2.get().size()>0)checkingchunk2=true; - if (Blawcks3.get().size()>0)checkingchunk3=true; - if (Blawcks4.get().size()>0)checkingchunk4=true; - if (Blawcks5.get().size()>0)checkingchunk5=true; - if (Blawcks6.get().size()>0)checkingchunk6=true; - if (Blawcks7.get().size()>0)checkingchunk7=true; + if (!Blawcks1.get().isEmpty())checkingchunk1=true; + if (!Blawcks2.get().isEmpty())checkingchunk2=true; + if (!Blawcks3.get().isEmpty())checkingchunk3=true; + if (!Blawcks4.get().isEmpty())checkingchunk4=true; + if (!Blawcks5.get().isEmpty())checkingchunk5=true; + if (!Blawcks6.get().isEmpty())checkingchunk6=true; + if (!Blawcks7.get().isEmpty())checkingchunk7=true; } } } Y+=16; } //CheckList 1 - if (Blawcks1.get().size()>0){ - if (checkingchunk1==true && found1>=blowkfind1.get()) { + if (!Blawcks1.get().isEmpty()){ + if (checkingchunk1 && found1>=blowkfind1.get()) { if (!baseChunks.contains(basepos)){ baseChunks.add(basepos); if (save.get()) { @@ -1156,7 +1204,7 @@ private void onReadPacket(PacketEvent.Receive event) { blockpositions1.clear(); found1 = 0; checkingchunk1=false; - } else if (checkingchunk1==true && found10){ - if (checkingchunk2==true && found2>=blowkfind2.get()) { + if (!Blawcks2.get().isEmpty()){ + if (checkingchunk2 && found2>=blowkfind2.get()) { if (!baseChunks.contains(basepos)){ baseChunks.add(basepos); if (save.get()) { @@ -1180,7 +1228,7 @@ private void onReadPacket(PacketEvent.Receive event) { blockpositions2.clear(); found2 = 0; checkingchunk2=false; - } else if (checkingchunk2==true && found20){ - if (checkingchunk3==true && found3>=blowkfind3.get()) { + if (!Blawcks3.get().isEmpty()){ + if (checkingchunk3 && found3>=blowkfind3.get()) { if (!baseChunks.contains(basepos)){ baseChunks.add(basepos); if (save.get()) { @@ -1204,7 +1252,7 @@ private void onReadPacket(PacketEvent.Receive event) { blockpositions3.clear(); found3 = 0; checkingchunk3=false; - } else if (checkingchunk3==true && found30){ - if (checkingchunk4==true && found4>=blowkfind4.get()) { + if (!Blawcks4.get().isEmpty()){ + if (checkingchunk4 && found4>=blowkfind4.get()) { if (!baseChunks.contains(basepos)){ baseChunks.add(basepos); if (save.get()) { @@ -1228,7 +1276,7 @@ private void onReadPacket(PacketEvent.Receive event) { blockpositions4.clear(); found4 = 0; checkingchunk4=false; - } else if (checkingchunk4==true && found40){ - if (checkingchunk5==true && found5>=blowkfind5.get()) { + if (!Blawcks5.get().isEmpty()){ + if (checkingchunk5 && found5>=blowkfind5.get()) { if (!baseChunks.contains(basepos)){ baseChunks.add(basepos); if (save.get()) { @@ -1252,7 +1300,7 @@ private void onReadPacket(PacketEvent.Receive event) { blockpositions5.clear(); found5 = 0; checkingchunk5=false; - } else if (checkingchunk5==true && found50){ - if (checkingchunk6==true && found6>=blowkfind6.get()) { + if (!Blawcks6.get().isEmpty()){ + if (checkingchunk6 && found6>=blowkfind6.get()) { if (!baseChunks.contains(basepos)){ baseChunks.add(basepos); if (save.get()) { @@ -1276,7 +1324,7 @@ private void onReadPacket(PacketEvent.Receive event) { blockpositions6.clear(); found6 = 0; checkingchunk6=false; - } else if (checkingchunk6==true && found60){ - if (checkingchunk7==true && found7>=blowkfind7.get()) { + if (!Blawcks7.get().isEmpty()){ + if (checkingchunk7 && found7>=blowkfind7.get()) { if (!baseChunks.contains(basepos)){ baseChunks.add(basepos); if (save.get()) { @@ -1300,7 +1348,7 @@ private void onReadPacket(PacketEvent.Receive event) { blockpositions7.clear(); found7 = 0; checkingchunk7=false; - } else if (checkingchunk7==true && found7