From f54432a89a51e1ec6d8441fd9a49ebf6f2f16e5d Mon Sep 17 00:00:00 2001 From: Thoronium <107363768+NotThorny@users.noreply.github.com> Date: Tue, 29 Aug 2023 10:15:19 -0600 Subject: [PATCH] Bug fixes (#2314) * Match resources names * Fix loading with no skill * Stop overriding common command alias * Fix discord link in version check popup * Forgot to add rotation fix * Remove unnecessary set --- .../command/commands/GroupCommand.java | 2 +- .../command/commands/SoundCommand.java | 2 +- .../data/binout/HomeworldDefaultSaveData.java | 53 ++++++++++--------- .../game/avatar/AvatarStorage.java | 7 +++ .../game/home/HomeFurnitureItem.java | 2 +- .../grasscutter/game/props/ElementType.java | 7 ++- .../server/http/dispatch/RegionHandler.java | 2 +- 7 files changed, 44 insertions(+), 31 deletions(-) diff --git a/src/main/java/emu/grasscutter/command/commands/GroupCommand.java b/src/main/java/emu/grasscutter/command/commands/GroupCommand.java index 5bec40be1..74d94fb2d 100644 --- a/src/main/java/emu/grasscutter/command/commands/GroupCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/GroupCommand.java @@ -10,7 +10,7 @@ import java.util.List; @Command( label = "group", - aliases = {"g"}, + aliases = {"gr"}, usage = {"(refresh) [] []"}, permission = "player.group", permissionTargeted = "player.group.others") diff --git a/src/main/java/emu/grasscutter/command/commands/SoundCommand.java b/src/main/java/emu/grasscutter/command/commands/SoundCommand.java index f69db4e5e..ed36639e8 100644 --- a/src/main/java/emu/grasscutter/command/commands/SoundCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SoundCommand.java @@ -12,7 +12,7 @@ import lombok.val; @Command( label = "sound", - aliases = {"s", "audio"}, + aliases = {"audio"}, usage = {"[] []"}, permission = "player.sound", permissionTargeted = "player.sound.others") diff --git a/src/main/java/emu/grasscutter/data/binout/HomeworldDefaultSaveData.java b/src/main/java/emu/grasscutter/data/binout/HomeworldDefaultSaveData.java index 98ee7efa1..3916f125f 100644 --- a/src/main/java/emu/grasscutter/data/binout/HomeworldDefaultSaveData.java +++ b/src/main/java/emu/grasscutter/data/binout/HomeworldDefaultSaveData.java @@ -12,38 +12,38 @@ import lombok.experimental.FieldDefaults; public class HomeworldDefaultSaveData { @SerializedName( - value = "KFHBFNPDJBE", - alternate = {"PKACPHDGGEI", "AKOLOBLHDFK"}) + value = "homeBlockLists", + alternate = {"PKACPHDGGEI", "AKOLOBLHDFK", "KFHBFNPDJBE"}) List homeBlockLists; @SerializedName( - value = "IJNPADKGNKE", - alternate = {"MINCKHBNING", "MBICDPDEKDM"}) + value = "bornPos", + alternate = {"MINCKHBNING", "MBICDPDEKDM", "IJNPADKGNKE"}) Position bornPos; @SerializedName( - value = "IPIIGEMFLHK", - alternate = {"EJJIOJKFKCO"}) + value = "bornRot", + alternate = {"EJJIOJKFKCO", "IPIIGEMFLHK"}) Position bornRot; @SerializedName( - value = "HHOLBNPIHEM", - alternate = {"CJAKHCIFHNP"}) + value = "djinPos", + alternate = {"CJAKHCIFHNP", "HHOLBNPIHEM"}) Position djinPos; @SerializedName( - value = "KNHCJKHCOAN", - alternate = {"AMDNOHPGKMI"}) + value = "mainhouse", + alternate = {"AMDNOHPGKMI", "KNHCJKHCOAN"}) HomeFurniture mainhouse; @SerializedName( - value = "NIHOJFEKFPG", - alternate = {"BHCPEAOPIDC"}) + value = "doorLists", + alternate = {"BHCPEAOPIDC", "NIHOJFEKFPG"}) List doorLists; @SerializedName( - value = "EPGELGEFJFK", - alternate = {"AABEPENIFLN"}) + value = "stairLists", + alternate = {"AABEPENIFLN", "EPGELGEFJFK"}) List stairLists; @Data @@ -51,18 +51,18 @@ public class HomeworldDefaultSaveData { public static class HomeBlock { @SerializedName( - value = "FGIJCELCGFI", - alternate = {"PGDPDIDJEEL", "ANICBLBOBKD"}) + value = "blockId", + alternate = {"PGDPDIDJEEL", "ANICBLBOBKD", "FGIJCELCGFI"}) int blockId; @SerializedName( - value = "BEAPOFELABD", - alternate = {"NCIMIKKFLOH"}) + value = "furnitures", + alternate = {"NCIMIKKFLOH", "BEAPOFELABD"}) List furnitures; @SerializedName( - value = "MLIODLGDFHJ", - alternate = {"GJGNLIINBGB"}) + value = "persistentFurnitures", + alternate = {"GJGNLIINBGB", "MLIODLGDFHJ"}) List persistentFurnitures; } @@ -71,15 +71,18 @@ public class HomeworldDefaultSaveData { public static class HomeFurniture { @SerializedName( - value = "ENHNGKJBJAB", - alternate = {"KMAAJJHPNBA", "FFLCGFGGGND"}) + value = "id", + alternate = {"KMAAJJHPNBA", "FFLCGFGGGND", "ENHNGKJBJAB"}) int id; @SerializedName( - value = "NGIEEIOLPPO", - alternate = {"JFKAHNCPDME", "BPCGGBKIAMG"}) + value = "pos", + alternate = {"JFKAHNCPDME", "BPCGGBKIAMG", "NGIEEIOLPPO"}) Position pos; - // @SerializedName(value = "HEOCEHKEBFM", alternate = "LKCKOOGFDBM") + + @SerializedName( + value = "rot", + alternate = {"LKCKOOGFDBM", "HEOCEHKEBFM"}) Position rot; } } diff --git a/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java b/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java index b4a918b4e..49dfcfd6b 100644 --- a/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java +++ b/src/main/java/emu/grasscutter/game/avatar/AvatarStorage.java @@ -157,6 +157,13 @@ public class AvatarStorage extends BasePlayerManager implements Iterable // Add to avatar storage this.avatars.put(avatar.getAvatarId(), avatar); this.avatarsGuid.put(avatar.getGuid(), avatar); + + // Set main character skill depot data, fixes loading with no element every login + if ((avatar.getAvatarId() == 10000007) || (avatar.getAvatarId() == 10000005)) { + avatar.setSkillDepot(skillDepot); + avatar.setSkillDepotData(skillDepot); + avatar.save(); + } } this.setLoaded(true); diff --git a/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java b/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java index a14b41833..adaf1b17b 100644 --- a/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java +++ b/src/main/java/emu/grasscutter/game/home/HomeFurnitureItem.java @@ -41,7 +41,7 @@ public class HomeFurnitureItem { .furnitureId(homeFurniture.getId()) .parentFurnitureIndex(1) .spawnPos(homeFurniture.getPos() == null ? new Position() : homeFurniture.getPos()) - .spawnRot(homeFurniture.getRot() == null ? new Position() : homeFurniture.getRot()) + .spawnRot(new Position()) .build(); } diff --git a/src/main/java/emu/grasscutter/game/props/ElementType.java b/src/main/java/emu/grasscutter/game/props/ElementType.java index 5b7bcc6a6..805fa5cbe 100644 --- a/src/main/java/emu/grasscutter/game/props/ElementType.java +++ b/src/main/java/emu/grasscutter/game/props/ElementType.java @@ -10,7 +10,10 @@ import java.util.stream.Stream; import lombok.Getter; public enum ElementType implements IntValueEnum { - None(0, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, FightProperty.FIGHT_PROP_MAX_FIRE_ENERGY), + None( + 0, + FightProperty.FIGHT_PROP_CUR_WIND_ENERGY, + FightProperty.FIGHT_PROP_MAX_WIND_ENERGY), Fire( 1, FightProperty.FIGHT_PROP_CUR_FIRE_ENERGY, @@ -90,7 +93,7 @@ public enum ElementType implements IntValueEnum { @Getter private final int configHash; ElementType(int value, FightProperty curEnergyProp, FightProperty maxEnergyProp) { - this(value, curEnergyProp, maxEnergyProp, 0, null, 1); + this(value, curEnergyProp, maxEnergyProp, 0, null, 0); } ElementType( diff --git a/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java b/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java index 1b6a9561e..d6b3f6c4f 100644 --- a/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java +++ b/src/main/java/emu/grasscutter/server/http/dispatch/RegionHandler.java @@ -267,7 +267,7 @@ public final class RegionHandler implements Router { .setRegionInfo(RegionInfo.newBuilder()) .setStopServer( StopServerInfo.newBuilder() - .setUrl("https://discord.gg/grasscutters") + .setUrl("https://discord.gg/T5vZU6UyeG") .setStopBeginTime((int) Instant.now().getEpochSecond()) .setStopEndTime((int) Instant.now().getEpochSecond() + 1) .setContentMsg(