diff --git a/common/src/main/java/io/github/fisher2911/hmccosmetics/cosmetic/CosmeticManager.java b/common/src/main/java/io/github/fisher2911/hmccosmetics/cosmetic/CosmeticManager.java index aedeef30..4c87390b 100644 --- a/common/src/main/java/io/github/fisher2911/hmccosmetics/cosmetic/CosmeticManager.java +++ b/common/src/main/java/io/github/fisher2911/hmccosmetics/cosmetic/CosmeticManager.java @@ -96,6 +96,7 @@ public class CosmeticManager { public void load() { this.clearItems(); + this.backpackParticleCounts.clear(); try { final File file = ITEMS_PATH.toFile(); if (!file.exists()) { @@ -115,7 +116,7 @@ public class CosmeticManager { if (item instanceof ArmorItem armorItem) { armorItem.setAction(null); if (armorItem.getType() == ArmorItem.Type.SELF_BACKPACK) { - final int particleCount = node.node(PARTICLE_COUNT).getInt(0); + final int particleCount = node.node(PARTICLE_COUNT).getInt(5); this.backpackParticleCounts.put(armorItem.getId(), particleCount); } this.armorItemMap.put(armorItem.getId(), armorItem); diff --git a/common/src/main/java/io/github/fisher2911/hmccosmetics/packet/PacketManager.java b/common/src/main/java/io/github/fisher2911/hmccosmetics/packet/PacketManager.java index acafe78a..c78bccd0 100644 --- a/common/src/main/java/io/github/fisher2911/hmccosmetics/packet/PacketManager.java +++ b/common/src/main/java/io/github/fisher2911/hmccosmetics/packet/PacketManager.java @@ -116,11 +116,11 @@ public class PacketManager { } } - public static void sendHeadLookPacket(final int entityId, Player... sendTo) { + public static void sendHeadLookPacket(int entityId, float yaw, Player... sendTo) { for (final Player p : sendTo) { sendPacketAsync(p, new WrapperPlayServerEntityHeadLook( entityId, - 0 + yaw )); } } diff --git a/common/src/main/java/io/github/fisher2911/hmccosmetics/user/Backpack.java b/common/src/main/java/io/github/fisher2911/hmccosmetics/user/Backpack.java index 5fed133a..1eab0dd7 100644 --- a/common/src/main/java/io/github/fisher2911/hmccosmetics/user/Backpack.java +++ b/common/src/main/java/io/github/fisher2911/hmccosmetics/user/Backpack.java @@ -21,15 +21,11 @@ public class Backpack { private final HMCCosmetics plugin; private final int armorStandID; - private final int particleCount = HMCCosmetics.getPlugin(HMCCosmetics.class).getSettings().getCosmeticSettings().getParticleCount(); private final List particleIDS = new ArrayList<>(); public Backpack(HMCCosmetics plugin, int armorStandID) { this.plugin = plugin; this.armorStandID = armorStandID; - for (int i = 0; i < particleCount; i++) { - particleIDS.add(SpigotReflectionUtil.generateEntityId()); - } } public void spawn(BaseUser owner, Player other, Location location, Settings settings) { @@ -38,6 +34,7 @@ public class Backpack { this.spawnForOther(owner, other, location); return; } + this.updateIds(owner); this.spawnForSelf(other, location); } @@ -125,7 +122,7 @@ public class Backpack { PacketManager.sendArmorStandMetaContainer(this.armorStandID, other); PacketManager.sendRotationPacket(this.armorStandID, location, false, other); PacketManager.sendLookPacket(this.armorStandID, location, other); - if (!isSelf) { + if (!isSelf || !firstPersonMode || this.particleIDS.size() == 0) {; PacketManager.sendRidingPacket(owner.getEntityId(), this.armorStandID, other); return; }