Ejemplo n.º 1
0
 public void handleWorldDataSave(
     SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound) {
   for (ModContainer mc : Loader.instance().getModList()) {
     if (mc instanceof InjectedModContainer) {
       WorldAccessContainer wac = ((InjectedModContainer) mc).getWrappedWorldAccessContainer();
       if (wac != null) {
         NBTTagCompound dataForWriting = wac.getDataForWriting(handler, worldInfo);
         tagCompound.func_74766_a(mc.getModId(), dataForWriting);
       }
     }
   }
 }
Ejemplo n.º 2
0
 public void handleWorldDataLoad(
     SaveHandler handler, WorldInfo worldInfo, NBTTagCompound tagCompound) {
   if (getEffectiveSide() != Side.SERVER) {
     return;
   }
   if (handlerSet.contains(handler)) {
     return;
   }
   handlerSet.add(handler);
   Map<String, NBTBase> additionalProperties = Maps.newHashMap();
   worldInfo.setAdditionalProperties(additionalProperties);
   for (ModContainer mc : Loader.instance().getModList()) {
     if (mc instanceof InjectedModContainer) {
       WorldAccessContainer wac = ((InjectedModContainer) mc).getWrappedWorldAccessContainer();
       if (wac != null) {
         wac.readData(
             handler, worldInfo, additionalProperties, tagCompound.func_74775_l(mc.getModId()));
       }
     }
   }
 }