Skip to content

Commit

Permalink
fix curios inventory replicate bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mlus-asuka committed Apr 23, 2024
1 parent 50648a2 commit 0dfab35
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/vip/fubuki/playersync/sync/ModsSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ public void onPlayerJoin(Player player) throws SQLException {
itemHandler.ifPresent(handler -> {
for (int i = 0; i < handler.getSlots(); i++) {
try {
if (curios.get(i) == null) continue;
handler.getEquippedCurios().setStackInSlot(i, ItemStack.of(NbtUtils.snbtToStructure(curios.get(i).replace("|", ","))));
if (curios.get(i) == null){
handler.getEquippedCurios().setStackInSlot(i,ItemStack.EMPTY);
}else{
handler.getEquippedCurios().setStackInSlot(i, ItemStack.of(NbtUtils.snbtToStructure(curios.get(i).replace("|", ","))));
}

} catch (CommandSyntaxException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit 0dfab35

Please sign in to comment.