diff options
author | Linnea Gräf <nea@nea.moe> | 2024-03-13 16:33:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 16:33:43 +0100 |
commit | 18e15a2a8ab944fb3d0d81767ae50f8fe7954537 (patch) | |
tree | b6f09fb364cd210e659778ba870526bce7364652 /src/main/java | |
parent | 1a2c5501ce22254f85c588cc38ad20d1611eb231 (diff) | |
download | NotEnoughUpdates-18e15a2a8ab944fb3d0d81767ae50f8fe7954537.tar.gz NotEnoughUpdates-18e15a2a8ab944fb3d0d81767ae50f8fe7954537.tar.bz2 NotEnoughUpdates-18e15a2a8ab944fb3d0d81767ae50f8fe7954537.zip |
Fix dungeon map not showing when holding a bow (#1047)
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java | 15 |
1 files changed, 12 insertions, 3 deletions
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<String, Vec4b> decorations = null; |