unify item creation in curios and normal inventory
this also allows creation of placeholders within curios containers
(cherry picked from commit a70605a8b6)
This commit is contained in:
parent
3651c351cd
commit
6adb8c2622
|
|
@ -72,9 +72,7 @@ public class ModsSupport {
|
|||
}
|
||||
String serialized = entry.getValue();
|
||||
try {
|
||||
String nbtString = VanillaSync.deserializeString(serialized);
|
||||
CompoundTag tag = VanillaSync.snbtToFixedCompoundTag(nbtString);
|
||||
ItemStack stack = ItemStack.of(tag);
|
||||
ItemStack stack = VanillaSync.deserializeAndCreatePlaceholderIfNeeded(serialized);
|
||||
if (handler.getCurios().containsKey(slotType)) {
|
||||
ICurioStacksHandler stacksHandler = handler.getCurios().get(slotType);
|
||||
IDynamicStackHandler dynStacks = stacksHandler.getStacks();
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ public class VanillaSync {
|
|||
}
|
||||
|
||||
// deserialize item and potentially create placeholders
|
||||
private static ItemStack deserializeAndCreatePlaceholderIfNeeded(String serializedNbt)
|
||||
public static ItemStack deserializeAndCreatePlaceholderIfNeeded(String serializedNbt)
|
||||
throws CommandSyntaxException {
|
||||
if (serializedNbt == null || serializedNbt.isEmpty() || serializedNbt.equals("B64:e30=")) {
|
||||
// Check for empty NBT (Base64 encoded '{}')
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user