diff --git a/src/main/java/emu/grasscutter/command/commands/GroupCommand.java b/src/main/java/emu/grasscutter/command/commands/GroupCommand.java index 97359285f..4e44ec558 100644 --- a/src/main/java/emu/grasscutter/command/commands/GroupCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/GroupCommand.java @@ -63,9 +63,7 @@ public final class GroupCommand implements CommandHandler { CommandHandler.sendMessage(sender, translate(sender, "commands.group.refreshed", groupId)); } - default -> { - sendUsageMessage(sender); - } + default -> sendUsageMessage(sender); } } } diff --git a/src/main/java/emu/grasscutter/command/commands/SendMailCommand.java b/src/main/java/emu/grasscutter/command/commands/SendMailCommand.java index b1ed3ad4b..c4c0e6a4f 100644 --- a/src/main/java/emu/grasscutter/command/commands/SendMailCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SendMailCommand.java @@ -106,14 +106,12 @@ public final class SendMailCommand implements CommandHandler { getConstructionArgs(mailBuilder.constructionStage, sender))); } } - case "help" -> { - CommandHandler.sendMessage( - sender, - translate( - sender, - "commands.sendMail.please_use", - getConstructionArgs(mailBuilder.constructionStage, sender))); - } + case "help" -> CommandHandler.sendMessage( + sender, + translate( + sender, + "commands.sendMail.please_use", + getConstructionArgs(mailBuilder.constructionStage, sender))); default -> { switch (mailBuilder.constructionStage) { case 0 -> { diff --git a/src/main/java/emu/grasscutter/command/commands/TalentCommand.java b/src/main/java/emu/grasscutter/command/commands/TalentCommand.java index 6edd2dd68..fb071e564 100644 --- a/src/main/java/emu/grasscutter/command/commands/TalentCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/TalentCommand.java @@ -45,9 +45,7 @@ public final class TalentCommand implements CommandHandler { String cmdSwitch = args.get(0).toLowerCase(); switch (cmdSwitch) { - default -> { - sendUsageMessage(sender); - } + default -> sendUsageMessage(sender); case "set" -> { if (args.size() < 3) { sendUsageMessage(sender); diff --git a/src/main/java/emu/grasscutter/game/player/PlayerCodex.java b/src/main/java/emu/grasscutter/game/player/PlayerCodex.java index 4981d4794..f724d5d5e 100644 --- a/src/main/java/emu/grasscutter/game/player/PlayerCodex.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerCodex.java @@ -48,16 +48,14 @@ public class PlayerCodex { val itemData = item.getItemData(); val itemId = item.getItemId(); switch (itemData.getItemType()) { - case ITEM_WEAPON -> { - Optional.ofNullable(GameData.getCodexWeaponDataIdMap().get(itemId)) - .ifPresent( - codexData -> { - if (this.getUnlockedWeapon().add(itemId)) { - this.player.save(); - this.player.sendPacket(new PacketCodexDataUpdateNotify(2, codexData.getId())); - } - }); - } + case ITEM_WEAPON -> Optional.ofNullable(GameData.getCodexWeaponDataIdMap().get(itemId)) + .ifPresent( + codexData -> { + if (this.getUnlockedWeapon().add(itemId)) { + this.player.save(); + this.player.sendPacket(new PacketCodexDataUpdateNotify(2, codexData.getId())); + } + }); case ITEM_MATERIAL -> { switch (itemData.getMaterialType()) { // Is this check even needed? @@ -65,17 +63,15 @@ public class PlayerCodex { MATERIAL_WIDGET, MATERIAL_EXCHANGE, MATERIAL_AVATAR_MATERIAL, - MATERIAL_NOTICE_ADD_HP -> { - Optional.ofNullable(GameData.getCodexMaterialDataIdMap().get(itemId)) - .ifPresent( - codexData -> { - if (this.getUnlockedMaterial().add(itemId)) { - this.player.save(); - this.player.sendPacket( - new PacketCodexDataUpdateNotify(4, codexData.getId())); - } - }); - } + MATERIAL_NOTICE_ADD_HP -> Optional.ofNullable(GameData.getCodexMaterialDataIdMap().get(itemId)) + .ifPresent( + codexData -> { + if (this.getUnlockedMaterial().add(itemId)) { + this.player.save(); + this.player.sendPacket( + new PacketCodexDataUpdateNotify(4, codexData.getId())); + } + }); default -> {} } } diff --git a/src/main/java/emu/grasscutter/server/packet/recv/HandlerTryEnterHomeReq.java b/src/main/java/emu/grasscutter/server/packet/recv/HandlerTryEnterHomeReq.java index 6eaebaaa7..e2425fc36 100644 --- a/src/main/java/emu/grasscutter/server/packet/recv/HandlerTryEnterHomeReq.java +++ b/src/main/java/emu/grasscutter/server/packet/recv/HandlerTryEnterHomeReq.java @@ -43,24 +43,20 @@ public class HandlerTryEnterHomeReq extends PacketHandler { } } case FriendEnterHomeOptionOuterClass.FriendEnterHomeOption - .FRIEND_ENTER_HOME_OPTION_REFUSE_VALUE -> { - session.send( - new PacketTryEnterHomeRsp( - RetcodeOuterClass.Retcode.RET_HOME_HOME_REFUSE_GUEST_ENTER_VALUE, - req.getTargetUid())); - } + .FRIEND_ENTER_HOME_OPTION_REFUSE_VALUE -> session.send( + new PacketTryEnterHomeRsp( + RetcodeOuterClass.Retcode.RET_HOME_HOME_REFUSE_GUEST_ENTER_VALUE, + req.getTargetUid())); case FriendEnterHomeOptionOuterClass.FriendEnterHomeOption - .FRIEND_ENTER_HOME_OPTION_DIRECT_VALUE -> { - session - .getServer() - .getHomeWorldMPSystem() - .enterHome( - session.getPlayer(), - targetPlayer, - req.getTargetPoint(), - req.getIsTransferToSafePoint()); - } + .FRIEND_ENTER_HOME_OPTION_DIRECT_VALUE -> session + .getServer() + .getHomeWorldMPSystem() + .enterHome( + session.getPlayer(), + targetPlayer, + req.getTargetPoint(), + req.getIsTransferToSafePoint()); } return; diff --git a/src/main/java/emu/grasscutter/server/packet/send/PacketVehicleInteractRsp.java b/src/main/java/emu/grasscutter/server/packet/send/PacketVehicleInteractRsp.java index d97be81c9..f1df152c9 100644 --- a/src/main/java/emu/grasscutter/server/packet/send/PacketVehicleInteractRsp.java +++ b/src/main/java/emu/grasscutter/server/packet/send/PacketVehicleInteractRsp.java @@ -37,9 +37,7 @@ public class PacketVehicleInteractRsp extends BasePacket { QuestContent.QUEST_CONTENT_ENTER_VEHICLE, ((EntityVehicle) vehicle).getGadgetId()); } - case VEHICLE_INTERACT_TYPE_OUT -> { - ((EntityVehicle) vehicle).getVehicleMembers().remove(vehicleMember); - } + case VEHICLE_INTERACT_TYPE_OUT -> ((EntityVehicle) vehicle).getVehicleMembers().remove(vehicleMember); default -> {} } } @@ -57,12 +55,8 @@ public class PacketVehicleInteractRsp extends BasePacket { proto.setMember(vehicleMember); switch (interactType) { - case VEHICLE_INTERACT_TYPE_IN -> { - vehicle.getVehicleMembers().add(vehicleMember); - } - case VEHICLE_INTERACT_TYPE_OUT -> { - vehicle.getVehicleMembers().remove(vehicleMember); - } + case VEHICLE_INTERACT_TYPE_IN -> vehicle.getVehicleMembers().add(vehicleMember); + case VEHICLE_INTERACT_TYPE_OUT -> vehicle.getVehicleMembers().remove(vehicleMember); default -> {} } }