Critical fix to NBT loading when loading entities into chunks from a different version.

This commit is contained in:
luisc committed 2021-11-29 21:21:49 -06:00
1 parent d79ec52994
commit f3ebf86b1e
2 files changed
+16 -10

No files matched your search

@@ -76,11 +76,13 @@ public class DataTimers implements ITimers {
Map<Integer, DataTimers.Timer> timers = new HashMap();
NBTTagList list = compound.getTagList("NpcsTimers", 10);
for(int i = 0; i < list.tagCount(); ++i) {
NBTTagCompound c = list.getCompoundTagAt(i);
DataTimers.Timer t = new DataTimers.Timer(c.getInteger("ID"), c.getInteger("TimerTicks"), c.getBoolean("Repeat"));
t.ticks = c.getInteger("Ticks");
timers.put(t.id, t);
if(list != null) {
for (int i = 0; i < list.tagCount(); ++i) {
NBTTagCompound c = list.getCompoundTagAt(i);
DataTimers.Timer t = new DataTimers.Timer(c.getInteger("ID"), c.getInteger("TimerTicks"), c.getBoolean("Repeat"));
t.ticks = c.getInteger("Ticks");
timers.put(t.id, t);
}
}
this.timers = timers;