From ab1e8153f50db2d0f02aaebbcd00a76b8187c773 Mon Sep 17 00:00:00 2001 From: OrderedSet86 <88752681+OrderedSet86@users.noreply.github.com> Date: Mon, 16 Nov 2026 09:51:42 -0800 Subject: [PATCH] Add NEI mob spawn overlay variants (#1111) - Add multiple light level overlay modes (Connected, Square, GTNH Logo, Pufferfish, X) - Set default F7 overlay to Connected - Allow changing horizontal and vertical radius of light level overlay (before it was stuck at 16 blocks) - Set default horizontal radius to 32 blocks - Optimize performance by 10-30x compared to master - Works with shaders (tested Complementary Unbound + Euphoria patches) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Robertz --- .../java/codechicken/nei/ClientHandler.java | 1 + .../java/codechicken/nei/NEIClientConfig.java | 42 ++ .../codechicken/nei/WorldOverlayRenderer.java | 228 ++++------ .../nei/moboverlay/MobOverlayDisplayList.java | 65 +++ .../nei/moboverlay/MobOverlayFace.java | 88 ++++ .../nei/moboverlay/MobOverlayScan.java | 421 ++++++++++++++++++ .../nei/moboverlay/MobOverlayStyle.java | 135 ++++++ src/main/resources/assets/nei/lang/en_US.lang | 9 + .../nei/textures/overlay/pufferfish.png | Bin 0 -> 1970 bytes .../textures/overlay/pufferfish.png.mcmeta | 6 + 10 files changed, 851 insertions(+), 144 deletions(-) create mode 100644 src/main/java/codechicken/nei/moboverlay/MobOverlayDisplayList.java create mode 100644 src/main/java/codechicken/nei/moboverlay/MobOverlayFace.java create mode 100644 src/main/java/codechicken/nei/moboverlay/MobOverlayScan.java create mode 100644 src/main/java/codechicken/nei/moboverlay/MobOverlayStyle.java create mode 100644 src/main/resources/assets/nei/textures/overlay/pufferfish.png create mode 100644 src/main/resources/assets/nei/textures/overlay/pufferfish.png.mcmeta diff --git a/src/main/java/codechicken/nei/ClientHandler.java b/src/main/java/codechicken/nei/ClientHandler.java index c39e9348..83cb3710 100644 --- a/src/main/java/codechicken/nei/ClientHandler.java +++ b/src/main/java/codechicken/nei/ClientHandler.java @@ -447,6 +447,7 @@ public class ClientHandler { if (event.world == mc.theWorld) { NEIClientConfig.unloadWorld(); ItemMobSpawner.clearEntityReferences(); + WorldOverlayRenderer.onWorldUnload(); RecipeItemInputHandler.instance.clearTooltipCache(); RecipeHandlerRef.clearCache(); ItemPanels.itemPanel.craftablesPanel.clearGuiReferences(); diff --git a/src/main/java/codechicken/nei/NEIClientConfig.java b/src/main/java/codechicken/nei/NEIClientConfig.java index 1af5bbc3..527edd70 100644 --- a/src/main/java/codechicken/nei/NEIClientConfig.java +++ b/src/main/java/codechicken/nei/NEIClientConfig.java @@ -57,6 +57,8 @@ import codechicken.nei.config.OptionToggleButtonBoubs; import codechicken.nei.config.OptionUtilities; import codechicken.nei.config.preset.GuiPresetList; import codechicken.nei.event.NEIConfigsLoadedEvent; +import codechicken.nei.moboverlay.MobOverlayScan; +import codechicken.nei.moboverlay.MobOverlayStyle; import codechicken.nei.recipe.IRecipeHandler; import codechicken.nei.recipe.InformationHandler; import codechicken.nei.recipe.RecipeCatalysts; @@ -442,6 +444,46 @@ public class NEIClientConfig { tag.getTag("world.overlays.lock").getBooleanValue(true); API.addOption(new OptionToggleButton("world.overlays.lock", true)); + tag.getTag("world.overlays.mobOverlayStyle") + .setComment("Mark on each block of the mob spawn overlay: " + MobOverlayStyle.formatAllNames()) + .getValue(MobOverlayStyle.DEFAULT.formatName()); + API.addOption(new OptionCycled("world.overlays.mobOverlayStyle", MobOverlayStyle.values().length, true) { + + @Override + public int value() { + return MobOverlayStyle.parseStyle(getTag().getValue()).ordinal(); + } + + @Override + public void setValue(int value) { + getTag().setValue(MobOverlayStyle.values()[value].formatName()); + } + + @Override + public String getButtonText() { + return translateN( + "world.overlays.mobOverlayStyle." + + MobOverlayStyle.parseStyle(getTag().getValue()).formatName()); + } + }); + + tag.getTag("world.overlays.mobOverlayRadius") + .setComment("Blocks scanned on each side of the player by the mob spawn overlay") + .getIntValue(MobOverlayScan.DEFAULT_RADIUS); + API.addOption( + new OptionIntegerField( + "world.overlays.mobOverlayRadius", + MobOverlayScan.MIN_RADIUS, + MobOverlayScan.MAX_RADIUS)); + tag.getTag("world.overlays.mobOverlayVerticalRadius") + .setComment("Blocks scanned above and below the player by the mob spawn overlay") + .getIntValue(MobOverlayScan.DEFAULT_VERTICAL_RADIUS); + API.addOption( + new OptionIntegerField( + "world.overlays.mobOverlayVerticalRadius", + MobOverlayScan.MIN_VERTICAL_RADIUS, + MobOverlayScan.MAX_VERTICAL_RADIUS)); + tag.getTag("inventory.itempanelScale").getIntValue(100); ItemsPanelGrid.updateScale(); API.addOption(new OptionIntegerField("inventory.itempanelScale", 1, 1000) { diff --git a/src/main/java/codechicken/nei/WorldOverlayRenderer.java b/src/main/java/codechicken/nei/WorldOverlayRenderer.java index 56a3af37..8b766534 100644 --- a/src/main/java/codechicken/nei/WorldOverlayRenderer.java +++ b/src/main/java/codechicken/nei/WorldOverlayRenderer.java @@ -4,27 +4,22 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.concurrent.Callable; -import net.minecraft.block.Block; -import net.minecraft.block.BlockSnow; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.entity.Entity; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.passive.EntityPig; -import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatComponentText; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.SpawnerAnimals; +import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.chunk.Chunk; import org.lwjgl.opengl.GL11; import com.cardinalstar.cubicchunks.world.api.IMinMaxHeight; -import codechicken.lib.math.MathHelper; import codechicken.nei.KeyManager.IKeyStateTracker; +import codechicken.nei.moboverlay.MobOverlayDisplayList; +import codechicken.nei.moboverlay.MobOverlayFace; +import codechicken.nei.moboverlay.MobOverlayScan; +import codechicken.nei.moboverlay.MobOverlayStyle; import cpw.mods.fml.relauncher.ReflectionHelper; public class WorldOverlayRenderer implements IKeyStateTracker { @@ -32,14 +27,20 @@ public class WorldOverlayRenderer implements IKeyStateTracker { public static int chunkOverlay = 0; public static int mobOverlay = 0; - private static byte[] mobSpawnCache; - private static long mobOverlayUpdateTime; + private static final MobOverlayScan MOB_OVERLAY_SCAN = new MobOverlayScan(); + private static final MobOverlayFace MARKED_FACE = new MobOverlayFace(); + private static final MobOverlayDisplayList MOB_OVERLAY_LIST = new MobOverlayDisplayList(); public static void reset() { mobOverlay = 0; chunkOverlay = 0; } + public static void onWorldUnload() { + MOB_OVERLAY_SCAN.clear(); + MOB_OVERLAY_LIST.delete(); + } + @Override public void tickKeyStates() { if (Minecraft.getMinecraft().currentScreen != null) return; @@ -82,158 +83,97 @@ public class WorldOverlayRenderer implements IKeyStateTracker { GL11.glPopAttrib(); } - private static void buildMobSpawnOverlay(Entity entity) { - if (mobSpawnCache == null) { - mobSpawnCache = new byte[33 * 33 * 33]; // 35kB - } - - World world = entity.worldObj; - int worldHeight = world.getHeight(); - - int x1 = (int) entity.posX; - int z1 = (int) entity.posZ; - int y1 = (int) MathHelper.clip(entity.posY, 16, worldHeight - 16); - - for (int i = 0; i <= 32; i++) { - int x = x1 - 16 + i; - for (int j = 0; j <= 32; j++) { - int z = z1 - 16 + j; - int bufIndex = (i * 33 + j) * 33; - - Chunk chunk = world.getChunkFromBlockCoords(x, z); - BiomeGenBase biome = world.getBiomeGenForCoords(x, z); - if (biome.getSpawnableList(EnumCreatureType.monster).isEmpty() || biome.getSpawningChance() <= 0) { - mobSpawnCache[bufIndex] = -1; - continue; - } - - int maxHeight = chunk.worldObj.getHeightValue(x, z); - - for (int k = 0; k <= 32; k++) { - int y = y1 - 16 + k; - - if (y >= worldHeight) { - mobSpawnCache[bufIndex + k] = -1; - continue; - } - - if (y > maxHeight) { - mobSpawnCache[bufIndex + k] = -1; - break; - } - mobSpawnCache[bufIndex + k] = getSpawnMode(chunk, x, y, z); - } - } - } - } - - private static double getOverlayYOffset(World world, int x, int y, int z) { - Block block = world.getBlock(x, y, z); - if (block instanceof BlockSnow) { - int meta = world.getBlockMetadata(x, y, z) & 7; - return (1 + meta) / 8.0 + 0.02; - } - return 0.02; - } - + /** + * The model view matrix is relative to ({@code intOffsetX}, {@code intOffsetY}, {@code intOffsetZ}), the camera + * position cast to {@code int}. + */ private static void renderMobSpawnOverlay(Entity entity, int intOffsetX, int intOffsetY, int intOffsetZ) { if (mobOverlay == 0) { - if (mobSpawnCache != null) { - mobSpawnCache = null; - } + MOB_OVERLAY_SCAN.clear(); + MOB_OVERLAY_LIST.delete(); return; } - long worldTime = entity.worldObj.getTotalWorldTime(); - if (mobSpawnCache == null || mobOverlayUpdateTime != worldTime) { - mobOverlayUpdateTime = worldTime; - buildMobSpawnOverlay(entity); + MOB_OVERLAY_SCAN.update( + entity, + NEIClientConfig.getIntSetting("world.overlays.mobOverlayRadius"), + NEIClientConfig.getIntSetting("world.overlays.mobOverlayVerticalRadius")); + final MobOverlayStyle style = MobOverlayStyle + .parseStyle(NEIClientConfig.getSetting("world.overlays.mobOverlayStyle").getValue()); + final long worldTicks = entity.worldObj.getTotalWorldTime(); + if (MOB_OVERLAY_LIST.isCompileDue(MOB_OVERLAY_SCAN.getModesVersion(), style, worldTicks)) { + compileMobOverlayList(style, worldTicks); } - GL11.glDisable(GL11.GL_TEXTURE_2D); + beginMobOverlayDraw(style); + MOB_OVERLAY_LIST.draw(intOffsetX, intOffsetY, intOffsetZ); + endMobOverlayDraw(); + } + + /** + * Add a marked face to {@link #MOB_OVERLAY_LIST} for each block of {@link #MOB_OVERLAY_SCAN} where mobs can spawn. + */ + private static void compileMobOverlayList(MobOverlayStyle style, long worldTicks) { + MOB_OVERLAY_LIST.beginCompile(MOB_OVERLAY_SCAN, style, worldTicks); + final float alpha = style.computeAlpha(); + final Tessellator tess = Tessellator.instance; + tess.startDrawing(style.glMode); + final int span = MOB_OVERLAY_SCAN.getSpan(); + for (int i = 0; i < span; i++) { + for (int j = 0; j < span; j++) { + for (int k = 0; k < MOB_OVERLAY_SCAN.getHeight(); k++) { + if (MOB_OVERLAY_SCAN.readSpawnMode(i, k, j) == 0) continue; + + MARKED_FACE.moveTo(i, k + MOB_OVERLAY_SCAN.readOverlayYOffset(i, k, j), j); + loadNeighbourModes(i, k, j); + MARKED_FACE.applyColor(style.colouring, alpha); + style.addVertices(MARKED_FACE); + } + } + } + tess.draw(); + MOB_OVERLAY_LIST.endCompile(); + } + + private static void beginMobOverlayDraw(MobOverlayStyle style) { + final ResourceLocation texture = style.texture; + if (texture == null) { + GL11.glDisable(GL11.GL_TEXTURE_2D); + } else { + GL11.glEnable(GL11.GL_TEXTURE_2D); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + } GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_LIGHTING); GL11.glLineWidth(1.5F); + // the outline of `MobOverlayStyle.CONNECTED` lies in the plane of the tint. With depth writes on, the depth + // test discards most of the outline + GL11.glDepthMask(false); + } - int curSpawnMode = 2; - - World world = entity.worldObj; - int x1 = (int) entity.posX - intOffsetX; - int z1 = (int) entity.posZ - intOffsetZ; - int y1 = (int) MathHelper.clip(entity.posY, 16, world.getHeight() - 16) - intOffsetY; - - final Tessellator tess = Tessellator.instance; - tess.startDrawing(GL11.GL_LINES); - tess.setColorOpaque(255, 0, 0); - - for (int i = 0; i <= 32; i++) { - int x = x1 - 16 + i; - for (int j = 0; j <= 32; j++) { - int z = z1 - 16 + j; - int cacheIndex = (i * 33 + j) * 33; - - for (int k = 0; k <= 32; k++) { - int y = y1 - 16 + k; - int spawnMode = mobSpawnCache[cacheIndex + k]; - if (spawnMode == 0) { - continue; - } else if (spawnMode == -1) { - break; - } - - if (spawnMode != curSpawnMode) { - if (spawnMode == 1) { - tess.setColorOpaque(255, 255, 0); - } else { - tess.setColorOpaque(255, 0, 0); - } - curSpawnMode = spawnMode; - } - - double yOff = getOverlayYOffset(world, x + intOffsetX, y + intOffsetY, z + intOffsetZ); - - tess.addVertex(x, y + yOff, z); - tess.addVertex(x + 1, y + yOff, z + 1); - tess.addVertex(x + 1, y + yOff, z); - tess.addVertex(x, y + yOff, z + 1); - } + private static void loadNeighbourModes(int i, int k, int j) { + final int span = MOB_OVERLAY_SCAN.getSpan(); + for (int offsetX = -1; offsetX <= 1; offsetX++) { + for (int offsetZ = -1; offsetZ <= 1; offsetZ++) { + final int neighbourI = i + offsetX; + final int neighbourJ = j + offsetZ; + final boolean isInScan = neighbourI >= 0 && neighbourI < span && neighbourJ >= 0 && neighbourJ < span; + final byte spawnMode = isInScan ? MOB_OVERLAY_SCAN.readSpawnMode(neighbourI, k, neighbourJ) + : MobOverlayFace.OUTSIDE_SCAN; + MARKED_FACE.setNeighbourMode(offsetX, offsetZ, spawnMode); } } + } - tess.draw(); + /** Undo the GL state changes of {@link #beginMobOverlayDraw}, except the texture binding. */ + private static void endMobOverlayDraw() { + GL11.glDepthMask(true); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); } - private static final Entity dummyEntity = new EntityPig(null); - private static final AxisAlignedBB aabb = AxisAlignedBB.getBoundingBox(0, 0, 0, 0, 0, 0); - - private static byte getSpawnMode(Chunk chunk, int x, int y, int z) { - if (y >= chunk.worldObj.getHeight()) { - return 0; - } - - if (chunk.getSavedLightValue(EnumSkyBlock.Block, x & 15, y, z & 15) >= 8 - || !SpawnerAnimals.canCreatureTypeSpawnAtLocation(EnumCreatureType.monster, chunk.worldObj, x, y, z)) { - return 0; - } - - aabb.minX = x + 0.2; - aabb.maxX = x + 0.8; - aabb.minY = y + 0.01; - aabb.maxY = y + 1.8; - aabb.minZ = z + 0.2; - aabb.maxZ = z + 0.8; - if (!chunk.worldObj.getCollidingBoundingBoxes(dummyEntity, aabb).isEmpty() - || chunk.worldObj.isAnyLiquid(aabb)) { - return 0; - } - - return (byte) (chunk.getSavedLightValue(EnumSkyBlock.Sky, x & 15, y, z & 15) >= 8 ? 1 : 2); - } - private static void renderChunkBounds(Entity entity, int intOffsetX, int intOffsetY, int intOffsetZ) { if (chunkOverlay == 0) return; diff --git a/src/main/java/codechicken/nei/moboverlay/MobOverlayDisplayList.java b/src/main/java/codechicken/nei/moboverlay/MobOverlayDisplayList.java new file mode 100644 index 00000000..3265d3cb --- /dev/null +++ b/src/main/java/codechicken/nei/moboverlay/MobOverlayDisplayList.java @@ -0,0 +1,65 @@ +package codechicken.nei.moboverlay; + +import net.minecraft.client.renderer.GLAllocation; + +import org.lwjgl.opengl.GL11; + +/** The mob spawn overlay quads, compiled into a GL display list. */ +public final class MobOverlayDisplayList { + + private int listId = -1; + private int modesVersion; + private MobOverlayStyle style; + private int minX; + private int minY; + private int minZ; + private long compiledTicks; + + /** + * Compiles after a {@link MobOverlayScan#getModesVersion} change are debounced to one per {@code MIN_COMPILE_TICKS} + * ticks, because the version changes several times per second while the player moves fast, and a compile runs for a + * millisecond or more. + */ + public boolean isCompileDue(int currentModesVersion, MobOverlayStyle currentStyle, long worldTicks) { + final int MIN_COMPILE_TICKS = 5; + if (listId < 0 || style != currentStyle) return true; + + // after a dimension change or a server switch, `worldTicks` can be lower than `compiledTicks` + final boolean isWaitOver = worldTicks - compiledTicks >= MIN_COMPILE_TICKS || worldTicks < compiledTicks; + return modesVersion != currentModesVersion && isWaitOver; + } + + /** + * Quad positions are relative to block ({@link MobOverlayScan#getMinX}, {@link MobOverlayScan#getMinY}, + * {@link MobOverlayScan#getMinZ}) of {@code scan}. + */ + public void beginCompile(MobOverlayScan scan, MobOverlayStyle newStyle, long worldTicks) { + if (listId < 0) listId = GLAllocation.generateDisplayLists(1); + modesVersion = scan.getModesVersion(); + style = newStyle; + minX = scan.getMinX(); + minY = scan.getMinY(); + minZ = scan.getMinZ(); + compiledTicks = worldTicks; + GL11.glNewList(listId, GL11.GL_COMPILE); + } + + public void endCompile() { + GL11.glEndList(); + } + + /** The model view matrix is relative to block ({@code cameraX}, {@code cameraY}, {@code cameraZ}). */ + public void draw(int cameraX, int cameraY, int cameraZ) { + GL11.glPushMatrix(); + GL11.glTranslated(minX - cameraX, minY - cameraY, minZ - cameraZ); + GL11.glCallList(listId); + GL11.glPopMatrix(); + } + + public void delete() { + if (listId < 0) return; + + GLAllocation.deleteDisplayLists(listId); + listId = -1; + } +} diff --git a/src/main/java/codechicken/nei/moboverlay/MobOverlayFace.java b/src/main/java/codechicken/nei/moboverlay/MobOverlayFace.java new file mode 100644 index 00000000..030140b7 --- /dev/null +++ b/src/main/java/codechicken/nei/moboverlay/MobOverlayFace.java @@ -0,0 +1,88 @@ +package codechicken.nei.moboverlay; + +import net.minecraft.client.renderer.Tessellator; + +/** Vertex builder for one block's top face in the mob spawn overlay. */ +public final class MobOverlayFace { + + public static final byte OUTSIDE_SCAN = -2; + + private static final int NEIGHBOURHOOD_SIZE = 3; + + private final byte[] neighbourModes = new byte[NEIGHBOURHOOD_SIZE * NEIGHBOURHOOD_SIZE]; + private double x; + private double y; + private double z; + + /** {@code (x, y, z)} is the north-west corner of the block's top face. */ + public void moveTo(double x, double y, double z) { + this.x = x; + this.y = y; + this.z = z; + } + + public void setNeighbourMode(int offsetX, int offsetZ, byte spawnMode) { + neighbourModes[indexNeighbour(offsetX, offsetZ)] = spawnMode; + } + + public void applyColor(MobOverlayStyle.Colouring colouring, float alpha) { + final boolean isNightOnly = neighbourModes[indexNeighbour(0, 0)] == MobOverlayScan.NIGHT_ONLY; + final int rgb = switch (colouring) { + case OVERLAY -> isNightOnly ? 0xFFFF00 : 0xFF0000; + case STICKER -> isNightOnly ? 0xFFFFFF : 0xFF7373; + }; + Tessellator.instance.setColorRGBA_I(rgb, Math.round(alpha * 255)); + } + + public boolean isJoined(int offsetX, int offsetZ) { + final byte neighbourMode = neighbourModes[indexNeighbour(offsetX, offsetZ)]; + // no outline along the edge of the scan + return neighbourMode == neighbourModes[indexNeighbour(0, 0)] || neighbourMode == OUTSIDE_SCAN; + } + + public void addFullFace() { + addVertex(0, 0); + addVertex(0, 1); + addVertex(1, 1); + addVertex(1, 0); + } + + /** Add one cell of a 3 x 3 grid over the face. The outer rows and columns of the grid are {@code width} wide. */ + public void addCell(int offsetX, int offsetZ, double width) { + final double west = computeCellStart(offsetX, width); + final double east = 1 - computeCellStart(-offsetX, width); + final double north = computeCellStart(offsetZ, width); + final double south = 1 - computeCellStart(-offsetZ, width); + addVertex(west, north); + addVertex(west, south); + addVertex(east, south); + addVertex(east, north); + } + + /** The texture is upright to a player facing north (-z). */ + public void addTexturedFace() { + addTexturedVertex(0, 0); + addTexturedVertex(0, 1); + addTexturedVertex(1, 1); + addTexturedVertex(1, 0); + } + + /** @param offsetX 0 at the west edge, 1 at the east edge */ + public void addVertex(double offsetX, double offsetZ) { + Tessellator.instance.addVertex(x + offsetX, y, z + offsetZ); + } + + private void addTexturedVertex(double offsetX, double offsetZ) { + Tessellator.instance.setTextureUV(offsetX, offsetZ); + addVertex(offsetX, offsetZ); + } + + private static int indexNeighbour(int offsetX, int offsetZ) { + return (offsetX + 1) * NEIGHBOURHOOD_SIZE + offsetZ + 1; + } + + private static double computeCellStart(int offset, double width) { + if (offset < 0) return 0; + return offset == 0 ? width : 1 - width; + } +} diff --git a/src/main/java/codechicken/nei/moboverlay/MobOverlayScan.java b/src/main/java/codechicken/nei/moboverlay/MobOverlayScan.java new file mode 100644 index 00000000..72599001 --- /dev/null +++ b/src/main/java/codechicken/nei/moboverlay/MobOverlayScan.java @@ -0,0 +1,421 @@ +package codechicken.nei.moboverlay; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EnumCreatureType; +import net.minecraft.entity.passive.EntityPig; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.IWorldAccess; +import net.minecraft.world.SpawnerAnimals; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; + +import codechicken.lib.math.MathHelper; + +/** + * Spawn modes, and the tops of flat blocks such as carpets, in a box around the player. The spawn modes are from + * {@link Column#getSpawnMode}: 0 for no spawns, 1 for night only and 2 for any time. The box moves with the player once + * the player is a few blocks from the box's centre, and {@link #update} scans only the blocks that enter the box. + * {@link #update} rescans the column of a block or light change on the next tick. On each tick, {@link #update} also + * rescans a slice of the columns, for changes with no block update, such as a boat that moves into the box. + */ +public final class MobOverlayScan { + + public static final byte NIGHT_ONLY = 1; + public static final int MIN_RADIUS = 8; + public static final int MAX_RADIUS = 64; + public static final int DEFAULT_RADIUS = 32; + public static final int MIN_VERTICAL_RADIUS = 4; + public static final int MAX_VERTICAL_RADIUS = 64; + public static final int DEFAULT_VERTICAL_RADIUS = 16; + private static final int RECENTRE_DISTANCE = 4; + private static final int VERTICAL_RECENTRE_DISTANCE = 2; + private static final int RESCAN_TICKS = 40; + private static final int SPAWN_MODE_MASK = 3; + private static final int COVER_TOP_SHIFT = 2; + private static final int COVER_TOP_STEPS = 32; + + private final IWorldAccess changeListener = new ChangeListener(); + private final Column column = new Column(); + private int radius; + private int verticalRadius; + private int span; + private int height; + // a ring buffer over the box, indexed by `findCell()`. A cell has the spawn mode in the bits of `SPAWN_MODE_MASK`, + // and `Column.readCoverTop()` shifted left by `COVER_TOP_SHIFT` + private byte[] modes = new byte[0]; + // indexed by `findColumn(x, z)` + private boolean[] dirty = new boolean[0]; + private boolean hasDirtyColumns; + private int minX; + private int minY; + private int minZ; + // the slice rescan of `update()` continues from this column, numbered `(x - minX) * span + (z - minZ)` + private int nextRescanColumn; + private int modesVersion; + private boolean hasModes; + private long scannedTick; + // world of `modes`, with `changeListener` added + private World scannedWorld; + + public void clear() { + if (scannedWorld == null && span == 0) return; + + if (scannedWorld != null) scannedWorld.removeWorldAccess(changeListener); + radius = 0; + verticalRadius = 0; + span = 0; + height = 0; + modes = new byte[0]; + dirty = new boolean[0]; + hasModes = false; + scannedWorld = null; + // `Chunk.worldObj` references the world + column.chunk = null; + } + + /** + * Scan every column in this call after {@link #clear}, a change of either radius, a world change, or a move of + * {@link #getSpan} blocks or more across or {@link #getHeight} blocks or more up or down. {@code newRadius} is + * clamped between {@link #MIN_RADIUS} and {@link #MAX_RADIUS}, and {@code newVerticalRadius} between + * {@link #MIN_VERTICAL_RADIUS} and {@link #MAX_VERTICAL_RADIUS}. + */ + public void update(Entity entity, int newRadius, int newVerticalRadius) { + final World world = entity.worldObj; + final int clampedRadius = (int) MathHelper.clip(newRadius, MIN_RADIUS, MAX_RADIUS); + final int clampedVerticalRadius = (int) MathHelper + .clip(newVerticalRadius, MIN_VERTICAL_RADIUS, MAX_VERTICAL_RADIUS); + if (radius != clampedRadius || verticalRadius != clampedVerticalRadius) { + resize(clampedRadius, clampedVerticalRadius); + } + final int centreX = MathHelper.floor_double(entity.posX); + final int centreY = (int) MathHelper.clip(entity.posY, verticalRadius, world.getHeight() - verticalRadius); + final int centreZ = MathHelper.floor_double(entity.posZ); + final boolean isNearBox = Math.abs(centreX - radius - minX) < span && Math.abs(centreZ - radius - minZ) < span + && Math.abs(centreY - verticalRadius - minY) < height; + if (!(hasModes && world == scannedWorld && isNearBox)) { + if (world != scannedWorld) watchWorld(world); + scanFullBox(centreX, centreY, centreZ); + return; + } + + final long worldTicks = world.getTotalWorldTime(); + if (worldTicks == scannedTick) return; + + scannedTick = worldTicks; + boolean isChanged = moveBox(centreX, centreY, centreZ); + if (hasDirtyColumns) isChanged |= rescanDirtyColumns(); + isChanged |= rescanSlice(); + if (isChanged) modesVersion++; + } + + /** The version changes when a spawn mode or the top of a flat block changes, or the box moves. */ + public int getModesVersion() { + return modesVersion; + } + + public int getSpan() { + return span; + } + + public int getHeight() { + return height; + } + + public int getMinX() { + return minX; + } + + public int getMinY() { + return minY; + } + + public int getMinZ() { + return minZ; + } + + /** {@code i} and {@code j} are from 0 to {@link #getSpan}, and {@code k} is from 0 to {@link #getHeight}. */ + public byte readSpawnMode(int i, int k, int j) { + return (byte) (modes[findCell(minX + i, minY + k, minZ + j)] & SPAWN_MODE_MASK); + } + + /** + * Height of the overlay above the bottom of the block, so that a flat block such as a carpet does not cover the + * overlay. The indices are those of {@link #readSpawnMode}. + */ + public double readOverlayYOffset(int i, int k, int j) { + final double OVERLAY_GAP = 0.02; + final int coverTopSteps = modes[findCell(minX + i, minY + k, minZ + j)] >> COVER_TOP_SHIFT; + return (double) coverTopSteps / COVER_TOP_STEPS + OVERLAY_GAP; + } + + private void resize(int newRadius, int newVerticalRadius) { + radius = newRadius; + verticalRadius = newVerticalRadius; + span = 2 * newRadius + 1; + height = 2 * newVerticalRadius + 1; + modes = new byte[span * span * height]; + dirty = new boolean[span * span]; + hasModes = false; + nextRescanColumn = 0; + } + + private void scanFullBox(int centreX, int centreY, int centreZ) { + minX = centreX - radius; + minY = centreY - verticalRadius; + minZ = centreZ - radius; + for (int x = minX; x < minX + span; x++) { + for (int z = minZ; z < minZ + span; z++) { + scanColumn(x, z); + } + } + hasModes = true; + modesVersion++; + scannedTick = scannedWorld.getTotalWorldTime(); + } + + private void watchWorld(World world) { + if (scannedWorld != null) scannedWorld.removeWorldAccess(changeListener); + world.addWorldAccess(changeListener); + scannedWorld = world; + } + + /** @return whether the box moved */ + private boolean moveBox(int centreX, int centreY, int centreZ) { + boolean isMoved = false; + final int offsetX = centreX - radius - minX; + if (Math.abs(offsetX) > RECENTRE_DISTANCE) { + final int enteringX = offsetX > 0 ? minX + span : minX + offsetX; + minX += offsetX; + for (int x = enteringX; x < enteringX + Math.abs(offsetX); x++) { + for (int z = minZ; z < minZ + span; z++) { + scanColumn(x, z); + } + } + isMoved = true; + } + + final int offsetZ = centreZ - radius - minZ; + if (Math.abs(offsetZ) > RECENTRE_DISTANCE) { + final int enteringZ = offsetZ > 0 ? minZ + span : minZ + offsetZ; + minZ += offsetZ; + for (int x = minX; x < minX + span; x++) { + for (int z = enteringZ; z < enteringZ + Math.abs(offsetZ); z++) { + scanColumn(x, z); + } + } + isMoved = true; + } + + final int offsetY = centreY - verticalRadius - minY; + if (Math.abs(offsetY) > VERTICAL_RECENTRE_DISTANCE) { + final int enteringY = offsetY > 0 ? minY + height : minY + offsetY; + minY += offsetY; + for (int x = minX; x < minX + span; x++) { + for (int z = minZ; z < minZ + span; z++) { + column.moveTo(x, z); + column.scan(enteringY, enteringY + Math.abs(offsetY)); + } + } + isMoved = true; + } + return isMoved; + } + + private boolean rescanDirtyColumns() { + hasDirtyColumns = false; + boolean isChanged = false; + for (int x = minX; x < minX + span; x++) { + for (int z = minZ; z < minZ + span; z++) { + if (dirty[findColumn(x, z)]) isChanged |= scanColumn(x, z); + } + } + return isChanged; + } + + private boolean rescanSlice() { + final int columnCount = span * span; + final int sliceEnd = Math.min(columnCount, nextRescanColumn + (columnCount + RESCAN_TICKS - 1) / RESCAN_TICKS); + boolean isChanged = false; + for (; nextRescanColumn < sliceEnd; nextRescanColumn++) { + final int x = minX + nextRescanColumn / span; + final int z = minZ + nextRescanColumn % span; + isChanged |= scanColumn(x, z); + } + if (nextRescanColumn >= columnCount) nextRescanColumn = 0; + return isChanged; + } + + /** @return whether a spawn mode or the top of a flat block changed */ + private boolean scanColumn(int x, int z) { + column.moveTo(x, z); + dirty[findColumn(x, z)] = false; + return column.scan(minY, minY + height); + } + + private int findColumn(int x, int z) { + return Math.floorMod(x, span) * span + Math.floorMod(z, span); + } + + private int findCell(int x, int y, int z) { + return findColumn(x, z) * height + Math.floorMod(y, height); + } + + /** + * {@link #moveTo} reads the chunk, the height map and the biome of a column, and {@link #scan} reads the column's + * blocks. + */ + private final class Column { + + private final Entity dummyEntity = new EntityPig(null); + private final AxisAlignedBB spawnBox = AxisAlignedBB.getBoundingBox(0, 0, 0, 0, 0, 0); + private int x; + private int z; + private Chunk chunk; + private int topY; + private boolean canBiomeSpawn; + + private void moveTo(int newX, int newZ) { + x = newX; + z = newZ; + final BiomeGenBase biome = scannedWorld.getBiomeGenForCoords(x, z); + canBiomeSpawn = !biome.getSpawnableList(EnumCreatureType.monster).isEmpty() + && biome.getSpawningChance() > 0; + chunk = scannedWorld.getChunkFromBlockCoords(x, z); + // on the client, `Chunk.generateHeightMap()` never tests the top layer of the highest non-empty section. + // `getHeightValue()` can then be below a block on that layer, so test that layer here + final int topLayerY = chunk.getTopFilledSegment() + 15; + final boolean isTopLayerFilled = !chunk.isEmpty() && chunk.func_150808_b(x & 15, topLayerY, z & 15) != 0; + final int heightValue = isTopLayerFilled ? topLayerY + 1 : scannedWorld.getHeightValue(x, z); + // `getHeightValue()` is the height above the highest block with a light opacity above 0. A snow layer and a + // hopper have a light opacity of 0, and a mob can spawn on top of a full snow block or a hopper, so scan + // one block above the height value + topY = Math.min(scannedWorld.getHeight() - 1, heightValue + 1); + } + + /** @return whether a spawn mode or the top of a flat block changed */ + private boolean scan(int fromY, int toY) { + boolean isChanged = false; + for (int y = fromY; y < toY; y++) { + final int spawnMode = canBiomeSpawn && y <= topY ? getSpawnMode(y) : 0; + final byte cellValue = (byte) (spawnMode == 0 ? 0 : spawnMode | (readCoverTop(y) << COVER_TOP_SHIFT)); + final int cell = findCell(x, y, z); + isChanged |= modes[cell] != cellValue; + modes[cell] = cellValue; + } + return isChanged; + } + + /** The spawn mode of the block at height {@code y} in this column. */ + private byte getSpawnMode(int y) { + if (y >= chunk.worldObj.getHeight()) { + return 0; + } + + if (chunk.getSavedLightValue(EnumSkyBlock.Block, x & 15, y, z & 15) >= 8 || !SpawnerAnimals + .canCreatureTypeSpawnAtLocation(EnumCreatureType.monster, chunk.worldObj, x, y, z)) { + return 0; + } + + // the size of a zombie, a creeper and a skeleton that is not a wither skeleton. A taller or wider monster, + // such as an enderman or a spider, needs more room + final double MOB_WIDTH = 0.6; + final double MOB_HEIGHT = 1.8; + spawnBox.minX = x + 0.5 - MOB_WIDTH / 2; + spawnBox.maxX = x + 0.5 + MOB_WIDTH / 2; + spawnBox.minY = y; + spawnBox.maxY = y + MOB_HEIGHT; + spawnBox.minZ = z + 0.5 - MOB_WIDTH / 2; + spawnBox.maxZ = z + 0.5 + MOB_WIDTH / 2; + if (!chunk.worldObj.getCollidingBoundingBoxes(dummyEntity, spawnBox).isEmpty() + || chunk.worldObj.isAnyLiquid(spawnBox)) { + return 0; + } + + return (byte) (chunk.getSavedLightValue(EnumSkyBlock.Sky, x & 15, y, z & 15) >= 8 ? 1 : 2); + } + + /** + * The top of the block at height {@code y}, in fractions of a block with {@link MobOverlayScan#COVER_TOP_STEPS} + * as the denominator, or 0 for a tall block. + */ + private int readCoverTop(int y) { + final double MAX_COVER_TOP = 0.25; + final Block block = chunk.getBlock(x & 15, y, z & 15); + block.setBlockBoundsBasedOnState(chunk.worldObj, x, y, z); + final double top = block.getBlockBoundsMaxY(); + // a mark on the bounds of a plant or a sloped rail would float above most of the block. Keep the mark at + // the floor for a tall block + return top > MAX_COVER_TOP ? 0 : (int) Math.ceil(top * COVER_TOP_STEPS); + } + } + + /** Marks the columns of the block and light changes in {@link #scannedWorld}. */ + private final class ChangeListener implements IWorldAccess { + + @Override + public void markBlockForUpdate(int x, int y, int z) { + markChanged(x, y, z); + } + + @Override + public void markBlockForRenderUpdate(int x, int y, int z) { + markChanged(x, y, z); + } + + @Override + public void markBlockRangeForRenderUpdate(int fromX, int fromY, int fromZ, int toX, int toY, int toZ) { + for (int x = Math.max(fromX, minX); x <= Math.min(toX, minX + span - 1); x++) { + for (int z = Math.max(fromZ, minZ); z <= Math.min(toZ, minZ + span - 1); z++) { + markColumn(x, z); + } + } + } + + @Override + public void playSound(String soundName, double x, double y, double z, float volume, float pitch) {} + + @Override + public void playSoundToNearExcept(EntityPlayer player, String soundName, double x, double y, double z, + float volume, float pitch) {} + + @Override + public void spawnParticle(String particleName, double x, double y, double z, double velocityX, double velocityY, + double velocityZ) {} + + @Override + public void onEntityCreate(Entity entity) {} + + @Override + public void onEntityDestroy(Entity entity) {} + + @Override + public void playRecord(String recordName, int x, int y, int z) {} + + @Override + public void broadcastSound(int soundId, int x, int y, int z, int data) {} + + @Override + public void playAuxSFX(EntityPlayer player, int sfxType, int x, int y, int z, int data) {} + + @Override + public void destroyBlockPartially(int breakerId, int x, int y, int z, int progress) {} + + @Override + public void onStaticEntitiesChanged() {} + + private void markChanged(int x, int y, int z) { + // spawn modes depend on the block below and the block above + final boolean isInBox = x >= minX && x < minX + span && z >= minZ && z < minZ + span; + if (isInBox && y >= minY - 1 && y <= minY + height) markColumn(x, z); + } + + private void markColumn(int x, int z) { + dirty[findColumn(x, z)] = true; + hasDirtyColumns = true; + } + } +} diff --git a/src/main/java/codechicken/nei/moboverlay/MobOverlayStyle.java b/src/main/java/codechicken/nei/moboverlay/MobOverlayStyle.java new file mode 100644 index 00000000..10117175 --- /dev/null +++ b/src/main/java/codechicken/nei/moboverlay/MobOverlayStyle.java @@ -0,0 +1,135 @@ +package codechicken.nei.moboverlay; + +import java.util.Locale; +import java.util.StringJoiner; + +import javax.annotation.Nullable; + +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +/** + * Each style is a mark drawn on every block where mobs can spawn. {@code world.overlays.mobOverlayStyle} is saved as + * {@link #formatName()}. + */ +public enum MobOverlayStyle { + + /** NEI's original cross from corner to corner. */ + X(GL11.GL_LINES) { + + @Override + public void addVertices(MobOverlayFace face) { + face.addVertex(0, 0); + face.addVertex(1, 1); + face.addVertex(1, 0); + face.addVertex(0, 1); + } + }, + + /** + * A light tint, with a stronger outline around each area of one spawn mode, like a connected texture. + */ + CONNECTED(GL11.GL_QUADS) { + + @Override + public void addVertices(MobOverlayFace face) { + final double OUTLINE_WIDTH = 1.0 / 16; + face.addFullFace(); + face.applyColor(Colouring.OVERLAY, MARK_ALPHA); + for (int offsetX = -1; offsetX <= 1; offsetX++) { + for (int offsetZ = -1; offsetZ <= 1; offsetZ++) { + // a corner cell is drawn when either edge next to the corner is outlined, and on an inside corner + final boolean isOutline = !(face.isJoined(offsetX, offsetZ) && face.isJoined(offsetX, 0) + && face.isJoined(0, offsetZ)); + if (isOutline) face.addCell(offsetX, offsetZ, OUTLINE_WIDTH); + } + } + } + }, + + /** A small square in the middle of the block, with no tint. */ + SQUARE(GL11.GL_QUADS) { + + @Override + public void addVertices(MobOverlayFace face) { + final double CENTRE = 0.5; + final double HALF_SIDE = 7.0 / 64; + face.addVertex(CENTRE - HALF_SIDE, CENTRE - HALF_SIDE); + face.addVertex(CENTRE - HALF_SIDE, CENTRE + HALF_SIDE); + face.addVertex(CENTRE + HALF_SIDE, CENTRE + HALF_SIDE); + face.addVertex(CENTRE + HALF_SIDE, CENTRE - HALF_SIDE); + } + }, + + /** The pufferfish sticker. */ + PUFFERFISH("pufferfish", Colouring.STICKER) { + + @Override + public void addVertices(MobOverlayFace face) { + face.addTexturedFace(); + } + }; + + public static final MobOverlayStyle DEFAULT = CONNECTED; + + private static final float TINT_ALPHA = 0.15F; + // the square and the outline cover a small part of the block and need more opacity than the tint to stay visible + private static final float MARK_ALPHA = 0.45F; + + public final int glMode; + @Nullable + public final ResourceLocation texture; + public final Colouring colouring; + + MobOverlayStyle(int glMode) { + this.glMode = glMode; + this.texture = null; + this.colouring = Colouring.OVERLAY; + } + + MobOverlayStyle(String textureName, Colouring colouring) { + this.glMode = GL11.GL_QUADS; + this.texture = new ResourceLocation("nei", "textures/overlay/" + textureName + ".png"); + this.colouring = colouring; + } + + /** Case-insensitive. Returns {@link #DEFAULT} for an unknown name. */ + public static MobOverlayStyle parseStyle(String rawStyle) { + for (MobOverlayStyle candidate : values()) { + if (candidate.formatName().equalsIgnoreCase(rawStyle)) return candidate; + } + return DEFAULT; + } + + /** @return the {@link #formatName} of every style, separated by commas */ + public static String formatAllNames() { + final StringJoiner names = new StringJoiner(", "); + for (MobOverlayStyle style : values()) { + names.add(style.formatName()); + } + return names.toString(); + } + + public String formatName() { + return name().toLowerCase(Locale.ROOT); + } + + public float computeAlpha() { + return switch (this) { + case CONNECTED -> TINT_ALPHA; + case SQUARE -> MARK_ALPHA; + // opaque lines for X, and the alpha of the PNG for PUFFERFISH + case X, PUFFERFISH -> 1.0F; + }; + } + + public abstract void addVertices(MobOverlayFace face); + + public enum Colouring { + /** Yellow where mobs spawn only at night, red where mobs spawn at any time. */ + OVERLAY, + /** The texture's colours, tinted red where mobs spawn at any time. */ + STICKER + } +} diff --git a/src/main/resources/assets/nei/lang/en_US.lang b/src/main/resources/assets/nei/lang/en_US.lang index bdc1a751..5e879686 100644 --- a/src/main/resources/assets/nei/lang/en_US.lang +++ b/src/main/resources/assets/nei/lang/en_US.lang @@ -563,6 +563,15 @@ nei.options.world.overlays=Overlays Settings nei.options.world.overlays.lock=Lock overlays between dimensions nei.options.world.overlays.lock.true=Enabled nei.options.world.overlays.lock.false=Disabled +nei.options.world.overlays.mobOverlayStyle=Mob Spawn Overlay Style +nei.options.world.overlays.mobOverlayStyle.x=X +nei.options.world.overlays.mobOverlayStyle.connected=Connected +nei.options.world.overlays.mobOverlayStyle.square=Square +nei.options.world.overlays.mobOverlayStyle.pufferfish=Pufferfish +nei.options.world.overlays.mobOverlayRadius=Mob Spawn Overlay Horizontal Radius +nei.options.world.overlays.mobOverlayRadius.tip=Horizontal block radius scanned around you. Range 8-64 blocks +nei.options.world.overlays.mobOverlayVerticalRadius=Mob Spawn Overlay Vertical Radius +nei.options.world.overlays.mobOverlayVerticalRadius.tip=Blocks scanned above and below you. Range 4-64 blocks nei.options.tools=Tools nei.options.tools.export_configs=Default Config Files diff --git a/src/main/resources/assets/nei/textures/overlay/pufferfish.png b/src/main/resources/assets/nei/textures/overlay/pufferfish.png new file mode 100644 index 0000000000000000000000000000000000000000..d26ffbff1e21afa53f3ca6c7a0cc5741060605eb GIT binary patch literal 1970 zcmV;j2Tk~iP)dj?Te^#o%>Uaw zbKdhl|L1-l=%R}*y6B>dE?#=*)YcELn_=@AL+}I;D1sWAX^_C^xxB~IY^dl zh>n_sIocOU^#N%-D2G&J&))nXS=>DEck=->Iz5r2)gzbqKy`NukMC4>P!|chs(MNX|DF#XuWEk&} z5C(g}dx+cnFAN0c88~rSNA%w7eyN!;IL&d*2I=%T_kH7PnKO@Q?QE6m+CyHjd3TYM z7A5pWN~_&5lUHz=V2se$qvX<&Tcbz{BWutrxBQv}i_bGuA!|%PGC8-QCDpakS|?gs zst1s{?c1R)7;57jhzOM)K@mg(Y#1S7i9E}&{jbHEfULHiAg^OhM!R7s6f^Rqg{zH{ z*PmtGjVoo&lfAT5W!G=_SD)KgqNkmlViEc)7O@72LJGZA3Y7s&p$8qEK{(~~7<@a?LsCZwbTq^Ur#eHBr zNjt`S2jV&uvXn*3`dPfZ#O6o#kWKFemxJbLV#%X2aczWbCZ*kKbFALWm#^%2J6_*= zSR{^`$oBjDHRzpBsoI0fJjX5{;H1mTJh5>vuGMK6Y0@dSQBQ@mkfVV`^9*$vVQ<78 zC!b5bHqA_&ae4TC=B49&}oMc=(c(<$!y>{uHg$lV=6OQWbRupxljaEfE>-6xYi`Jb5OYHXCd{pkDXIFt5!|Uu18wqqZEgaLwc*kjS2pC%3WOd z*-O=BIl}i(XLIA1)w-wyMe~z*rR~^<;g%c4<)FD}lHYcF|B;q@9 zE>^$@Ht@_zjvNZ#`kd(Cd}YBPyy;Yk7M_Yx#ii{|u9!}k8Ee5i6bDZ6zEi!j#%>C< zK$Z0m!{a+b^3*ZXC~(uQ?YW<|#{Pir{2lt#-X1b3pjssGkU#rRoDp*O?{*S=?(nMM zz&nSc7;CY}HvxtqDp2g}h00K89Pu91)2h!_H@mZzR3DP(NB~@Sb6sYVGPwz;$I8}GL#j&d9chxGS%#~Rp~iwjvp$0% zA)VPtmga1J0=AA?GK43$LSF!*%>#8l91=%0{f^v&CJw&&6GJQW43r$kTCz-u0$6m6 zGCkEKs+1`1Gnvm@Sd;LNza}IZY}r}B1W?4Au$9E(r*FdI$=z>EQ+{h9u3|S+iuBA&wnj_|o+q0%NPu zp$q0{);cgx&QYn}chI>{uc+#9Pm?T8>01DCY#1B}K!u_W2uy|tB=C%m873wjuO7C< zFx+v%IE%`wt0E%aN(TQ{PCF>(E#Pk}`kA0_?Fbomkr+1CZ74IL^Yd%=x3%B;u zQz_t`P;VsUF6Y|M)H&w-+0|iIki1|Wy8Mzs1=w?Mr0;vrd|iIYfL^vw_B{Ff&C6>S z{NGlmtw)FTf328aAq(x(Us)UYF1qNVi!Qq8;{S|)0f9HQq}2M}hyVZp07*qoM6N<$ Ef)ww_Gynhq literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/nei/textures/overlay/pufferfish.png.mcmeta b/src/main/resources/assets/nei/textures/overlay/pufferfish.png.mcmeta new file mode 100644 index 00000000..96fb0a20 --- /dev/null +++ b/src/main/resources/assets/nei/textures/overlay/pufferfish.png.mcmeta @@ -0,0 +1,6 @@ +{ + "texture": { + "blur": false, + "clamp": true + } +}