code refactor

This commit is contained in:
mlus 2024-05-02 16:47:08 +08:00
parent 0dfab35b25
commit 17ad40f693

View File

@ -30,11 +30,11 @@ public class ModsSupport {
if(curios_data.length()>2) {
Map<Integer, String> curios = LocalJsonUtil.StringToEntryMap(curios_data);
itemHandler.ifPresent(handler -> {
handler.reset();
for (int i = 0; i < handler.getSlots(); i++) {
try {
if (curios.get(i) == null){
handler.getEquippedCurios().setStackInSlot(i,ItemStack.EMPTY);
}else{
handler.getEquippedCurios().setStackInSlot(i,ItemStack.EMPTY);
if (curios.get(i) != null){
handler.getEquippedCurios().setStackInSlot(i, ItemStack.of(NbtUtils.snbtToStructure(curios.get(i).replace("|", ","))));
}