fix curios inventory replicate bug
This commit is contained in:
parent
50648a217d
commit
0dfab35b25
|
|
@ -32,8 +32,12 @@ public class ModsSupport {
|
||||||
itemHandler.ifPresent(handler -> {
|
itemHandler.ifPresent(handler -> {
|
||||||
for (int i = 0; i < handler.getSlots(); i++) {
|
for (int i = 0; i < handler.getSlots(); i++) {
|
||||||
try {
|
try {
|
||||||
if (curios.get(i) == null) continue;
|
if (curios.get(i) == null){
|
||||||
handler.getEquippedCurios().setStackInSlot(i, ItemStack.of(NbtUtils.snbtToStructure(curios.get(i).replace("|", ","))));
|
handler.getEquippedCurios().setStackInSlot(i,ItemStack.EMPTY);
|
||||||
|
}else{
|
||||||
|
handler.getEquippedCurios().setStackInSlot(i, ItemStack.of(NbtUtils.snbtToStructure(curios.get(i).replace("|", ","))));
|
||||||
|
}
|
||||||
|
|
||||||
} catch (CommandSyntaxException e) {
|
} catch (CommandSyntaxException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user