コード例 #1
0
ファイル: TEC.java プロジェクト: AhmiDarrow/ThaumicExpansion
 @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();
       }
     }
   }
 }
コード例 #2
0
  @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);
    }
  }