private static void loadBorderEvent() { Bukkit.getWorlds().forEach(WorldBorderMundo::replaceBorderForWorld); Bukkit.getServer().getPluginManager().registerEvents(new Listener() { @EventHandler public void onWorldLoad(WorldLoadEvent event) { replaceBorderForWorld(event.getWorld()); } }, Mundo.INSTANCE); Registration.registerEvent("Border Stabilize", EvtBorderStabilize.class, BorderStabilizeEvent.class, "border stabilize [in %-worlds%]") .document("Border Stabilize", "1.4.6", "Called when a border (optionally only of the specified world(s)) stops moving."); Registration.registerExpression(ExprBorderMovingValue.class, Number.class, ExpressionType.PROPERTY, "(0¦original " + DIAMETER_SYNTAX + "|1¦(eventual|final) " + DIAMETER_SYNTAX + "|2¦remaining distance until [the] border stabilize[s]) of %world%", "%world%'s (0¦original " + DIAMETER_SYNTAX + "|1¦(eventual|final) " + DIAMETER_SYNTAX + "|2¦remaining distance until [the] border stabilize[s])") .document("Moving Border Diameter", "1.8", "An expression for a certain property of the moving border of the specified world:" + "original diameter: The diameter of the border when it was last stable" + "final diameter: The diameter that the border will be when it stabilizes" + "remaining distance: The distance the border still has to go before it stabilizes"); Registration.registerExpression(ExprTimeRemainingUntilBorderStabilize.class, Timespan.class, ExpressionType.PROPERTY, "(time remaining|remaining time) until [the] border stabilize[s] (of|in) %world%", "%world%'s (time remaining|remaining time) until [the] border stabilize[s]") .document("Time Remaining Until Border Stabilize", "1.4.6", "An expression for the timespan remaining until the border of the specified world stops moving."); Registration.registerExpressionCondition(CondBorderMoving.class, ExpressionType.PROPERTY, "border of %world% is (0¦moving|1¦stable)", "%world%'s border is (0¦moving|1¦stable)") .document("Border is Moving", "1.8", "Checks whether the border of the specified world is moving or stable (not moving)."); }
@Override public void eventTrigger(Event event) { if(event.getEventName().equalsIgnoreCase("playerjoinevent")){ } else if(event.getEventName().equalsIgnoreCase("playerentityinteractevent")){ eh.onPlayerInteract((PlayerInteractEntityEvent)event); } else if(event.getEventName().equalsIgnoreCase("worldloadevent")){ eh.onWorldLoad((WorldLoadEvent)event); } else if(event.getEventName().equalsIgnoreCase("EntityDamageEvent")){ eh.onEntityDamage((EntityDamageEvent)event); } else if(event.getEventName().equalsIgnoreCase("EntityDamageByEntityEvent")){ eh.onEntityDamage((EntityDamageByEntityEvent)event); } else if(event.getEventName().equalsIgnoreCase("entityexplodeevent")){ eh.onEntityExplode((EntityExplodeEvent)event); } else if(event.getEventName().equalsIgnoreCase("asyncplayerchatevent")){ eh.onPlayerChat((AsyncPlayerChatEvent)event); } }
@EventHandler public void onWorldLoad(WorldLoadEvent event) { if(this.module.getConfig().contains("border." + event.getWorld().getName() + ".x")) { int x = this.module.getConfig().getInteger("border." + event.getWorld().getName() + ".x"); int z = this.module.getConfig().getInteger("border." + event.getWorld().getName() + ".z"); this.module.getConfig().setValue("border." + event.getWorld().getName() + ".minX", -x); this.module.getConfig().setValue("border." + event.getWorld().getName() + ".minZ", -z); this.module.getConfig().setValue("border." + event.getWorld().getName() + ".maxX", x); this.module.getConfig().setValue("border." + event.getWorld().getName() + ".maxZ", z); this.module.getConfig().remove("border." + event.getWorld().getName() + ".x"); this.module.getConfig().remove("border." + event.getWorld().getName() + ".z"); } else { this.module.getConfig().applyDefault("border." + event.getWorld().getName() + ".minX", -4000); this.module.getConfig().applyDefault("border." + event.getWorld().getName() + ".minZ", -4000); this.module.getConfig().applyDefault("border." + event.getWorld().getName() + ".maxX", 4000); this.module.getConfig().applyDefault("border." + event.getWorld().getName() + ".maxZ", 4000); } this.module.getConfig().save(); }
@EventHandler( priority = EventPriority.LOWEST ) public void onWorldLoad( WorldLoadEvent event ) { ConfigurationSection worldsSection = CatRestrictor.getInstance().getConfig().getConfigurationSection( "worlds" ); if( worldsSection == null ) { CatRestrictor.getInstance().getLogger().log( Level.WARNING, "No Worlds are configured!" ); return; } ConfigurationSection worldSection = worldsSection.getConfigurationSection( event.getWorld().getName() ); if( worldSection == null ) { CatRestrictor.getInstance().getLogger().log( Level.WARNING, "Empty configuration for world \"{0}\"!", event.getWorld().getName() ); return; } WorldConfig worldConfig = WorldConfigSerializer.newWorldConfigFromConfigurationSection( worldSection ); CatRestrictor.setWorldConfig( event.getWorld().getName(), worldConfig ); /* CatRestrictor.getInstance().getLogger().log( Level.INFO, "Loaded config for \"{0}\": {1}", new Object[] { event.getWorld().getName(), worldConfig.toString() } ); */ CatRestrictor.getInstance().getLogger().log( Level.INFO, "Loaded config for \"{0}\"", event.getWorld().getName() ); }
@EventHandler private void onWorldLoad(WorldLoadEvent event) { String worldName = event.getWorld().getName(); for (Region region : _instances.keySet()) { if (region.isDefined() && worldName.equals(region.getWorldName())) { // fix locations //noinspection ConstantConditions region.getP1().setWorld(event.getWorld()); //noinspection ConstantConditions region.getP2().setWorld(event.getWorld()); } } }
/** * Creates an EndWorldHandler if the loaded world is an End world * * @param event a World Load Event */ @EventHandler(priority = EventPriority.NORMAL) public void onWorldLoad(final WorldLoadEvent event) { if (event.getWorld().getEnvironment() == Environment.THE_END) { this.plugin.getLogger().info("Additional End world detected: handling " + event.getWorld().getName()); final EndWorldHandler handler = new EndWorldHandler(this.plugin, event.getWorld()); try { handler.loadConfig(); handler.loadChunks(); this.plugin.getWorldHandlers().put(handler.getCamelCaseWorldName(), handler); handler.init(); } catch (final IOException | InvalidConfigurationException e) { this.plugin.getLogger().severe("An error occured, stacktrace follows:"); e.printStackTrace(); } } }
@EventHandler public void onWorldLoad(WorldLoadEvent event) { World w = event.getWorld(); if (w.hasStorm()) w.setStorm(false); if (w.isThundering()) w.setThundering(false); }
@EventHandler private void onWorldLoad(WorldLoadEvent e){ e.getWorld().setAutoSave(false); WorldBorder b = e.getWorld().getWorldBorder(); b.setCenter(0d, 0d); b.setSize(3000000d); plugin.getLogger().info(String.format("Auto-save for world [" + e.getWorld().getName() + "] is prevented! ")); }
/** * Listen when world loaded */ @EventHandler public void onWorldLoad(WorldLoadEvent event) { if (event.getWorld().equals(Bukkit.getWorlds().get(0))) SurvivalAPI.get().fireEvents(SurvivalAPI.EventType.WORLDLOADED); }
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled = true) public void onWorldLoad(WorldLoadEvent e) { if (worldName.equals(e.getWorld().getName())) { world = e.getWorld(); location = new Location(world, x, y, z); } }
@EventHandler(priority = EventPriority.NORMAL) public void onWorldLoad(WorldLoadEvent e) { World w = e.getWorld(); try { RedProtect.get().rm.load(w); RPConfig.init(); RedProtect.get().logger.warning("World loaded: " + w.getName()); } catch (Exception ex) { RedProtect.get().logger.severe("RedProtect problem on load world:"); ex.printStackTrace(); } }
public void onWorldLoad(WorldLoadEvent event){ for(Point point : Constants.multiplayerpossession.keySet()){ if(Constants.multiplayerpossession.get(point).equals(Team.BLUE)){ point.setBlue(); } else if(Constants.multiplayerpossession.get(point).equals(Team.ORANGE)){ point.setOrange(); } else if(Constants.multiplayerpossession.get(point).equals(Team.NEUTRAL)){ point.setNeutral(); } } }
@EventHandler public void onWorldLoad(WorldLoadEvent e) { final String worldName = e.getWorld().getName(); plugin.getShopUtils().reloadShops(false, false, new Callback<Integer>(plugin) { @Override public void onResult(Integer result) { plugin.getLogger().info(String.format("Reloaded %d shops because a new world '%s' was loaded", result, worldName)); plugin.debug(String.format("Reloaded %d shops because a new world '%s' was loaded", result, worldName)); } }); }
@EventHandler private void onWorldLoad( WorldLoadEvent event ) { final UUID uuid = WorldDimension.getUUIDOfWorld( event.getWorld() ); if ( uuid == null ) return; core.getOriginObject().getServer().getScheduler().runTaskAsynchronously( core.getOriginObject(), () -> { loadedWorldData.put( uuid, WorldData.load( core, event.getWorld() ) ); core.getOriginObject().getServer().getScheduler().callSyncMethod( core.getOriginObject(), worldDataLoadedCallback.call( uuid ) ); } ); }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onWorldLoad(WorldLoadEvent event) { for (Map.Entry<String, String> entry : new HashMap<>(UNLOADED_HOLOGRAMS).entrySet()) { if (entry.getValue().equals(event.getWorld().getName())) { HoloAPI.LOG.info("Loading hologram " + entry.getKey() + " into world " + entry.getValue() + "."); if (((SimpleHoloManager) HoloAPI.getManager()).loadFromFile(entry.getKey()) != null) { UNLOADED_HOLOGRAMS.remove(entry.getKey()); } } } }
@EventHandler(priority = EventPriority.MONITOR) public void onWorldLoad(WorldLoadEvent e) { if (plugin.worlds.containsKey(e.getWorld().getName())) { plugin.worlds.remove(e.getWorld().getName()); } plugin.worlds.put(e.getWorld().getName(), new WorldConfig(plugin.redisDatabase, e.getWorld().getName(), plugin.getConfig().getString("uniqueid"))); }
private void onWorldLoad(WorldLoadEvent event) { List<IArena> arenas = PVStarAPI.getArenaManager().getArenas(); for (IArena arena : arenas) { if (arena.getRegion().isDefined()) { String worldName = arena.getRegion().getWorldName(); if (event.getWorld().getName().equals(worldName) && arena.getSettings().isConfigEnabled()) { arena.getSettings().setTransientEnabled(true); } } } }
@Override public World createWorld(WorldCreator creator) { Validate.notNull(creator, "Creator may not be null"); String name = creator.name(); ChunkGenerator generator = creator.generator(); File folder = new File(getWorldContainer(), name); World world = getWorld(name); net.minecraft.world.WorldType type = net.minecraft.world.WorldType.parseWorldType(creator.type().getName()); boolean generateStructures = creator.generateStructures(); if ((folder.exists()) && (!folder.isDirectory())) { throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder"); } if (world != null) { return world; } boolean hardcore = false; WorldSettings worldSettings = new WorldSettings(creator.seed(), net.minecraft.world.WorldSettings.GameType.getByID(getDefaultGameMode().getValue()), generateStructures, hardcore, type); net.minecraft.world.WorldServer worldserver = DimensionManager.initDimension(creator, worldSettings); pluginManager.callEvent(new WorldInitEvent(worldserver.getWorld())); net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = true; System.out.print("Preparing start region for level " + (console.worlds.size() - 1) + " (Dimension: " + worldserver.provider.dimensionId + ", Seed: " + worldserver.getSeed() + ")"); // Cauldron - log dimension if (worldserver.getWorld().getKeepSpawnInMemory()) { short short1 = 196; long i = System.currentTimeMillis(); for (int j = -short1; j <= short1; j += 16) { for (int k = -short1; k <= short1; k += 16) { long l = System.currentTimeMillis(); if (l < i) { i = l; } if (l > i + 1000L) { int i1 = (short1 * 2 + 1) * (short1 * 2 + 1); int j1 = (j + short1) * (short1 * 2 + 1) + k + 1; System.out.println("Preparing spawn area for " + worldserver.getWorld().getName() + ", " + (j1 * 100 / i1) + "%"); i = l; } net.minecraft.util.ChunkCoordinates chunkcoordinates = worldserver.getSpawnPoint(); worldserver.theChunkProviderServer.loadChunk(chunkcoordinates.posX + j >> 4, chunkcoordinates.posZ + k >> 4); } } } pluginManager.callEvent(new WorldLoadEvent(worldserver.getWorld())); net.minecraftforge.cauldron.CauldronHooks.craftWorldLoading = false; return worldserver.getWorld(); }
@EventHandler public void onWorldLoad(WorldLoadEvent e) { loadDuctsSync(e.getWorld()); }
@EventHandler(ignoreCancelled = true) public void onWorldLoad(WorldLoadEvent event) { plugin.signDB.updateAttachedBlocks(); }
@EventHandler(priority = EventPriority.MONITOR) public void onWorldLoadEvent(WorldLoadEvent event) { WorldGuardExtraFlagsPlugin.doUnloadChunkFlagWorldCheck(event.getWorld()); }
@EventHandler(priority = EventPriority.NORMAL) public void onWorldLoad(WorldLoadEvent event) { prepareWorld(event.getWorld()); }
@EventHandler public void onLoad2(WorldLoadEvent e) { for (Chunk c : e.getWorld().getLoadedChunks()) { plugin.cleanChunk(c); } }
@EventHandler public void onWorldLoad(WorldLoadEvent worldLoadEvent) { checkSafety(worldLoadEvent); }
@EventHandler public void on(WorldLoadEvent e) { installWorld(e.getWorld()); }
@HookHandler(priority = Priority.CRITICAL) public void onWorldLoad(final LoadWorldHook hook) { server.getPluginManager().callEvent(new WorldLoadEvent(new CanaryWorld(hook.getWorld()))); }
@EventHandler public void worldLoad(final WorldLoadEvent event) { UUIDHandler.cacheAll(event.getWorld().getName()); }
@Override public void eventTrigger(Event event) { if(event.getEventName().equalsIgnoreCase("playerjoinevent")){ eh.onPlayerJoin((PlayerJoinEvent)event); } else if(event.getEventName().equalsIgnoreCase("playerquitevent")){ eh.onPlayerQuit((PlayerQuitEvent)event); } else if(event.getEventName().equalsIgnoreCase("inventoryopenevent")){ eh.onPlayerOpenInventory((InventoryOpenEvent)event); } else if(event.getEventName().equalsIgnoreCase("playerinteractevent")){ eh.onPlayerInteract((PlayerInteractEvent)event); } else if(event.getEventName().equalsIgnoreCase("entitydamagebyentityevent")){ eh.onEntityDamageByEntity((EntityDamageByEntityEvent) event); } else if(event.getEventName().equalsIgnoreCase("weapondamageentityevent")){ eh.onWeaponDamageEntity((WeaponDamageEntityEvent) event); } else if(event.getEventName().equalsIgnoreCase("playeritemheldevent")){ eh.onPlayerItemHeld((PlayerItemHeldEvent) event); } else if(event.getEventName().equalsIgnoreCase("inventoryclickevent")){ eh.onInventoryClick((InventoryClickEvent) event); } else if(event.getEventName().equalsIgnoreCase("entityexplodeevent")){ eh.onEntityExplode((EntityExplodeEvent) event); } else if(event.getEventName().equalsIgnoreCase("playerrespawnevent")){ eh.onPlayerRespawn((PlayerRespawnEvent) event); } else if(event.getEventName().equalsIgnoreCase("foodlevelchangeevent")){ eh.onFoodLevelChange((FoodLevelChangeEvent) event); } else if(event.getEventName().equalsIgnoreCase("playermoveevent")){ eh.onPlayerMove((PlayerMoveEvent) event); } else if(event.getEventName().equalsIgnoreCase("playerdeathevent")){ eh.onPlayerDeath((PlayerDeathEvent) event); } else if(event.getEventName().equalsIgnoreCase("playerdropitemevent")){ eh.onPlayerDrop((PlayerDropItemEvent) event); } else if(event.getEventName().equalsIgnoreCase("worldloadevent")){ eh.onWorldLoad((WorldLoadEvent) event); } }
public void onWorldLoad(WorldLoadEvent event) { Crystal c = new Crystal(); c.initCrystal(); gHubConfig ghc = new gHubConfig(); ghc.retrieve(); }
@Override public void eventTrigger(Event event) { if(event.getEventName().equalsIgnoreCase("playerjoinevent")){ eh.onPlayerJoin((PlayerJoinEvent)event); } else if(event.getEventName().equalsIgnoreCase("playerdropitemevent")){ eh.onPlayerDrop((PlayerDropItemEvent)event); } else if(event.getEventName().equalsIgnoreCase("playerinteractevent")){ eh.onPlayerInteract((PlayerInteractEvent)event); } else if(event.getEventName().equalsIgnoreCase("inventoryclickevent")){ eh.onInventoryClick((InventoryClickEvent)event); } else if(event.getEventName().equalsIgnoreCase("playertoggleflightevent")){ eh.onPlayerToggleFlight((PlayerToggleFlightEvent)event); } else if(event.getEventName().equalsIgnoreCase("playermoveevent")){ eh.onPlayerMove((PlayerMoveEvent)event); } else if(event.getEventName().equalsIgnoreCase("playerdropitemevent")){ eh.onPlayerDrop((PlayerDropItemEvent) event); } else if(event.getEventName().equalsIgnoreCase("playerinteractentityevent")){ eh.onPlayerInteractEntity((PlayerInteractEntityEvent) event); } else if(event.getEventName().equalsIgnoreCase("entitydamagebyentityevent")){ eh.onEntityDamageByEntity((EntityDamageByEntityEvent) event); } else if(event.getEventName().equalsIgnoreCase("playerquitevent")){ eh.onPlayerLeave((PlayerQuitEvent) event); } else if(event.getEventName().equalsIgnoreCase("foodlevelchangeevent")){ eh.onFoodLevelChange((FoodLevelChangeEvent) event); } else if(event.getEventName().equalsIgnoreCase("entitydamageevent")){ eh.onEntityDamage((EntityDamageEvent) event); } else if(event.getEventName().equalsIgnoreCase("weatherchangeevent")){ eh.onWeatherChange((WeatherChangeEvent) event); } else if(event.getEventName().equalsIgnoreCase("inventoryinteractevent")){ eh.onInventoryInteract((InventoryInteractEvent) event); } else if(event.getEventName().equalsIgnoreCase("worldloadevent")){ eh.onWorldLoad((WorldLoadEvent) event); } }
public void onWorldLoad(WorldLoadEvent event){ check("onWorldLoad", event); }
@EventHandler public void WorldLoadEvent(WorldLoadEvent event){ library.onWorldLoad(event); }