Ejemplo n.º 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;
    }
  }
Ejemplo n.º 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);
     }
   }
 }
Ejemplo n.º 4
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));
      }
    }
Ejemplo n.º 5
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());
 }
Ejemplo n.º 7
0
 @EventHandler
 public void onWorldLoad(WorldLoadEvent event) {
   initWorld(event.getWorld());
 }
Ejemplo n.º 8
0
 @EventHandler
 public void onWorldLoad(WorldLoadEvent event) {
   mudkips.configManager.worldLoaded(event.getWorld());
 }