diff --git a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonEntryData.java b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonEntryData.java index 82a10b47b..d73e5e304 100644 --- a/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonEntryData.java +++ b/src/main/java/emu/grasscutter/data/excels/dungeon/DungeonEntryData.java @@ -1,7 +1,7 @@ package emu.grasscutter.data.excels.dungeon; -import emu.grasscutter.game.dungeons.enums.*; import emu.grasscutter.data.*; +import emu.grasscutter.game.dungeons.enums.*; import java.util.List; import lombok.*; @@ -39,7 +39,8 @@ public class DungeonEntryData extends GameResource { public int getLevelCondition() { for (var cond : satisfiedCond) { - if (cond.type != null && cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_LEVEL)) { + if (cond.type != null + && cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_LEVEL)) { return cond.param1; } } @@ -48,7 +49,8 @@ public class DungeonEntryData extends GameResource { public int getQuestCondition() { for (var cond : satisfiedCond) { - if (cond.type != null && cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_QUEST)) { + if (cond.type != null + && cond.type.equals(DungeonEntrySatisfiedConditionType.DUNGEON_ENTRY_CONDITION_QUEST)) { return cond.param1; } } diff --git a/src/main/java/emu/grasscutter/game/dungeons/DungeonSystem.java b/src/main/java/emu/grasscutter/game/dungeons/DungeonSystem.java index fd26c724c..b80c2468d 100644 --- a/src/main/java/emu/grasscutter/game/dungeons/DungeonSystem.java +++ b/src/main/java/emu/grasscutter/game/dungeons/DungeonSystem.java @@ -7,14 +7,10 @@ import emu.grasscutter.data.excels.dungeon.*; import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler; import emu.grasscutter.game.player.Player; import emu.grasscutter.game.props.SceneType; -import emu.grasscutter.game.props.EnterReason; import emu.grasscutter.game.world.*; import emu.grasscutter.net.packet.*; import emu.grasscutter.server.game.*; import emu.grasscutter.server.packet.send.PacketDungeonEntryInfoRsp; -import emu.grasscutter.game.world.data.TeleportProperties; -import emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType; -import emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType; import it.unimi.dsi.fastutil.ints.*; import java.util.List; import lombok.val; diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerDungeonRestartReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerDungeonRestartReq.java index aabde3ff9..12d9fb877 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerDungeonRestartReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerDungeonRestartReq.java @@ -1,8 +1,6 @@ package emu.grasscutter.server.packet.recv; import emu.grasscutter.net.packet.*; -import emu.grasscutter.net.proto.DungeonRestartReqOuterClass.DungeonRestartReq; -import emu.grasscutter.net.proto.DungeonRestartRspOuterClass.DungeonRestartRsp; import emu.grasscutter.server.game.GameSession; @Opcodes(PacketOpcodes.DungeonRestartReq) diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetDungeonEntryExploreConditionReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetDungeonEntryExploreConditionReq.java index e16d6623d..f4f2824df 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetDungeonEntryExploreConditionReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerGetDungeonEntryExploreConditionReq.java @@ -1,11 +1,9 @@ package emu.grasscutter.server.packet.recv; -import emu.grasscutter.Grasscutter; import emu.grasscutter.net.packet.*; -import emu.grasscutter.server.game.GameSession; -import emu.grasscutter.server.packet.send.PacketGetDungeonEntryExploreConditionRsp; -import emu.grasscutter.server.packet.send.PacketDungeonEntryToBeExploreNotify; import emu.grasscutter.net.proto.GetDungeonEntryExploreConditionReqOuterClass.GetDungeonEntryExploreConditionReq; +import emu.grasscutter.server.game.GameSession; +import emu.grasscutter.server.packet.send.PacketDungeonEntryToBeExploreNotify; @Opcodes(PacketOpcodes.GetDungeonEntryExploreConditionReq) public class HandlerGetDungeonEntryExploreConditionReq extends PacketHandler { @@ -16,12 +14,11 @@ public class HandlerGetDungeonEntryExploreConditionReq extends PacketHandler { // TODO Send GetDungeonEntryExploreConditionRsp if condition // (adventurer rank or quest completion) is not met. Parse // dungeon entry conditions from DungeonEntryExcelConfigData.json. - //session.send(new PacketGetDungeonEntryExploreConditionRsp(req.getDungeonEntryConfigId())); + // session.send(new PacketGetDungeonEntryExploreConditionRsp(req.getDungeonEntryConfigId())); // For now, just unlock any domain the player touches. - session.send(new PacketDungeonEntryToBeExploreNotify( - req.getDungeonEntryScenePointId(), - req.getSceneId(), - req.getDungeonEntryConfigId())); + session.send( + new PacketDungeonEntryToBeExploreNotify( + req.getDungeonEntryScenePointId(), req.getSceneId(), req.getDungeonEntryConfigId())); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonEntryToBeExploreNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonEntryToBeExploreNotify.java index 3919a79b7..15966d2cc 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonEntryToBeExploreNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketDungeonEntryToBeExploreNotify.java @@ -6,15 +6,16 @@ import emu.grasscutter.net.proto.DungeonEntryToBeExploreNotifyOuterClass.Dungeon public class PacketDungeonEntryToBeExploreNotify extends BasePacket { /** - * Marks the dungeon as pending exploration. - * This creates the "Unknown" text bubble above the dungeon entry in the world map. + * Marks the dungeon as pending exploration. This creates the "Unknown" text bubble above the + * dungeon entry in the world map. */ - public PacketDungeonEntryToBeExploreNotify(int dungeonEntryScenePointId, int sceneId, int dungeonEntryConfigId) { + public PacketDungeonEntryToBeExploreNotify( + int dungeonEntryScenePointId, int sceneId, int dungeonEntryConfigId) { super(PacketOpcodes.DungeonEntryToBeExploreNotify); - this.setData(DungeonEntryToBeExploreNotify.newBuilder() - .setDungeonEntryScenePointId(dungeonEntryScenePointId) - .setSceneId(sceneId) - .setDungeonEntryConfigId(dungeonEntryConfigId) - ); + this.setData( + DungeonEntryToBeExploreNotify.newBuilder() + .setDungeonEntryScenePointId(dungeonEntryScenePointId) + .setSceneId(sceneId) + .setDungeonEntryConfigId(dungeonEntryConfigId)); } } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketGetDungeonEntryExploreConditionRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketGetDungeonEntryExploreConditionRsp.java index 61c23d14d..1326e3771 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketGetDungeonEntryExploreConditionRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketGetDungeonEntryExploreConditionRsp.java @@ -2,29 +2,32 @@ package emu.grasscutter.server.packet.send; import emu.grasscutter.data.GameData; import emu.grasscutter.net.packet.*; -import emu.grasscutter.net.proto.GetDungeonEntryExploreConditionRspOuterClass.GetDungeonEntryExploreConditionRsp; -import emu.grasscutter.net.proto.DungeonEntryCondOuterClass.DungeonEntryCond; import emu.grasscutter.net.proto.DungeonEntryBlockReasonOuterClass.DungeonEntryBlockReason; +import emu.grasscutter.net.proto.DungeonEntryCondOuterClass.DungeonEntryCond; +import emu.grasscutter.net.proto.GetDungeonEntryExploreConditionRspOuterClass.GetDungeonEntryExploreConditionRsp; public class PacketGetDungeonEntryExploreConditionRsp extends BasePacket { public PacketGetDungeonEntryExploreConditionRsp(int dungeonId) { super(PacketOpcodes.GetDungeonEntryExploreConditionRsp); - var data = GameData.getDungeonEntryDataMap().values().stream() - .filter(d -> d.getId() == dungeonId) - .toList().get(0); + var data = + GameData.getDungeonEntryDataMap().values().stream() + .filter(d -> d.getId() == dungeonId) + .toList() + .get(0); var level = data.getLevelCondition(); var quest = data.getQuestCondition(); - var proto = GetDungeonEntryExploreConditionRsp.newBuilder() - .setRetcode(0) - .setDungeonEntryCond(DungeonEntryCond.newBuilder() - // There is also a DUNGEON_ENTRY_REASON_MULIPLE but only one param1 - // field to put values in. Only report the required level for now, then. - .setCondReason(DungeonEntryBlockReason.DUNGEON_ENTRY_REASON_LEVEL) - .setParam1(level) - ) - .build(); + var proto = + GetDungeonEntryExploreConditionRsp.newBuilder() + .setRetcode(0) + .setDungeonEntryCond( + DungeonEntryCond.newBuilder() + // There is also a DUNGEON_ENTRY_REASON_MULIPLE but only one param1 + // field to put values in. Only report the required level for now, then. + .setCondReason(DungeonEntryBlockReason.DUNGEON_ENTRY_REASON_LEVEL) + .setParam1(level)) + .build(); this.setData(proto); } diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketUnfreezeGroupLimitNotify.java b/src/main/java/emu/grasscutter/server/packet/send/PacketUnfreezeGroupLimitNotify.java index a6993c04d..e1351028f 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketUnfreezeGroupLimitNotify.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketUnfreezeGroupLimitNotify.java @@ -6,9 +6,6 @@ import emu.grasscutter.net.proto.UnfreezeGroupLimitNotifyOuterClass.UnfreezeGrou public class PacketUnfreezeGroupLimitNotify extends BasePacket { public PacketUnfreezeGroupLimitNotify(int pointId, int sceneId) { super(PacketOpcodes.UnfreezeGroupLimitNotify); - this.setData(UnfreezeGroupLimitNotify.newBuilder() - .setPointId(pointId) - .setSceneId(sceneId) - ); + this.setData(UnfreezeGroupLimitNotify.newBuilder().setPointId(pointId).setSceneId(sceneId)); } }