Exemple #1
0
 @SubscribeEvent
 public void loadWorld(WorldEvent.Load event) {
   if (event.world.provider.dimensionId == 0 && event.world instanceof WorldServer) {
     MapStorage storage = DimensionManager.getWorld(0).mapStorage;
     if (storage != null) {
       TECData data = (TECData) storage.loadData(TECData.class, "TECData");
       if (data == null) {
         data = new TECData();
         data.markDirty();
       }
     }
   }
 }
  @EventHandler
  public void serverLoad(FMLServerStartingEvent event) {
    ChunkManager.getInstance().requestTicket();

    // event.registerServerCommand(new CommandLandBook());

    MapStorage storage = MinecraftServer.getServer().worldServers[0].perWorldStorage;
    chunkSaved = (ChunkSavedData) storage.loadData(ChunkSavedData.class, ChunkSavedData.key);
    if (chunkSaved == null) {
      chunkSaved = new ChunkSavedData();
      storage.setData(ChunkSavedData.key, chunkSaved);
    }
  }