本文整理匯總了Java中org.bukkit.event.world.WorldInitEvent.getWorld方法的典型用法代碼示例。如果您正苦於以下問題:Java WorldInitEvent.getWorld方法的具體用法?Java WorldInitEvent.getWorld怎麽用?Java WorldInitEvent.getWorld使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.event.world.WorldInitEvent
的用法示例。
在下文中一共展示了WorldInitEvent.getWorld方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onWorldInit
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onWorldInit(WorldInitEvent event) {
World world = event.getWorld();
plugin.createConfig(world);
/*if (plugin.isFeatureEnabled(world.getName(), Feature.SPAWN_CONTROL)){
WorldServer worldServer = ((CraftWorld) world).getHandle();
try{
IChunkLoader chunkLoader = ReflectionUtils.getFieldValue(net.minecraft.server.v1_8_R1.ChunkProviderServer.class, "chunkLoader", IChunkLoader.class, worldServer.chunkProviderServer);
ChunkProviderServer newProvider = new ChunkProviderServer(this.plugin, worldServer, chunkLoader, worldServer.chunkProviderServer.chunkProvider);
newProvider.chunks = worldServer.chunkProviderServer.chunks;
newProvider.forceChunkLoad = worldServer.chunkProviderServer.forceChunkLoad;
worldServer.chunkProviderServer = newProvider;
}catch (NoSuchFieldException e){
e.printStackTrace();
}
}*/
}
示例2: onWorldInit
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onWorldInit(WorldInitEvent event) {
World world = event.getWorld();
String name = world.getName();
PlotAreaManager manager = PS.get().getPlotAreaManager();
if (manager instanceof SinglePlotAreaManager) {
SinglePlotAreaManager single = (SinglePlotAreaManager) manager;
if (single.isWorld(name)) {
world.setKeepSpawnInMemory(false);
return;
}
}
ChunkGenerator gen = world.getGenerator();
if (gen instanceof GeneratorWrapper) {
PS.get().loadWorld(name, (GeneratorWrapper<?>) gen);
} else {
PS.get().loadWorld(name, new BukkitPlotGenerator(name, gen));
}
}
示例3: onWorldLoad
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler
public void onWorldLoad(WorldInitEvent evt) {
if (noSpawnChunks) {
World world = evt.getWorld();
world.setKeepSpawnInMemory(false);
AzureAPI.log("已為世界 " + world.getName() + " 設定不保留出生區塊.");
}
}
示例4: WorldSeterLimitor
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler
public void WorldSeterLimitor(WorldInitEvent event) {
World world = event.getWorld();
FileConfiguration config = EscapeLag.configOptimize.getValue();
if (config.getBoolean("WorldSpawnLimitor." + world.getName() + ".enable")) {
world.setMonsterSpawnLimit(config.getInt("WorldSpawnLimitor." + world.getName() + ".PerChunkMonsters"));
world.setAnimalSpawnLimit(config.getInt("WorldSpawnLimitor." + world.getName() + ".PerChunkAnimals"));
world.setAmbientSpawnLimit(config.getInt("WorldSpawnLimitor." + world.getName() + ".PerChunkAmbient"));
EscapeLag.MainThis.getLogger().info("已為世界 " + world.getName() + " 設定了生物刷新速率~");
}
}
示例5: onWorldInit
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.LOWEST)
public void onWorldInit(WorldInitEvent event) {
World world = event.getWorld();
world.setAutoSave(false);
world.setKeepSpawnInMemory(false);
world.setSpawnFlags(false, false);
}
示例6: onWorldInit
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onWorldInit(WorldInitEvent event) {
World world = event.getWorld();
if (plugin.isEnabled(world) && plugin.isFeatureEnabled(world, Feature.DUNGEONS)) {
world.getPopulators().add(new DungeonGenerator(plugin));
}
}
示例7: onWorldLoad
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler
public static void onWorldLoad(WorldInitEvent event) {
if (disableChunkLoad) {
World world = event.getWorld();
world.setKeepSpawnInMemory(false);
}
}
示例8: onWorldInit
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public static void onWorldInit(final WorldInitEvent event) {
final World world = event.getWorld();
String name = getName(world);
final ChunkGenerator gen = world.getGenerator();
if (gen instanceof PlotGenerator) {
//
PlotSquared.loadWorld(name, (PlotGenerator) gen);
} else {
if (PlotSquared.config.contains("worlds." + name)) {
PlotSquared.loadWorld(name, null);
}
}
lastWorld = null;
}
示例9: onWorldInit
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onWorldInit(WorldInitEvent event)
{
World world = event.getWorld();
plugin.getDataHandler().loadWorld(world);
plugin.getPermissionHandler().registerWorld(world);
}
示例10: onWorldInit
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
/**
* Monitor WorldInit events.
*
* @param event The event to watch
*/
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onWorldInit(WorldInitEvent event) {
World world = event.getWorld();
if (!new File(world.getWorldFolder(), "mcmmo_data").exists() || plugin == null) {
return;
}
plugin.getLogger().info("Converting block storage for " + world.getName() + " to a new format.");
new BlockStoreConversionMain(world).run();
}
示例11: onWorldInit
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler
public void onWorldInit(WorldInitEvent event) {
World world = event.getWorld();
for (MagicWorld notifyWorld : magicWorlds.values()) {
notifyWorld.onWorldInit(plugin, world);
}
MagicWorld magicWorld = magicWorlds.get(world.getName());
if (magicWorld == null) return;
logger.info("Initializing world " + world.getName());
magicWorld.installPopulators(world);
}
示例12: onWorldInit
import org.bukkit.event.world.WorldInitEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.MONITOR)
public void onWorldInit(WorldInitEvent event)
{
World world = event.getWorld();
if (plugin.isAllWorlds() || plugin.getWorlds().contains(world.getName().toLowerCase()))
world.setKeepSpawnInMemory(plugin.isKeepSpawnInMemory());
}