diff options
author | Kevin <92656833+kevinthegreat1@users.noreply.github.com> | 2024-02-18 03:22:03 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 03:22:03 -0500 |
commit | 59774d9353efefe47eda7cb250fbcddd059c2fdb (patch) | |
tree | 212c342d814ca5836806752d05ce767167bd19de /src/main/java/de | |
parent | 177656cbbb6dc0f25125371e6f600e053d8ca1bc (diff) | |
download | Skyblocker-59774d9353efefe47eda7cb250fbcddd059c2fdb.tar.gz Skyblocker-59774d9353efefe47eda7cb250fbcddd059c2fdb.tar.bz2 Skyblocker-59774d9353efefe47eda7cb250fbcddd059c2fdb.zip |
Check all door blocks and fix fairy room door (#536)
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java | 4 | ||||
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonMapUtils.java | 15 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java index 32f0b7e3..a207ddc7 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonManager.java @@ -563,7 +563,9 @@ public class DungeonManager { if (room != null && currentRoom != room) { if (currentRoom != null && room.getType() == Room.Type.FAIRY) { currentRoom.nextRoom = room; - room.keyFound = currentRoom.keyFound; + if (currentRoom.keyFound) { + room.keyFound = true; + } } currentRoom = room; } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonMapUtils.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonMapUtils.java index b12bba62..8e0073f7 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonMapUtils.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/DungeonMapUtils.java @@ -3,12 +3,12 @@ package de.hysky.skyblocker.skyblock.dungeon.secrets; import com.google.gson.JsonObject; import it.unimi.dsi.fastutil.ints.IntSortedSet; import it.unimi.dsi.fastutil.objects.ObjectIntPair; -import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.MapColor; import net.minecraft.item.map.MapIcon; import net.minecraft.item.map.MapState; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; import net.minecraft.world.World; @@ -286,14 +286,13 @@ public class DungeonMapUtils { } private static boolean hasWitherOrBloodDoor(World world, Vector2ic pos, BlockPos.Mutable doorPos) { - return isWitherOrBloodDoor(world, doorPos.set(pos.x() - 2, 69, pos.y() + 14)) || - isWitherOrBloodDoor(world, doorPos.set(pos.x() + 14, 69, pos.y() - 2)) || - isWitherOrBloodDoor(world, doorPos.set(pos.x() + 14, 69, pos.y() + 30)) || - isWitherOrBloodDoor(world, doorPos.set(pos.x() + 30, 69, pos.y() + 14)); + return isWitherOrBloodDoor(world, doorPos.set(pos.x() + 1, 72, pos.y() + 17)) || + isWitherOrBloodDoor(world, doorPos.set(pos.x() + 17, 72, pos.y() + 1)) || + isWitherOrBloodDoor(world, doorPos.set(pos.x() + 17, 72, pos.y() + 33)) || + isWitherOrBloodDoor(world, doorPos.set(pos.x() + 33, 72, pos.y() + 17)); } - private static boolean isWitherOrBloodDoor(World world, BlockPos pos) { - BlockState state = world.getBlockState(pos); - return state.isOf(Blocks.COAL_BLOCK) || state.isOf(Blocks.RED_TERRACOTTA); + private static boolean isWitherOrBloodDoor(World world, BlockPos.Mutable pos) { + return world.getStatesInBox(Box.enclosing(pos, pos.move(-3, -3, -3))).allMatch(state -> state.isOf(Blocks.COAL_BLOCK) || state.isOf(Blocks.RED_TERRACOTTA)); } } |