From 18e15a2a8ab944fb3d0d81767ae50f8fe7954537 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 13 Mar 2024 16:33:43 +0100 Subject: Fix dungeon map not showing when holding a bow (#1047) --- .../moulberry/notenoughupdates/dungeons/DungeonMap.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java index 1e0c8c8e..291ab562 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java @@ -25,6 +25,7 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe; import io.github.moulberry.notenoughupdates.core.BackgroundBlur; import io.github.moulberry.notenoughupdates.core.config.Position; +import io.github.moulberry.notenoughupdates.util.ItemUtils; import io.github.moulberry.notenoughupdates.util.NEUResourceManager; import io.github.moulberry.notenoughupdates.util.SidebarUtil; import io.github.moulberry.notenoughupdates.util.SpecialColour; @@ -503,8 +504,10 @@ public class DungeonMap { mapSizeX = borderSizeOption == 0 ? 90 : borderSizeOption == 1 ? 120 : borderSizeOption == 2 ? 160 : 240; } mapSizeY = mapSizeX; - int roomsSizeX = (maxRoomX - minRoomX) * (renderRoomSize + renderConnSize) + renderRoomSize + (isFloorOne ? getRenderRoomSize() : 0); - int roomsSizeY = (maxRoomY - minRoomY) * (renderRoomSize + renderConnSize) + renderRoomSize + (isEntrance ? getRenderRoomSize() : 0); + int roomsSizeX = (maxRoomX - minRoomX) * (renderRoomSize + renderConnSize) + renderRoomSize + + (isFloorOne ? getRenderRoomSize() : 0); + int roomsSizeY = (maxRoomY - minRoomY) * (renderRoomSize + renderConnSize) + renderRoomSize + + (isEntrance ? getRenderRoomSize() : 0); int mapCenterX = mapSizeX / 2; int mapCenterY = mapSizeY / 2; int scaleFactor = 8; @@ -1527,7 +1530,13 @@ public class DungeonMap { } ItemStack stack = Minecraft.getMinecraft().thePlayer.inventory.mainInventory[8]; - boolean holdingBow = stack != null && stack.getItem() == Items.arrow && colourMap != null; + boolean holdingBow = false; + if (stack != null) { + holdingBow |= stack.getItem() == Items.arrow; + String customname = ItemUtils.getDisplayName(stack.getTagCompound()); + holdingBow |= customname != null && customname.endsWith("Arrow"); + } + holdingBow &= colourMap != null; if (holdingBow || (stack != null && stack.getItem() instanceof ItemMap)) { Map decorations = null; -- cgit