1 package me.shedaniel.lightoverlay.forge;
3 import com.google.common.collect.Lists;
4 import com.google.common.collect.Maps;
5 import com.mojang.blaze3d.systems.RenderSystem;
6 import net.minecraft.block.Block;
7 import net.minecraft.block.BlockState;
8 import net.minecraft.client.Minecraft;
9 import net.minecraft.client.entity.player.ClientPlayerEntity;
10 import net.minecraft.client.gui.FontRenderer;
11 import net.minecraft.client.renderer.*;
12 import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
13 import net.minecraft.client.settings.KeyBinding;
14 import net.minecraft.client.util.InputMappings;
15 import net.minecraft.client.world.ClientWorld;
16 import net.minecraft.entity.Entity;
17 import net.minecraft.entity.EntityClassification;
18 import net.minecraft.entity.EntityType;
19 import net.minecraft.network.IPacket;
20 import net.minecraft.network.play.server.SChangeBlockPacket;
21 import net.minecraft.network.play.server.SChunkDataPacket;
22 import net.minecraft.network.play.server.SMultiBlockChangePacket;
23 import net.minecraft.tags.BlockTags;
24 import net.minecraft.util.Direction;
25 import net.minecraft.util.ResourceLocation;
26 import net.minecraft.util.math.BlockPos;
27 import net.minecraft.util.math.ChunkPos;
28 import net.minecraft.util.math.MathHelper;
29 import net.minecraft.util.math.Vec3d;
30 import net.minecraft.util.math.shapes.ISelectionContext;
31 import net.minecraft.util.math.shapes.VoxelShape;
32 import net.minecraft.util.text.TranslationTextComponent;
33 import net.minecraft.world.IBlockReader;
34 import net.minecraft.world.LightType;
35 import net.minecraft.world.World;
36 import net.minecraft.world.biome.Biome;
37 import net.minecraft.world.chunk.Chunk;
38 import net.minecraft.world.chunk.ChunkStatus;
39 import net.minecraft.world.lighting.IWorldLightListener;
40 import net.minecraftforge.api.distmarker.Dist;
41 import net.minecraftforge.client.event.InputEvent;
42 import net.minecraftforge.client.settings.KeyConflictContext;
43 import net.minecraftforge.client.settings.KeyModifier;
44 import net.minecraftforge.common.MinecraftForge;
45 import net.minecraftforge.event.TickEvent;
46 import net.minecraftforge.eventbus.api.SubscribeEvent;
47 import net.minecraftforge.fml.DistExecutor;
48 import net.minecraftforge.fml.client.registry.ClientRegistry;
49 import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
50 import org.apache.logging.log4j.LogManager;
51 import org.lwjgl.opengl.GL11;
54 import java.io.FileInputStream;
55 import java.io.FileOutputStream;
56 import java.io.IOException;
57 import java.text.DecimalFormat;
59 import java.util.concurrent.ExecutorService;
60 import java.util.concurrent.Executors;
62 public class LightOverlayClient {
63 static final DecimalFormat FORMAT = new DecimalFormat("#.#");
64 private static final String KEYBIND_CATEGORY = "key.lightoverlay-forge.category";
65 private static final ResourceLocation ENABLE_OVERLAY_KEYBIND = new ResourceLocation("lightoverlay-forge", "enable_overlay");
66 private static final ResourceLocation INCREASE_REACH_KEYBIND = new ResourceLocation("lightoverlay-forge", "increase_reach");
67 private static final ResourceLocation DECREASE_REACH_KEYBIND = new ResourceLocation("lightoverlay-forge", "decrease_reach");
68 private static final ResourceLocation INCREASE_LINE_WIDTH_KEYBIND = new ResourceLocation("lightoverlay-forge", "increase_line_width");
69 private static final ResourceLocation DECREASE_LINE_WIDTH_KEYBIND = new ResourceLocation("lightoverlay-forge", "decrease_line_width");
70 static int reach = 12;
71 static int crossLevel = 7;
72 static boolean showNumber = false;
73 static boolean smoothLines = true;
74 static boolean underwater = false;
75 static EntityType<Entity> testingEntityType;
76 static float lineWidth = 1.0F;
77 static int yellowColor = 0xFFFF00, redColor = 0xFF0000;
78 static File configFile = new File(new File(Minecraft.getInstance().gameDir, "config"), "lightoverlay.properties");
79 private static KeyBinding enableOverlay, increaseReach, decreaseReach, increaseLineWidth, decreaseLineWidth;
80 private static boolean enabled = false;
81 private static int threadNumber = 0;
82 private static final ExecutorService EXECUTOR = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(), r -> {
83 Thread thread = new Thread(r, "light-overlay-" + threadNumber++);
84 thread.setDaemon(true);
87 private static final List<ChunkPos> POS = Lists.newCopyOnWriteArrayList();
88 private static final Map<ChunkPos, Map<Long, Object>> CHUNK_MAP = Maps.newConcurrentMap();
89 private static long ticks = 0;
91 public static void register() {
93 loadConfig(configFile);
96 testingEntityType = EntityType.Builder.create(EntityClassification.MONSTER).size(0f, 0f).disableSerialization().build(null);
97 enableOverlay = registerKeybind(ENABLE_OVERLAY_KEYBIND, InputMappings.Type.KEYSYM, 296, KEYBIND_CATEGORY);
98 increaseReach = registerKeybind(INCREASE_REACH_KEYBIND, InputMappings.Type.KEYSYM, -1, KEYBIND_CATEGORY);
99 decreaseReach = registerKeybind(DECREASE_REACH_KEYBIND, InputMappings.Type.KEYSYM, -1, KEYBIND_CATEGORY);
100 increaseLineWidth = registerKeybind(INCREASE_LINE_WIDTH_KEYBIND, InputMappings.Type.KEYSYM, -1, KEYBIND_CATEGORY);
101 decreaseLineWidth = registerKeybind(DECREASE_LINE_WIDTH_KEYBIND, InputMappings.Type.KEYSYM, -1, KEYBIND_CATEGORY);
102 MinecraftForge.EVENT_BUS.register(LightOverlayClient.class);
105 //noinspection Convert2MethodRef
106 DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> LightOverlayCloth.register());
107 } catch (Exception e) {
112 public static CrossType getCrossType(BlockPos pos, BlockPos down, IBlockReader reader, IWorldLightListener block, IWorldLightListener sky, ISelectionContext selectionContext) {
113 BlockState blockBelowState = reader.getBlockState(down);
114 BlockState blockUpperState = reader.getBlockState(pos);
115 VoxelShape upperCollisionShape = blockUpperState.getCollisionShape(reader, pos, selectionContext);
116 if (!underwater && !blockUpperState.getFluidState().isEmpty())
117 return CrossType.NONE;
118 /* WorldEntitySpawner.func_222266_a */
119 // Check if the outline is full
120 if (Block.doesSideFillSquare(upperCollisionShape, Direction.UP))
121 return CrossType.NONE;
122 // Check if there is power
123 if (blockUpperState.canProvidePower())
124 return CrossType.NONE;
125 // Check if the collision has a bump
126 if (upperCollisionShape.getEnd(Direction.Axis.Y) > 0)
127 return CrossType.NONE;
128 if (blockUpperState.getBlock().isIn(BlockTags.RAILS))
129 return CrossType.NONE;
130 // Check block state allow spawning (excludes bedrock and barriers automatically)
131 if (!blockBelowState.canEntitySpawn(reader, down, testingEntityType))
132 return CrossType.NONE;
133 if (block.getLightFor(pos) > crossLevel)
134 return CrossType.NONE;
135 if (sky.getLightFor(pos) > crossLevel)
136 return CrossType.YELLOW;
137 return CrossType.RED;
140 public static int getCrossLevel(BlockPos pos, BlockPos down, IBlockReader reader, IWorldLightListener light, ISelectionContext context) {
141 BlockState blockBelowState = reader.getBlockState(down);
142 BlockState blockUpperState = reader.getBlockState(pos);
143 VoxelShape collisionShape = blockBelowState.getCollisionShape(reader, down, context);
144 VoxelShape upperCollisionShape = blockUpperState.getCollisionShape(reader, pos, context);
145 if (!underwater && !blockUpperState.getFluidState().isEmpty())
147 if (!blockBelowState.getFluidState().isEmpty())
149 if (blockBelowState.isAir(reader, down))
151 if (Block.doesSideFillSquare(upperCollisionShape, Direction.DOWN))
153 return light.getLightFor(pos);
156 public static void renderCross(ActiveRenderInfo info, Tessellator tessellator, BufferBuilder buffer, World world, BlockPos pos, int color, ISelectionContext context) {
157 double d0 = info.getProjectedView().x;
158 double d1 = info.getProjectedView().y - .005D;
159 VoxelShape upperOutlineShape = world.getBlockState(pos).getShape(world, pos, context);
160 if (!upperOutlineShape.isEmpty())
161 d1 -= upperOutlineShape.getEnd(Direction.Axis.Y);
162 double d2 = info.getProjectedView().z;
163 buffer.begin(1, DefaultVertexFormats.POSITION_COLOR);
164 int red = (color >> 16) & 255;
165 int green = (color >> 8) & 255;
166 int blue = color & 255;
167 buffer.pos(pos.getX() + .01 - d0, pos.getY() - d1, pos.getZ() + .01 - d2).color(red, green, blue, 255).endVertex();
168 buffer.pos(pos.getX() - .01 + 1 - d0, pos.getY() - d1, pos.getZ() - .01 + 1 - d2).color(red, green, blue, 255).endVertex();
169 buffer.pos(pos.getX() - .01 + 1 - d0, pos.getY() - d1, pos.getZ() + .01 - d2).color(red, green, blue, 255).endVertex();
170 buffer.pos(pos.getX() + .01 - d0, pos.getY() - d1, pos.getZ() - .01 + 1 - d2).color(red, green, blue, 255).endVertex();
174 public static void renderLevel(Minecraft minecraft, ActiveRenderInfo info, World world, BlockPos pos, BlockPos down, int level, ISelectionContext context) {
175 String string_1 = String.valueOf(level);
176 FontRenderer fontRenderer = minecraft.fontRenderer;
177 double double_4 = info.getProjectedView().x;
178 double double_5 = info.getProjectedView().y;
179 VoxelShape upperOutlineShape = world.getBlockState(down).getShape(world, down, context);
180 if (!upperOutlineShape.isEmpty())
181 double_5 += 1 - upperOutlineShape.getEnd(Direction.Axis.Y);
182 double double_6 = info.getProjectedView().z;
183 RenderSystem.pushMatrix();
184 RenderSystem.translatef((float) (pos.getX() + 0.5f - double_4), (float) (pos.getY() - double_5) + 0.005f, (float) (pos.getZ() + 0.5f - double_6));
185 RenderSystem.rotatef(90, 1, 0, 0);
186 RenderSystem.normal3f(0.0F, 1.0F, 0.0F);
188 RenderSystem.scalef(-size, -size, size);
189 float float_3 = (float) (-fontRenderer.getStringWidth(string_1)) / 2.0F + 0.4f;
190 RenderSystem.enableAlphaTest();
191 IRenderTypeBuffer.Impl vertexConsumerProvider$Immediate_1 = IRenderTypeBuffer.getImpl(Tessellator.getInstance().getBuffer());
192 fontRenderer.renderString(string_1, float_3, -3.5f, level > crossLevel ? 0xff042404 : 0xff731111, false, TransformationMatrix.identity().getMatrix(), vertexConsumerProvider$Immediate_1, false, 0, 15728880);
193 vertexConsumerProvider$Immediate_1.finish();
194 RenderSystem.popMatrix();
197 @SubscribeEvent(receiveCanceled = true)
198 public static void handleInput(InputEvent.KeyInputEvent event) {
199 if (enableOverlay.isPressed())
201 if (increaseReach.isPressed()) {
205 saveConfig(configFile);
206 } catch (IOException e) {
209 Minecraft.getInstance().player.sendStatusMessage(new TranslationTextComponent("text.lightoverlay-forge.current_reach", reach), false);
211 if (decreaseReach.isPressed()) {
215 saveConfig(configFile);
216 } catch (IOException e) {
219 Minecraft.getInstance().player.sendStatusMessage(new TranslationTextComponent("text.lightoverlay-forge.current_reach", reach), false);
221 if (increaseLineWidth.isPressed()) {
225 saveConfig(configFile);
226 } catch (IOException e) {
229 Minecraft.getInstance().player.sendStatusMessage(new TranslationTextComponent("text.lightoverlay-forge.current_line_width", FORMAT.format(lineWidth)), false);
231 if (decreaseLineWidth.isPressed()) {
235 saveConfig(configFile);
236 } catch (IOException e) {
239 Minecraft.getInstance().player.sendStatusMessage(new TranslationTextComponent("text.lightoverlay-forge.current_line_width", FORMAT.format(lineWidth)), false);
243 public static void queueChunkAndNear(ChunkPos pos) {
244 for (int xOffset = -1; xOffset <= 1; xOffset++) {
245 for (int zOffset = -1; zOffset <= 1; zOffset++) {
246 queueChunk(new ChunkPos(pos.x + xOffset, pos.z + zOffset));
251 public static void queueChunk(ChunkPos pos) {
252 if (!POS.contains(pos))
256 public static int getChunkRange() {
257 return Math.max(MathHelper.ceil(reach / 16f), 1);
261 public static void tick(TickEvent.ClientTickEvent event) {
262 if (event.phase == TickEvent.Phase.END) {
264 Minecraft minecraft = Minecraft.getInstance();
266 if (minecraft.player == null || !enabled) {
270 ClientPlayerEntity player = minecraft.player;
271 ClientWorld world = minecraft.world;
272 ISelectionContext selectionContext = ISelectionContext.forEntity(player);
273 Vec3d[] playerPos = {null};
274 int playerPosX = ((int) player.getPosX()) >> 4;
275 int playerPosZ = ((int) player.getPosZ()) >> 4;
276 if (ticks % 20 == 0) {
277 for (int chunkX = playerPosX - getChunkRange(); chunkX <= playerPosX + getChunkRange(); chunkX++) {
278 for (int chunkZ = playerPosZ - getChunkRange(); chunkZ <= playerPosZ + getChunkRange(); chunkZ++) {
279 ChunkPos chunkPos = new ChunkPos(chunkX, chunkZ);
280 if (!CHUNK_MAP.containsKey(chunkPos))
281 queueChunk(chunkPos);
285 if (!POS.isEmpty()) {
286 if (playerPos[0] == null) {
287 playerPos[0] = player.getPositionVec();
289 ChunkPos pos = POS.stream().min(Comparator.comparingDouble(value -> value.getBlock(8, 0, 8).distanceSq(playerPos[0].x, 0, playerPos[0].z, false))).get();
290 EXECUTOR.submit(() -> {
291 if (MathHelper.abs(pos.x - playerPosX) <= getChunkRange() && MathHelper.abs(pos.z - playerPosZ) <= getChunkRange()) {
292 calculateChunk(world.getChunkProvider().getChunk(pos.x, pos.z, ChunkStatus.FULL, false), world, pos, selectionContext);
294 CHUNK_MAP.remove(pos);
299 Iterator<Map.Entry<ChunkPos, Map<Long, Object>>> chunkMapIterator = CHUNK_MAP.entrySet().iterator();
300 while (chunkMapIterator.hasNext()) {
301 Map.Entry<ChunkPos, Map<Long, Object>> pos = chunkMapIterator.next();
302 if (MathHelper.abs(pos.getKey().x - playerPosX) > getChunkRange() * 2 || MathHelper.abs(pos.getKey().z - playerPosZ) > getChunkRange() * 2) {
303 chunkMapIterator.remove();
307 } catch (Exception e) {
308 LogManager.getLogger().throwing(e);
313 private static void calculateChunk(Chunk chunk, World world, ChunkPos chunkPos, ISelectionContext selectionContext) {
314 Map<Long, Object> map = Maps.newHashMap();
316 IWorldLightListener block = chunk.getWorldLightManager().getLightEngine(LightType.BLOCK);
317 IWorldLightListener sky = showNumber ? null : chunk.getWorldLightManager().getLightEngine(LightType.SKY);
318 for (BlockPos pos : BlockPos.getAllInBoxMutable(chunkPos.getXStart(), 0, chunkPos.getZStart(), chunkPos.getXEnd(), 256, chunkPos.getZEnd())) {
319 BlockPos down = pos.down();
321 int level = LightOverlayClient.getCrossLevel(pos, down, chunk, block, selectionContext);
323 map.put(pos.toLong(), level);
326 Biome biome = world.getBiomeManager().getBiome(pos);
327 if (biome.getSpawningChance() > 0 && !biome.getSpawns(EntityClassification.MONSTER).isEmpty()) {
328 CrossType type = LightOverlayClient.getCrossType(pos, down, chunk, block, sky, selectionContext);
329 if (type != CrossType.NONE) {
330 map.put(pos.toLong(), type);
336 CHUNK_MAP.put(chunkPos, map);
339 public static void renderWorldLast() {
340 if (LightOverlayClient.enabled) {
341 RenderSystem.pushMatrix();
342 Minecraft client = Minecraft.getInstance();
343 ClientPlayerEntity playerEntity = client.player;
344 int playerPosX = ((int) playerEntity.getPosX()) >> 4;
345 int playerPosZ = ((int) playerEntity.getPosZ()) >> 4;
346 ISelectionContext selectionContext = ISelectionContext.forEntity(playerEntity);
347 World world = client.world;
348 BlockPos playerPos = playerEntity.getPosition();
349 ActiveRenderInfo info = client.gameRenderer.getActiveRenderInfo();
351 RenderSystem.enableTexture();
352 RenderSystem.depthMask(true);
353 BlockPos.Mutable mutable = new BlockPos.Mutable();
354 for (Map.Entry<ChunkPos, Map<Long, Object>> entry : CHUNK_MAP.entrySet()) {
355 if (MathHelper.abs(entry.getKey().x - playerPosX) > getChunkRange() || MathHelper.abs(entry.getKey().z - playerPosZ) > getChunkRange()) {
358 for (Map.Entry<Long, Object> objectEntry : entry.getValue().entrySet()) {
359 if (objectEntry.getValue() instanceof Integer) {
360 mutable.setPos(BlockPos.unpackX(objectEntry.getKey()), BlockPos.unpackY(objectEntry.getKey()), BlockPos.unpackZ(objectEntry.getKey()));
361 if (mutable.withinDistance(playerPos, reach)) {
362 BlockPos down = mutable.down();
363 LightOverlayClient.renderLevel(client, info, world, mutable, down, (Integer) objectEntry.getValue(), selectionContext);
368 RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
369 RenderSystem.enableDepthTest();
371 RenderSystem.enableDepthTest();
372 RenderSystem.shadeModel(7425);
373 RenderSystem.enableAlphaTest();
374 RenderSystem.defaultAlphaFunc();
375 RenderSystem.disableTexture();
376 RenderSystem.disableBlend();
377 if (smoothLines) GL11.glEnable(GL11.GL_LINE_SMOOTH);
378 RenderSystem.lineWidth(lineWidth);
379 Tessellator tessellator = Tessellator.getInstance();
380 BufferBuilder buffer = tessellator.getBuffer();
381 BlockPos.Mutable mutable = new BlockPos.Mutable();
382 for (Map.Entry<ChunkPos, Map<Long, Object>> entry : CHUNK_MAP.entrySet()) {
383 if (MathHelper.abs(entry.getKey().x - playerPosX) > getChunkRange() || MathHelper.abs(entry.getKey().z - playerPosZ) > getChunkRange()) {
386 for (Map.Entry<Long, Object> objectEntry : entry.getValue().entrySet()) {
387 if (objectEntry.getValue() instanceof CrossType) {
388 mutable.setPos(BlockPos.unpackX(objectEntry.getKey()), BlockPos.unpackY(objectEntry.getKey()), BlockPos.unpackZ(objectEntry.getKey()));
389 if (mutable.withinDistance(playerPos, reach)) {
390 BlockPos down = mutable.down();
391 int color = objectEntry.getValue() == CrossType.RED ? redColor : yellowColor;
392 LightOverlayClient.renderCross(info, tessellator, buffer, world, mutable, color, selectionContext);
397 RenderSystem.enableBlend();
398 RenderSystem.enableTexture();
399 RenderSystem.shadeModel(7424);
400 if (smoothLines) GL11.glDisable(GL11.GL_LINE_SMOOTH);
402 RenderSystem.popMatrix();
406 private static KeyBinding registerKeybind(ResourceLocation resourceLocation, InputMappings.Type type, int keyCode, String category) {
407 KeyBinding keyBinding = new KeyBinding("key." + resourceLocation.getNamespace() + "." + resourceLocation.getPath(), KeyConflictContext.IN_GAME, KeyModifier.NONE, type, keyCode, category);
408 ClientRegistry.registerKeyBinding(keyBinding);
412 static void loadConfig(File file) {
415 yellowColor = 0xFFFF00;
416 if (!file.exists() || !file.canRead())
418 FileInputStream fis = new FileInputStream(file);
419 Properties properties = new Properties();
420 properties.load(fis);
422 reach = Integer.parseInt((String) properties.computeIfAbsent("reach", a -> "12"));
423 crossLevel = Integer.parseInt((String) properties.computeIfAbsent("crossLevel", a -> "7"));
424 showNumber = ((String) properties.computeIfAbsent("showNumber", a -> "false")).equalsIgnoreCase("true");
425 smoothLines = ((String) properties.computeIfAbsent("smoothLines", a -> "true")).equalsIgnoreCase("true");
426 underwater = ((String) properties.computeIfAbsent("underwater", a -> "false")).equalsIgnoreCase("true");
427 lineWidth = Float.parseFloat((String) properties.computeIfAbsent("lineWidth", a -> "1"));
430 r = Integer.parseInt((String) properties.computeIfAbsent("yellowColorRed", a -> "255"));
431 g = Integer.parseInt((String) properties.computeIfAbsent("yellowColorGreen", a -> "255"));
432 b = Integer.parseInt((String) properties.computeIfAbsent("yellowColorBlue", a -> "0"));
433 yellowColor = (r << 16) + (g << 8) + b;
437 r = Integer.parseInt((String) properties.computeIfAbsent("redColorRed", a -> "255"));
438 g = Integer.parseInt((String) properties.computeIfAbsent("redColorGreen", a -> "0"));
439 b = Integer.parseInt((String) properties.computeIfAbsent("redColorBlue", a -> "0"));
440 redColor = (r << 16) + (g << 8) + b;
443 } catch (Exception e) {
448 yellowColor = 0xFFFF00;
454 } catch (IOException ex) {
455 ex.printStackTrace();
460 static void saveConfig(File file) throws IOException {
461 FileOutputStream fos = new FileOutputStream(file, false);
462 fos.write("# Light Overlay Config".getBytes());
463 fos.write("\n".getBytes());
464 fos.write(("reach=" + reach).getBytes());
465 fos.write("\n".getBytes());
466 fos.write(("crossLevel=" + crossLevel).getBytes());
467 fos.write("\n".getBytes());
468 fos.write(("showNumber=" + showNumber).getBytes());
469 fos.write("\n".getBytes());
470 fos.write(("smoothLines=" + smoothLines).getBytes());
471 fos.write("\n".getBytes());
472 fos.write(("underwater=" + underwater).getBytes());
473 fos.write("\n".getBytes());
474 fos.write(("lineWidth=" + FORMAT.format(lineWidth)).getBytes());
475 fos.write("\n".getBytes());
476 fos.write(("yellowColorRed=" + ((yellowColor >> 16) & 255)).getBytes());
477 fos.write("\n".getBytes());
478 fos.write(("yellowColorGreen=" + ((yellowColor >> 8) & 255)).getBytes());
479 fos.write("\n".getBytes());
480 fos.write(("yellowColorBlue=" + (yellowColor & 255)).getBytes());
481 fos.write("\n".getBytes());
482 fos.write(("redColorRed=" + ((redColor >> 16) & 255)).getBytes());
483 fos.write("\n".getBytes());
484 fos.write(("redColorGreen=" + ((redColor >> 8) & 255)).getBytes());
485 fos.write("\n".getBytes());
486 fos.write(("redColorBlue=" + (redColor & 255)).getBytes());
490 public static void processPacket(IPacket<?> packet) {
491 if (packet instanceof SChangeBlockPacket) {
492 LightOverlayClient.queueChunkAndNear(new ChunkPos(((SChangeBlockPacket) packet).getPos()));
493 } else if (packet instanceof SChunkDataPacket) {
494 LightOverlayClient.queueChunkAndNear(new ChunkPos(((SChunkDataPacket) packet).getChunkX(), ((SChunkDataPacket) packet).getChunkZ()));
495 } else if (packet instanceof SMultiBlockChangePacket) {
496 ChunkPos chunkPos = ObfuscationReflectionHelper.getPrivateValue(SMultiBlockChangePacket.class, (SMultiBlockChangePacket) packet, "field_148925_b");
497 LightOverlayClient.queueChunkAndNear(new ChunkPos(chunkPos.x, chunkPos.z));
501 private enum CrossType {