Deleagted all ScriptContainer NBT based creation to IScriptUnit.createFromNBT

This commit is contained in:
bigguy345 committed 2026-01-13 22:16:51 +02:00
1 parent fbcda09fe2
commit 73db727c47
14 files changed
+61 -36

No files matched your search

@@ -251,8 +251,8 @@ public class PacketUtil {
data.getScripts().add(new ScriptContainer(data));
}
NBTTagCompound tabCompound = ByteBufUtils.readNBT(buffer);
ScriptContainer script = new ScriptContainer(data);
script.readFromNBT(tabCompound);
// Use factory method to create correct script unit type based on NBT
IScriptUnit script = IScriptUnit.createFromNBT(tabCompound, data);
data.getScripts().set(tab, script);
} else {
NBTTagCompound compound = ByteBufUtils.readNBT(buffer);