code refactor
This commit is contained in:
parent
0dfab35b25
commit
17ad40f693
|
|
@ -30,11 +30,11 @@ public class ModsSupport {
|
||||||
if(curios_data.length()>2) {
|
if(curios_data.length()>2) {
|
||||||
Map<Integer, String> curios = LocalJsonUtil.StringToEntryMap(curios_data);
|
Map<Integer, String> curios = LocalJsonUtil.StringToEntryMap(curios_data);
|
||||||
itemHandler.ifPresent(handler -> {
|
itemHandler.ifPresent(handler -> {
|
||||||
|
handler.reset();
|
||||||
for (int i = 0; i < handler.getSlots(); i++) {
|
for (int i = 0; i < handler.getSlots(); i++) {
|
||||||
try {
|
try {
|
||||||
if (curios.get(i) == null){
|
handler.getEquippedCurios().setStackInSlot(i,ItemStack.EMPTY);
|
||||||
handler.getEquippedCurios().setStackInSlot(i,ItemStack.EMPTY);
|
if (curios.get(i) != null){
|
||||||
}else{
|
|
||||||
handler.getEquippedCurios().setStackInSlot(i, ItemStack.of(NbtUtils.snbtToStructure(curios.get(i).replace("|", ","))));
|
handler.getEquippedCurios().setStackInSlot(i, ItemStack.of(NbtUtils.snbtToStructure(curios.get(i).replace("|", ","))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user