Java Code Examples for org.bukkit.event.world.WorldLoadEvent#getWorld()
The following examples show how to use
org.bukkit.event.world.WorldLoadEvent#getWorld() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CarbonWorldGenerator.java From Carbon with GNU Lesser General Public License v3.0 | 6 votes |
@EventHandler() public void onWorldLoad(WorldLoadEvent evt) { //Add populator on world load World world = evt.getWorld(); if ( plugin.getConfig().getStringList("options.worlds").contains(world.getName()) && ( !world.getPopulators().contains(dioritePopulator) && !world.getPopulators().contains(andesitePopulator) && !world.getPopulators().contains(granitePopulator) ) ) { Carbon.log.log(Level.INFO, "[Carbon] Editing world: {0}", world.getName()); Carbon.log.log(Level.INFO, "[Carbon] Adding populator for world: {0}", world.getName()); world.getPopulators().add(dioritePopulator); world.getPopulators().add(andesitePopulator); world.getPopulators().add(granitePopulator); Carbon.log.log(Level.INFO, "[Carbon] Done editing world: {0}", world.getName()); } }
Example 2
Source File: WorldListener.java From WorldGuardExtraFlagsPlugin with MIT License | 5 votes |
@EventHandler(priority = EventPriority.MONITOR) public void onWorldLoadEvent(WorldLoadEvent event) { World world = event.getWorld(); this.plugin.getWorldGuardCommunicator().doUnloadChunkFlagCheck(world); }
Example 3
Source File: GlobalProtectionListener.java From DungeonsXL with GNU General Public License v3.0 | 5 votes |
@EventHandler public void onWorldLoad(WorldLoadEvent event) { World world = event.getWorld(); for (Entry<UnloadedProtection, String> entry : new HashSet<>(plugin.getGlobalProtectionCache().getUnloadedProtections().entrySet())) { if (world.getName().equals(entry.getValue())) { entry.getKey().load(world); } } }
Example 4
Source File: WorldListener.java From RedProtect with GNU General Public License v3.0 | 5 votes |
@EventHandler(priority = EventPriority.NORMAL) public void onWorldLoad(WorldLoadEvent e) { World w = e.getWorld(); try { RedProtect.get().rm.load(w.getName()); // RedProtect.get().config.addWorldProperties(w); RedProtect.get().reloadConfigs(); RedProtect.get().logger.warning("World loaded: " + w.getName()); } catch (Exception ex) { RedProtect.get().logger.severe("RedProtect problem on load world:"); ex.printStackTrace(); } }
Example 5
Source File: GlobalPVPModule.java From UHC with MIT License | 5 votes |
@EventHandler public void on(WorldLoadEvent event) { final World world = event.getWorld(); if (worlds.worldMatches(world)) { world.setPVP(isEnabled()); } }