9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-19 14:59:21 +00:00

fix: handle ender chest size mismatch (#582)

This commit is contained in:
kFor
2025-09-12 01:51:15 +03:00
committed by GitHub
parent 96f34092f6
commit 16d4a8fd9b

View File

@@ -199,7 +199,9 @@ public abstract class BukkitData implements Data {
@Override @Override
public void apply(@NotNull BukkitUser user, @NotNull BukkitHuskSync plugin) throws IllegalStateException { public void apply(@NotNull BukkitUser user, @NotNull BukkitHuskSync plugin) throws IllegalStateException {
user.getPlayer().getEnderChest().setContents(plugin.setMapViews(getContents())); ItemStack[] fullContents = plugin.setMapViews(getContents());
ItemStack[] enderChestContents = Arrays.copyOf(fullContents, Math.min(fullContents.length, user.getPlayer().getEnderChest().getSize()));
user.getPlayer().getEnderChest().setContents(enderChestContents);
} }
} }