diff --git a/src/main/java/server/life/MaplePlayerNPC.java b/src/main/java/server/life/MaplePlayerNPC.java index e9a7015231..f493f26118 100644 --- a/src/main/java/server/life/MaplePlayerNPC.java +++ b/src/main/java/server/life/MaplePlayerNPC.java @@ -30,8 +30,8 @@ import constants.game.GameConstants; import net.server.Server; import net.server.channel.Channel; import net.server.world.World; -import server.life.positioner.MaplePlayerNPCPodium; import server.life.positioner.MaplePlayerNPCPositioner; +import server.life.positioner.PlayerNPCPodium; import server.maps.AbstractMapleMapObject; import server.maps.MapleMap; import server.maps.MapleMapObject; @@ -389,7 +389,7 @@ public class MaplePlayerNPC extends AbstractMapleMapObject { if (pos == null) { if (GameConstants.isPodiumHallOfFameMap(map.getId())) { - pos = MaplePlayerNPCPodium.getNextPlayerNpcPosition(map); + pos = PlayerNPCPodium.getNextPlayerNpcPosition(map); } else { pos = MaplePlayerNPCPositioner.getNextPlayerNpcPosition(map); } diff --git a/src/main/java/server/life/positioner/MaplePlayerNPCPodium.java b/src/main/java/server/life/positioner/PlayerNPCPodium.java similarity index 77% rename from src/main/java/server/life/positioner/MaplePlayerNPCPodium.java rename to src/main/java/server/life/positioner/PlayerNPCPodium.java index 7aa3e9c2ac..ba53741d98 100644 --- a/src/main/java/server/life/positioner/MaplePlayerNPCPodium.java +++ b/src/main/java/server/life/positioner/PlayerNPCPodium.java @@ -34,105 +34,100 @@ import java.util.Arrays; import java.util.List; /** - * * @author RonanLana - * + *
* Note: the podium uses getGroundBelow that in its turn uses inputted posY minus 7.
* Podium system will implement increase-by-7 to negate that behaviour.
*/
-public class MaplePlayerNPCPodium {
+public class PlayerNPCPodium {
private static int getPlatformPosX(int platform) {
- switch(platform) {
- case 0:
- return -50;
-
- case 1:
- return -170;
-
- default:
- return 70;
- }
+ return switch (platform) {
+ case 0 -> -50;
+ case 1 -> -170;
+ default -> 70;
+ };
}
-
+
private static int getPlatformPosY(int platform) {
- switch(platform) {
- case 0:
- return -47;
-
- default:
- return 40;
+ if (platform == 0) {
+ return -47;
}
+ return 40;
}
-
+
private static Point calcNextPos(int rank, int step) {
int podiumPlatform = rank / step;
int relativePos = (rank % step) + 1;
-
+
Point pos = new Point(getPlatformPosX(podiumPlatform) + ((100 * relativePos) / (step + 1)), getPlatformPosY(podiumPlatform));
return pos;
}
-
+
private static Point rearrangePlayerNpcs(MapleMap map, int newStep, List