From f1ca61b01dc283eda0cc1fd9d2094635d609512b Mon Sep 17 00:00:00 2001 From: RacoonDog <32882447+RacoonDog@users.noreply.github.com> Date: Wed, 16 Nov 2022 22:04:42 -0500 Subject: [PATCH] Rename Search to Block ESP --- .../meteorclient/systems/modules/Modules.java | 4 +- .../Search.java => blockesp/BlockESP.java} | 54 ++++++++-------- .../SBlock.java => blockesp/ESPBlock.java} | 32 +++++----- .../ESPBlockData.java} | 20 +++--- .../ESPBlockDataScreen.java} | 12 ++-- .../SChunk.java => blockesp/ESPChunk.java} | 28 ++++---- .../SGroup.java => blockesp/ESPGroup.java} | 64 +++++++++---------- 7 files changed, 107 insertions(+), 107 deletions(-) rename src/main/java/meteordevelopment/meteorclient/systems/modules/render/{search/Search.java => blockesp/BlockESP.java} (80%) rename src/main/java/meteordevelopment/meteorclient/systems/modules/render/{search/SBlock.java => blockesp/ESPBlock.java} (92%) rename src/main/java/meteordevelopment/meteorclient/systems/modules/render/{search/SBlockData.java => blockesp/ESPBlockData.java} (77%) rename src/main/java/meteordevelopment/meteorclient/systems/modules/render/{search/SBlockDataScreen.java => blockesp/ESPBlockDataScreen.java} (88%) rename src/main/java/meteordevelopment/meteorclient/systems/modules/render/{search/SChunk.java => blockesp/ESPChunk.java} (76%) rename src/main/java/meteordevelopment/meteorclient/systems/modules/render/{search/SGroup.java => blockesp/ESPGroup.java} (61%) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java index 8c1bf622d2..e05e1b9551 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/Modules.java @@ -29,7 +29,7 @@ import meteordevelopment.meteorclient.systems.modules.player.*; import meteordevelopment.meteorclient.systems.modules.render.*; import meteordevelopment.meteorclient.systems.modules.render.marker.Marker; -import meteordevelopment.meteorclient.systems.modules.render.search.Search; +import meteordevelopment.meteorclient.systems.modules.render.blockesp.BlockESP; import meteordevelopment.meteorclient.systems.modules.world.Timer; import meteordevelopment.meteorclient.systems.modules.world.*; import meteordevelopment.meteorclient.utils.Utils; @@ -501,7 +501,7 @@ private void initRender() { add(new Marker()); add(new Nametags()); add(new NoRender()); - add(new Search()); + add(new BlockESP()); add(new StorageESP()); add(new TimeChanger()); add(new Tracers()); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/Search.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/BlockESP.java similarity index 80% rename from src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/Search.java rename to src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/BlockESP.java index b33230381d..2f9a9063bc 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/Search.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/BlockESP.java @@ -3,7 +3,7 @@ * Copyright (c) Meteor Development. */ -package meteordevelopment.meteorclient.systems.modules.render.search; +package meteordevelopment.meteorclient.systems.modules.render.blockesp; import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; @@ -32,7 +32,7 @@ import java.util.List; import java.util.Map; -public class Search extends Module { +public class BlockESP extends Module { private final SettingGroup sgGeneral = settings.getDefaultGroup(); // General @@ -46,11 +46,11 @@ public class Search extends Module { .build() ); - private final Setting defaultBlockConfig = sgGeneral.add(new GenericSetting.Builder() + private final Setting defaultBlockConfig = sgGeneral.add(new GenericSetting.Builder() .name("default-block-config") .description("Default block config.") .defaultValue( - new SBlockData( + new ESPBlockData( ShapeMode.Lines, new SettingColor(0, 255, 200), new SettingColor(0, 255, 200, 25), @@ -61,7 +61,7 @@ public class Search extends Module { .build() ); - private final Setting> blockConfigs = sgGeneral.add(new BlockDataSetting.Builder() + private final Setting> blockConfigs = sgGeneral.add(new BlockDataSetting.Builder() .name("block-configs") .description("Config for each block.") .defaultData(defaultBlockConfig) @@ -77,13 +77,13 @@ public class Search extends Module { private final BlockPos.Mutable blockPos = new BlockPos.Mutable(); - private final Long2ObjectMap chunks = new Long2ObjectOpenHashMap<>(); - private final List groups = new UnorderedArrayList<>(); + private final Long2ObjectMap chunks = new Long2ObjectOpenHashMap<>(); + private final List groups = new UnorderedArrayList<>(); private Dimension lastDimension; - public Search() { - super(Categories.Render, "search", "Searches for specified blocks."); + public BlockESP() { + super(Categories.Render, "block-esp", "Renders specified blocks through walls."); RainbowColors.register(this::onTickRainbow); } @@ -114,38 +114,38 @@ private void onTickRainbow() { if (!isActive()) return; defaultBlockConfig.get().tickRainbow(); - for (SBlockData blockData : blockConfigs.get().values()) blockData.tickRainbow(); + for (ESPBlockData blockData : blockConfigs.get().values()) blockData.tickRainbow(); } - SBlockData getBlockData(Block block) { - SBlockData blockData = blockConfigs.get().get(block); + ESPBlockData getBlockData(Block block) { + ESPBlockData blockData = blockConfigs.get().get(block); return blockData == null ? defaultBlockConfig.get() : blockData; } private void updateChunk(int x, int z) { - SChunk chunk = chunks.get(ChunkPos.toLong(x, z)); + ESPChunk chunk = chunks.get(ChunkPos.toLong(x, z)); if (chunk != null) chunk.update(); } private void updateBlock(int x, int y, int z) { - SChunk chunk = chunks.get(ChunkPos.toLong(x >> 4, z >> 4)); + ESPChunk chunk = chunks.get(ChunkPos.toLong(x >> 4, z >> 4)); if (chunk != null) chunk.update(x, y, z); } - public SBlock getBlock(int x, int y, int z) { - SChunk chunk = chunks.get(ChunkPos.toLong(x >> 4, z >> 4)); + public ESPBlock getBlock(int x, int y, int z) { + ESPChunk chunk = chunks.get(ChunkPos.toLong(x >> 4, z >> 4)); return chunk == null ? null : chunk.get(x, y, z); } - public SGroup newGroup(Block block) { + public ESPGroup newGroup(Block block) { synchronized (chunks) { - SGroup group = new SGroup(block); + ESPGroup group = new ESPGroup(block); groups.add(group); return group; } } - public void removeGroup(SGroup group) { + public void removeGroup(ESPGroup group) { synchronized (chunks) { groups.remove(group); } @@ -159,7 +159,7 @@ private void onChunkData(ChunkDataEvent event) { private void searchChunk(Chunk chunk, ChunkDataEvent event) { MeteorExecutor.execute(() -> { if (!isActive()) return; - SChunk schunk = SChunk.searchChunk(chunk, blocks.get()); + ESPChunk schunk = ESPChunk.searchChunk(chunk, blocks.get()); if (schunk.size() > 0) { synchronized (chunks) { @@ -195,10 +195,10 @@ private void onBlockUpdate(BlockUpdateEvent event) { if (added || removed) { MeteorExecutor.execute(() -> { synchronized (chunks) { - SChunk chunk = chunks.get(key); + ESPChunk chunk = chunks.get(key); if (chunk == null) { - chunk = new SChunk(chunkX, chunkZ); + chunk = new ESPChunk(chunkX, chunkZ); if (chunk.shouldBeDeleted()) return; chunks.put(key, chunk); @@ -236,12 +236,12 @@ private void onPostTick(TickEvent.Post event) { @EventHandler private void onRender(Render3DEvent event) { synchronized (chunks) { - for (Iterator it = chunks.values().iterator(); it.hasNext();) { - SChunk chunk = it.next(); + for (Iterator it = chunks.values().iterator(); it.hasNext();) { + ESPChunk chunk = it.next(); if (chunk.shouldBeDeleted()) { MeteorExecutor.execute(() -> { - for (SBlock block : chunk.blocks.values()) { + for (ESPBlock block : chunk.blocks.values()) { block.group.remove(block, false); block.loaded = false; } @@ -253,8 +253,8 @@ private void onRender(Render3DEvent event) { } if (tracers.get()) { - for (Iterator it = groups.iterator(); it.hasNext();) { - SGroup group = it.next(); + for (Iterator it = groups.iterator(); it.hasNext();) { + ESPGroup group = it.next(); if (group.blocks.isEmpty()) it.remove(); else group.render(event); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SBlock.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPBlock.java similarity index 92% rename from src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SBlock.java rename to src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPBlock.java index e0725d8235..47e4f160a9 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SBlock.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPBlock.java @@ -3,7 +3,7 @@ * Copyright (c) Meteor Development. */ -package meteordevelopment.meteorclient.systems.modules.render.search; +package meteordevelopment.meteorclient.systems.modules.render.blockesp; import meteordevelopment.meteorclient.events.render.Render3DEvent; import meteordevelopment.meteorclient.renderer.ShapeMode; @@ -17,10 +17,10 @@ import static meteordevelopment.meteorclient.MeteorClient.mc; -public class SBlock { +public class ESPBlock { private static final BlockPos.Mutable blockPos = new BlockPos.Mutable(); - private static final Search search = Modules.get().get(Search.class); + private static final BlockESP blockEsp = Modules.get().get(BlockESP.class); public static final int FO = 1 << 1; public static final int FO_RI = 1 << 2; @@ -48,36 +48,36 @@ public class SBlock { private BlockState state; public int neighbours; - public SGroup group; + public ESPGroup group; public boolean loaded = true; - public SBlock(int x, int y, int z) { + public ESPBlock(int x, int y, int z) { this.x = x; this.y = y; this.z = z; } - public SBlock getSideBlock(int side) { + public ESPBlock getSideBlock(int side) { switch (side) { - case FO: return search.getBlock(x, y, z + 1); - case BA: return search.getBlock(x, y, z - 1); - case LE: return search.getBlock(x - 1, y, z); - case RI: return search.getBlock(x + 1, y, z); - case TO: return search.getBlock(x, y + 1, z); - case BO: return search.getBlock(x, y - 1, z); + case FO: return blockEsp.getBlock(x, y, z + 1); + case BA: return blockEsp.getBlock(x, y, z - 1); + case LE: return blockEsp.getBlock(x - 1, y, z); + case RI: return blockEsp.getBlock(x + 1, y, z); + case TO: return blockEsp.getBlock(x, y + 1, z); + case BO: return blockEsp.getBlock(x, y - 1, z); } return null; } private void assignGroup() { - SGroup firstGroup = null; + ESPGroup firstGroup = null; for (int side : SIDES) { if ((neighbours & side) != side) continue; - SBlock neighbour = getSideBlock(side); + ESPBlock neighbour = getSideBlock(side); if (neighbour == null || neighbour.group == null) continue; if (firstGroup == null) { @@ -89,7 +89,7 @@ private void assignGroup() { } if (firstGroup == null) { - firstGroup = search.newGroup(state.getBlock()); + firstGroup = blockEsp.newGroup(state.getBlock()); } firstGroup.add(this); @@ -188,7 +188,7 @@ public void render(Render3DEvent event) { z2 = z + shape.getMax(Direction.Axis.Z); } - SBlockData blockData = search.getBlockData(state.getBlock()); + ESPBlockData blockData = blockEsp.getBlockData(state.getBlock()); ShapeMode shapeMode = blockData.shapeMode; Color lineColor = blockData.lineColor; diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SBlockData.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPBlockData.java similarity index 77% rename from src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SBlockData.java rename to src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPBlockData.java index fcc1817685..3905455cf0 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SBlockData.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPBlockData.java @@ -3,7 +3,7 @@ * Copyright (c) Meteor Development. */ -package meteordevelopment.meteorclient.systems.modules.render.search; +package meteordevelopment.meteorclient.systems.modules.render.blockesp; import meteordevelopment.meteorclient.gui.GuiTheme; import meteordevelopment.meteorclient.gui.WidgetScreen; @@ -18,7 +18,7 @@ import net.minecraft.block.Block; import net.minecraft.nbt.NbtCompound; -public class SBlockData implements ICopyable, ISerializable, IChangeable, IBlockData, IScreenFactory { +public class ESPBlockData implements ICopyable, ISerializable, IChangeable, IBlockData, IScreenFactory { public ShapeMode shapeMode; public SettingColor lineColor; public SettingColor sideColor; @@ -28,7 +28,7 @@ public class SBlockData implements ICopyable, ISerializable setting) { - return new SBlockDataScreen(theme, this, block, setting); + public WidgetScreen createScreen(GuiTheme theme, Block block, BlockDataSetting setting) { + return new ESPBlockDataScreen(theme, this, block, setting); } @Override public WidgetScreen createScreen(GuiTheme theme) { - return new SBlockDataScreen(theme, this, null, null); + return new ESPBlockDataScreen(theme, this, null, null); } @Override @@ -63,7 +63,7 @@ public void tickRainbow() { } @Override - public SBlockData set(SBlockData value) { + public ESPBlockData set(ESPBlockData value) { shapeMode = value.shapeMode; lineColor.set(value.lineColor); sideColor.set(value.sideColor); @@ -77,8 +77,8 @@ public SBlockData set(SBlockData value) { } @Override - public SBlockData copy() { - return new SBlockData(shapeMode, new SettingColor(lineColor), new SettingColor(sideColor), tracer, new SettingColor(tracerColor)); + public ESPBlockData copy() { + return new ESPBlockData(shapeMode, new SettingColor(lineColor), new SettingColor(sideColor), tracer, new SettingColor(tracerColor)); } @Override @@ -98,7 +98,7 @@ public NbtCompound toTag() { } @Override - public SBlockData fromTag(NbtCompound tag) { + public ESPBlockData fromTag(NbtCompound tag) { shapeMode = ShapeMode.valueOf(tag.getString("shapeMode")); lineColor.fromTag(tag.getCompound("lineColor")); sideColor.fromTag(tag.getCompound("sideColor")); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SBlockDataScreen.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPBlockDataScreen.java similarity index 88% rename from src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SBlockDataScreen.java rename to src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPBlockDataScreen.java index dd4a9e85c3..2686b88b6d 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SBlockDataScreen.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPBlockDataScreen.java @@ -3,7 +3,7 @@ * Copyright (c) Meteor Development. */ -package meteordevelopment.meteorclient.systems.modules.render.search; +package meteordevelopment.meteorclient.systems.modules.render.blockesp; import meteordevelopment.meteorclient.gui.GuiTheme; import meteordevelopment.meteorclient.gui.WindowScreen; @@ -12,12 +12,12 @@ import meteordevelopment.meteorclient.utils.render.color.SettingColor; import net.minecraft.block.Block; -public class SBlockDataScreen extends WindowScreen { - private final SBlockData blockData; +public class ESPBlockDataScreen extends WindowScreen { + private final ESPBlockData blockData; private final Block block; - private final BlockDataSetting setting; + private final BlockDataSetting setting; - public SBlockDataScreen(GuiTheme theme, SBlockData blockData, Block block, BlockDataSetting setting) { + public ESPBlockDataScreen(GuiTheme theme, ESPBlockData blockData, Block block, BlockDataSetting setting) { super(theme, "Configure Block"); this.blockData = blockData; @@ -95,7 +95,7 @@ public void initWidgets() { add(theme.settings(settings)).expandX(); } - private void changed(SBlockData blockData, Block block, BlockDataSetting setting) { + private void changed(ESPBlockData blockData, Block block, BlockDataSetting setting) { if (!blockData.isChanged() && block != null && setting != null) { setting.get().put(block, blockData); setting.onChanged(); diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SChunk.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPChunk.java similarity index 76% rename from src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SChunk.java rename to src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPChunk.java index ffbc1a20f5..cc39ce2a30 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SChunk.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPChunk.java @@ -3,7 +3,7 @@ * Copyright (c) Meteor Development. */ -package meteordevelopment.meteorclient.systems.modules.render.search; +package meteordevelopment.meteorclient.systems.modules.render.blockesp; import it.unimi.dsi.fastutil.longs.Long2ObjectMap; import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; @@ -20,26 +20,26 @@ import static meteordevelopment.meteorclient.MeteorClient.mc; import static meteordevelopment.meteorclient.utils.Utils.getRenderDistance; -public class SChunk { +public class ESPChunk { private static final BlockPos.Mutable blockPos = new BlockPos.Mutable(); private final int x, z; - public Long2ObjectMap blocks; + public Long2ObjectMap blocks; - public SChunk(int x, int z) { + public ESPChunk(int x, int z) { this.x = x; this.z = z; } - public SBlock get(int x, int y, int z) { - return blocks == null ? null : blocks.get(SBlock.getKey(x, y, z)); + public ESPBlock get(int x, int y, int z) { + return blocks == null ? null : blocks.get(ESPBlock.getKey(x, y, z)); } public void add(BlockPos blockPos, boolean update) { - SBlock block = new SBlock(blockPos.getX(), blockPos.getY(), blockPos.getZ()); + ESPBlock block = new ESPBlock(blockPos.getX(), blockPos.getY(), blockPos.getZ()); if (blocks == null) blocks = new Long2ObjectOpenHashMap<>(64); - blocks.put(SBlock.getKey(blockPos), block); + blocks.put(ESPBlock.getKey(blockPos), block); if (update) block.update(); } @@ -50,20 +50,20 @@ public void add(BlockPos blockPos) { public void remove(BlockPos blockPos) { if (blocks != null) { - SBlock block = blocks.remove(SBlock.getKey(blockPos)); + ESPBlock block = blocks.remove(ESPBlock.getKey(blockPos)); if (block != null) block.group.remove(block); } } public void update() { if (blocks != null) { - for (SBlock block : blocks.values()) block.update(); + for (ESPBlock block : blocks.values()) block.update(); } } public void update(int x, int y, int z) { if (blocks != null) { - SBlock block = blocks.get(SBlock.getKey(x, y, z)); + ESPBlock block = blocks.get(ESPBlock.getKey(x, y, z)); if (block != null) block.update(); } } @@ -82,13 +82,13 @@ public boolean shouldBeDeleted() { public void render(Render3DEvent event) { if (blocks != null) { - for (SBlock block : blocks.values()) block.render(event); + for (ESPBlock block : blocks.values()) block.render(event); } } - public static SChunk searchChunk(Chunk chunk, List blocks) { - SChunk schunk = new SChunk(chunk.getPos().x, chunk.getPos().z); + public static ESPChunk searchChunk(Chunk chunk, List blocks) { + ESPChunk schunk = new ESPChunk(chunk.getPos().x, chunk.getPos().z); if (schunk.shouldBeDeleted()) return schunk; for (int x = chunk.getPos().getStartX(); x <= chunk.getPos().getEndX(); x++) { diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SGroup.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPGroup.java similarity index 61% rename from src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SGroup.java rename to src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPGroup.java index 8950812c14..6f4c109f2f 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/render/search/SGroup.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/render/blockesp/ESPGroup.java @@ -3,7 +3,7 @@ * Copyright (c) Meteor Development. */ -package meteordevelopment.meteorclient.systems.modules.render.search; +package meteordevelopment.meteorclient.systems.modules.render.blockesp; import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet; import meteordevelopment.meteorclient.events.render.Render3DEvent; @@ -16,20 +16,20 @@ import java.util.Queue; import java.util.Set; -public class SGroup { - private static final Search search = Modules.get().get(Search.class); +public class ESPGroup { + private static final BlockESP blockEsp = Modules.get().get(BlockESP.class); private final Block block; - public final UnorderedArrayList blocks = new UnorderedArrayList<>(); + public final UnorderedArrayList blocks = new UnorderedArrayList<>(); private double sumX, sumY, sumZ; - public SGroup(Block block) { + public ESPGroup(Block block) { this.block = block; } - public void add(SBlock block, boolean removeFromOld, boolean splitGroup) { + public void add(ESPBlock block, boolean removeFromOld, boolean splitGroup) { blocks.add(block); sumX += block.x; sumY += block.y; @@ -39,39 +39,39 @@ public void add(SBlock block, boolean removeFromOld, boolean splitGroup) { block.group = this; } - public void add(SBlock block) { + public void add(ESPBlock block) { add(block, true, true); } - public void remove(SBlock block, boolean splitGroup) { + public void remove(ESPBlock block, boolean splitGroup) { blocks.remove(block); sumX -= block.x; sumY -= block.y; sumZ -= block.z; - if (blocks.isEmpty()) search.removeGroup(block.group); + if (blocks.isEmpty()) blockEsp.removeGroup(block.group); else if (splitGroup) { trySplit(block); } } - public void remove(SBlock block) { + public void remove(ESPBlock block) { remove(block, true); } - private void trySplit(SBlock block) { - Set neighbours = new ObjectOpenHashSet<>(6); + private void trySplit(ESPBlock block) { + Set neighbours = new ObjectOpenHashSet<>(6); - for (int side : SBlock.SIDES) { + for (int side : ESPBlock.SIDES) { if ((block.neighbours & side) == side) { - SBlock neighbour = block.getSideBlock(side); + ESPBlock neighbour = block.getSideBlock(side); if (neighbour != null) neighbours.add(neighbour); } } if (neighbours.size() <= 1) return; - Set remainingBlocks = new ObjectOpenHashSet<>(blocks); - Queue blocksToCheck = new ArrayDeque<>(); + Set remainingBlocks = new ObjectOpenHashSet<>(blocks); + Queue blocksToCheck = new ArrayDeque<>(); blocksToCheck.offer(blocks.get(0)); remainingBlocks.remove(blocks.get(0)); @@ -79,11 +79,11 @@ private void trySplit(SBlock block) { loop: { while (!blocksToCheck.isEmpty()) { - SBlock b = blocksToCheck.poll(); + ESPBlock b = blocksToCheck.poll(); - for (int side : SBlock.SIDES) { + for (int side : ESPBlock.SIDES) { if ((b.neighbours & side) != side) continue; - SBlock neighbour = b.getSideBlock(side); + ESPBlock neighbour = b.getSideBlock(side); if (neighbour != null && remainingBlocks.contains(neighbour)) { blocksToCheck.offer(neighbour); @@ -97,12 +97,12 @@ private void trySplit(SBlock block) { } if (neighbours.size() > 0) { - SGroup group = search.newGroup(this.block); + ESPGroup group = blockEsp.newGroup(this.block); group.blocks.ensureCapacity(remainingBlocks.size()); blocks.removeIf(remainingBlocks::contains); - for (SBlock b : remainingBlocks) { + for (ESPBlock b : remainingBlocks) { group.add(b, false, false); sumX -= b.x; @@ -113,18 +113,18 @@ private void trySplit(SBlock block) { if (neighbours.size() > 1) { block.neighbours = 0; - for (SBlock b : neighbours) { + for (ESPBlock b : neighbours) { int x = b.x - block.x; - if (x == 1) block.neighbours |= SBlock.RI; - else if (x == -1) block.neighbours |= SBlock.LE; + if (x == 1) block.neighbours |= ESPBlock.RI; + else if (x == -1) block.neighbours |= ESPBlock.LE; int y = b.y - block.y; - if (y == 1) block.neighbours |= SBlock.TO; - else if (y == -1) block.neighbours |= SBlock.BO; + if (y == 1) block.neighbours |= ESPBlock.TO; + else if (y == -1) block.neighbours |= ESPBlock.BO; int z = b.z - block.z; - if (z == 1) block.neighbours |= SBlock.FO; - else if (z == -1) block.neighbours |= SBlock.BA; + if (z == 1) block.neighbours |= ESPBlock.FO; + else if (z == -1) block.neighbours |= ESPBlock.BA; } group.trySplit(block); @@ -132,14 +132,14 @@ private void trySplit(SBlock block) { } } - public void merge(SGroup group) { + public void merge(ESPGroup group) { blocks.ensureCapacity(blocks.size() + group.blocks.size()); - for (SBlock block : group.blocks) add(block, false, false); - search.removeGroup(group); + for (ESPBlock block : group.blocks) add(block, false, false); + blockEsp.removeGroup(group); } public void render(Render3DEvent event) { - SBlockData blockData = search.getBlockData(block); + ESPBlockData blockData = blockEsp.getBlockData(block); if (blockData.tracer) { event.renderer.line(RenderUtils.center.x, RenderUtils.center.y, RenderUtils.center.z, sumX / blocks.size() + 0.5, sumY / blocks.size() + 0.5, sumZ / blocks.size() + 0.5, blockData.tracerColor);