Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
import meteordevelopment.meteorclient.systems.modules.Categories;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.Utils;
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
import meteordevelopment.meteorclient.utils.render.color.RainbowColors;
import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import meteordevelopment.meteorclient.utils.world.Dimension;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.block.Block;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.dimension.DimensionType;

import java.util.Iterator;
import java.util.List;
Expand Down Expand Up @@ -82,7 +83,7 @@ public class BlockESP extends Module {
private final Set<ESPGroup> groups = new ReferenceOpenHashSet<>();
private final ExecutorService workerThread = Executors.newSingleThreadExecutor();

private DimensionType lastDimension;
private Dimension lastDimension;

public BlockESP() {
super(Categories.Render, "block-esp", "Renders specified blocks through walls.", "search");
Expand All @@ -101,7 +102,7 @@ public void onActivate() {
searchChunk(chunk);
}

lastDimension = mc.world.getDimension();
lastDimension = PlayerUtils.getDimension();
}

@Override
Expand Down Expand Up @@ -226,9 +227,10 @@ private void onBlockUpdate(BlockUpdateEvent event) {

@EventHandler
private void onPostTick(TickEvent.Post event) {
DimensionType dimension = mc.world.getDimension();
Dimension dimension = PlayerUtils.getDimension();

if (lastDimension != dimension) onActivate();

lastDimension = dimension;
}

Expand All @@ -239,7 +241,7 @@ private void onRender(Render3DEvent event) {
ESPChunk chunk = it.next();

if (chunk.shouldBeDeleted()) {
workerThread.submit(() -> {
workerThread.execute(() -> {
for (ESPBlock block : chunk.blocks.values()) {
block.group.remove(block, false);
block.loaded = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import net.minecraft.world.Heightmap;
import net.minecraft.world.chunk.Chunk;

import java.util.List;
import java.util.Collection;

import static meteordevelopment.meteorclient.MeteorClient.mc;
import static meteordevelopment.meteorclient.utils.Utils.getRenderDistance;
Expand Down Expand Up @@ -86,7 +86,7 @@ public void render(Render3DEvent event) {
}


public static ESPChunk searchChunk(Chunk chunk, List<Block> blocks) {
public static ESPChunk searchChunk(Chunk chunk, Collection<Block> blocks) {
ESPChunk schunk = new ESPChunk(chunk.getPos().x, chunk.getPos().z);
if (schunk.shouldBeDeleted()) return schunk;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import meteordevelopment.meteorclient.utils.other.JsonDateDeserializer;
import net.minecraft.util.Util;

import javax.annotation.Nullable;
import java.io.IOException;
Expand All @@ -29,7 +30,9 @@ public class Http {
public static final int FORBIDDEN = 403;
public static final int NOT_FOUND = 404;

private static final HttpClient CLIENT = HttpClient.newHttpClient();
private static final HttpClient CLIENT = HttpClient.newBuilder()
.executor(Util.getDownloadWorkerExecutor())
.build();

private static final Gson GSON = new GsonBuilder()
.registerTypeAdapter(Date.class, new JsonDateDeserializer())
Expand Down