diff options
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder')
3 files changed, 64 insertions, 10 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java index ffc9ca6d..5c6a7023 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java @@ -1,3 +1,21 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + package kr.syeyoung.dungeonsguide.dungeon.roomfinder; import com.google.common.collect.Sets; @@ -74,7 +92,7 @@ public class DungeonRoom { } @Getter - private PathFinder pathFinder; + private final PathFinder pathFinder; public ScheduledFuture<List<BlockPos>> createEntityPathTo(IBlockAccess blockaccess, Entity entityIn, BlockPos targetPos, float dist) { return asyncPathFinder.schedule(() -> { @@ -93,16 +111,16 @@ public class DungeonRoom { private static final ScheduledExecutorService asyncPathFinder = Executors.newScheduledThreadPool(2); @Getter - private NodeProcessorDungeonRoom nodeProcessorDungeonRoom; + private final NodeProcessorDungeonRoom nodeProcessorDungeonRoom; @Getter private final Map<String, Object> roomContext = new HashMap<String, Object>(); @AllArgsConstructor @Getter - public static enum RoomState { + public enum RoomState { DISCOVERED(0), COMPLETE_WITHOUT_SECRETS(0), FINISHED(0), FAILED(-14); - private int scoreModifier; + private final int scoreModifier; } private RoomProcessor roomProcessor; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java index 19f2fd3c..78765bd9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java @@ -1,3 +1,21 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + package kr.syeyoung.dungeonsguide.dungeon.roomfinder; import com.google.common.io.Files; @@ -18,9 +36,9 @@ import java.security.NoSuchAlgorithmException; import java.util.*; public class DungeonRoomInfoRegistry { - private static List<DungeonRoomInfo> registered = new ArrayList<DungeonRoomInfo>(); - private static Map<Short, List<DungeonRoomInfo>> shapeMap = new HashMap<Short, List<DungeonRoomInfo>>(); - private static Map<UUID, DungeonRoomInfo> uuidMap = new HashMap<UUID, DungeonRoomInfo>(); + private static final List<DungeonRoomInfo> registered = new ArrayList<DungeonRoomInfo>(); + private static final Map<Short, List<DungeonRoomInfo>> shapeMap = new HashMap<Short, List<DungeonRoomInfo>>(); + private static final Map<UUID, DungeonRoomInfo> uuidMap = new HashMap<UUID, DungeonRoomInfo>(); public static void register(DungeonRoomInfo dungeonRoomInfo) { if (dungeonRoomInfo == null) throw new NullPointerException("what the fak parameter is noll?"); @@ -42,7 +60,7 @@ public class DungeonRoomInfoRegistry { public static List<DungeonRoomInfo> getByShape(Short shape) { List<DungeonRoomInfo> dungeonRoomInfos = shapeMap.get(shape); - return dungeonRoomInfos == null ? Collections.<DungeonRoomInfo>emptyList() : dungeonRoomInfos; + return dungeonRoomInfos == null ? Collections.emptyList() : dungeonRoomInfos; } public static DungeonRoomInfo getByUUID(UUID uid) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java index cf846b20..d7bc1c64 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java @@ -1,3 +1,21 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + package kr.syeyoung.dungeonsguide.dungeon.roomfinder; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; @@ -12,7 +30,7 @@ import net.minecraft.world.World; import java.util.List; public class RoomMatcher { - private DungeonRoom dungeonRoom; + private final DungeonRoom dungeonRoom; @Getter private DungeonRoomInfo match; @@ -20,7 +38,7 @@ public class RoomMatcher { private int rotation; // how much the "found room" has to rotate clockwise to match the given dungeon room info. ! private boolean triedMatch = false; - private World w; + private final World w; public RoomMatcher(DungeonRoom dungeonRoom) { this.dungeonRoom = dungeonRoom; |