Пример #1
0
  @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
  public void onWorldLoad(WorldLoadEvent event) {
    if (settings == null) return;

    if (event == null || event.getWorld() == null) return;

    World world = event.getWorld();

    boolean disabled = false;
    for (String worldName : settings.worldsToDisable) {
      if (!world.getName().equalsIgnoreCase(worldName)) continue;

      Bukkit.getServer().unloadWorld(world, true);
      disabled = true;
      break;
    }

    if (disabled) return;

    for (String worldName : settings.worldsToUnload) {
      if (!world.getName().equalsIgnoreCase(worldName)) continue;

      world.setKeepSpawnInMemory(false);
      break;
    }
  }
Пример #2
0
 @EventHandler
 public void onWorldLoad(WorldLoadEvent event) {
   File dataDir = new File(event.getWorld().getWorldFolder(), "mcmmo_data");
   if (!dataDir.exists()) {
     dataDir.mkdir();
   }
 }
 @EventHandler(priority = EventPriority.MONITOR)
 void onWorldLoad(WorldLoadEvent event) {
   for (CChunkLoader cl :
       DataStoreManager.getDataStore().getChunkLoaders(event.getWorld().getName())) {
     if (cl.isLoadable()) {
       BCLForgeLib.instance().addChunkLoader(cl);
     }
   }
 }
Пример #4
0
 @Override
 public void onWorldLoad(WorldLoadEvent event) {
   /* Call listeners */
   List<Listener> ll = event_handlers.get(event.getType());
   if (ll != null) {
     for (Listener l : ll) {
       ((WorldListener) l).onWorldLoad(event);
     }
   }
 }
Пример #5
0
    /** Recreate the item on world load if the chunk is also loaded */
    @EventHandler
    private void onWorldLoad(WorldLoadEvent event) {
      if (!mIsLoaded) return;
      if (event.getWorld() == mLocation.getWorld() && mLocation.getChunk().isLoaded()) {
        onRemove();

        mHoveringItem =
            mLocation.getWorld().dropItem(mLocation.clone().add(0.5, 1, 0.5), mHoverItemTemplate);
        mHoveringItem.setVelocity(new Vector(0, 0, 0));
      }
    }
Пример #6
0
  /** Called when a World is loaded. */
  @EventHandler
  public void onWorldLoad(WorldLoadEvent event) {
    World world = event.getWorld();
    Integer lockedTime = getLockedTimes().get(world.getName());

    if (lockedTime != null) {
      world.setTime(lockedTime);
      lock(world);
      CommandBook.logger()
          .info(
              "Time locked to '"
                  + CommandBookUtil.getTimeString(lockedTime)
                  + "' for world '"
                  + world.getName()
                  + "'");
    }
  }
 @EventHandler(priority = EventPriority.LOWEST)
 public void onWorldLoad(WorldLoadEvent event) {
   SimpleChunkDataManager dm = (SimpleChunkDataManager) SpoutManager.getChunkDataManager();
   dm.loadWorldChunks(event.getWorld());
 }
Пример #8
0
 @EventHandler
 public void onWorldLoad(WorldLoadEvent event) {
   initWorld(event.getWorld());
 }
Пример #9
0
 @EventHandler
 public void onWorldLoad(WorldLoadEvent event) {
   mudkips.configManager.worldLoaded(event.getWorld());
 }