Java Code Examples for org.bukkit.World.Environment#NORMAL
The following examples show how to use
org.bukkit.World.Environment#NORMAL .
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: NMS_1_14.java From 1.13-Command-API with Apache License 2.0 | 5 votes |
@Override public Environment getDimension(CommandContext cmdCtx, String key) { DimensionManager manager = ArgumentDimension.a(cmdCtx, key); switch (manager.getDimensionID()) { case 0: return Environment.NORMAL; case -1: return Environment.NETHER; case 1: return Environment.THE_END; } return null; }
Example 2
Source File: NMS_1_15.java From 1.13-Command-API with Apache License 2.0 | 5 votes |
@Override public Environment getDimension(CommandContext cmdCtx, String key) { DimensionManager manager = ArgumentDimension.a(cmdCtx, key); switch (manager.getDimensionID()) { case 0: return Environment.NORMAL; case -1: return Environment.NETHER; case 1: return Environment.THE_END; } return null; }
Example 3
Source File: NMS_1_13_2.java From 1.13-Command-API with Apache License 2.0 | 5 votes |
@Override public Environment getDimension(CommandContext cmdCtx, String key) { DimensionManager manager = ArgumentDimension.a(cmdCtx, key); switch (manager.getDimensionID()) { case 0: return Environment.NORMAL; case -1: return Environment.NETHER; case 1: return Environment.THE_END; } return null; }
Example 4
Source File: NMS_1_14_4.java From 1.13-Command-API with Apache License 2.0 | 5 votes |
@Override public Environment getDimension(CommandContext cmdCtx, String key) { DimensionManager manager = ArgumentDimension.a(cmdCtx, key); switch (manager.getDimensionID()) { case 0: return Environment.NORMAL; case -1: return Environment.NETHER; case 1: return Environment.THE_END; } return null; }
Example 5
Source File: NMS_1_14_3.java From 1.13-Command-API with Apache License 2.0 | 5 votes |
@Override public Environment getDimension(CommandContext cmdCtx, String key) { DimensionManager manager = ArgumentDimension.a(cmdCtx, key); switch (manager.getDimensionID()) { case 0: return Environment.NORMAL; case -1: return Environment.NETHER; case 1: return Environment.THE_END; } return null; }
Example 6
Source File: NMS_1_13_1.java From 1.13-Command-API with Apache License 2.0 | 5 votes |
@Override public Environment getDimension(CommandContext cmdCtx, String key) { DimensionManager manager = ArgumentDimension.a(cmdCtx, key); switch (manager.getDimensionID()) { case 0: return Environment.NORMAL; case -1: return Environment.NETHER; case 1: return Environment.THE_END; } return null; }
Example 7
Source File: ImportCommand.java From DungeonsXL with GNU General Public License v3.0 | 5 votes |
@Override public void onExecute(String[] args, CommandSender sender) { File target = new File(DungeonsXL.MAPS, args[1]); File source = new File(Bukkit.getWorldContainer(), args[1]); if (!source.exists()) { MessageUtil.sendMessage(sender, DMessage.ERROR_NO_SUCH_MAP.getMessage(args[1])); return; } if (target.exists()) { MessageUtil.sendMessage(sender, DMessage.ERROR_NAME_IN_USE.getMessage(args[1])); return; } World world = Bukkit.getWorld(args[1]); if (world != null) { world.save(); } MessageUtil.log(plugin, "&6Creating new map."); MessageUtil.log(plugin, "&6Importing world..."); FileUtil.copyDir(source, target, "playerdata", "stats"); DResourceWorld resource = new DResourceWorld(plugin, args[1]); plugin.getDungeonRegistry().add(args[1], new DDungeon(plugin, resource)); if (world.getEnvironment() != Environment.NORMAL) { WorldConfig config = resource.getConfig(true); config.setWorldEnvironment(world.getEnvironment()); config.save(); } plugin.getMapRegistry().add(resource.getName(), resource); MessageUtil.sendMessage(sender, DMessage.CMD_IMPORT_SUCCESS.getMessage(args[1])); }
Example 8
Source File: ArmorTask.java From Slimefun4 with GNU General Public License v3.0 | 5 votes |
private boolean hasSunlight(Player p) { World world = p.getWorld(); if (world.getEnvironment() != Environment.NORMAL) { // The End and Nether have no sunlight return false; } return (world.getTime() < 12300 || world.getTime() > 23850) && p.getEyeLocation().getBlock().getLightFromSky() == 15; }
Example 9
Source File: UraniumResource.java From Slimefun4 with GNU General Public License v3.0 | 5 votes |
@Override public int getDefaultSupply(Environment envionment, Biome biome) { if (envionment == Environment.NORMAL) { return 5; } return 0; }
Example 10
Source File: SaltResource.java From Slimefun4 with GNU General Public License v3.0 | 5 votes |
@Override public int getDefaultSupply(Environment environment, Biome biome) { if (environment != Environment.NORMAL) { return 0; } switch (biome) { case SNOWY_BEACH: case STONE_SHORE: case BEACH: case DESERT_LAKES: case RIVER: case ICE_SPIKES: case FROZEN_RIVER: return 40; case DEEP_OCEAN: case OCEAN: case COLD_OCEAN: case DEEP_COLD_OCEAN: case DEEP_FROZEN_OCEAN: case DEEP_LUKEWARM_OCEAN: case DEEP_WARM_OCEAN: case FROZEN_OCEAN: case LUKEWARM_OCEAN: case WARM_OCEAN: return 60; case SWAMP: case SWAMP_HILLS: return 20; default: return 6; } }
Example 11
Source File: CarbonWorldGenerator.java From Carbon with GNU Lesser General Public License v3.0 | 5 votes |
@EventHandler public void onWorldInit(WorldInitEvent event) { //Add new chunkprovidergenerate if (plugin.getConfig().getStringList("options.worlds").contains(event.getWorld().getName()) && event.getWorld().getEnvironment() == Environment.NORMAL) { WorldServer nmsWorld = ((CraftWorld) event.getWorld()).getHandle(); nmsWorld.chunkProviderServer.chunkProvider = new ChunkProviderGenerate(nmsWorld, nmsWorld.getSeed(), nmsWorld.getWorldData().shouldGenerateMapFeatures()); } }
Example 12
Source File: TeleportListener.java From UhcCore with GNU General Public License v3.0 | 4 votes |
@EventHandler(priority = EventPriority.HIGHEST) public void onPlayerPortalEvent (PlayerPortalEvent event){ GameManager gm = GameManager.getGameManager(); Player player = event.getPlayer(); // Disable nether/end in deathmatch if (gm.getGameState() == GameState.DEATHMATCH){ event.setCancelled(true); return; } if (event.getCause() == TeleportCause.NETHER_PORTAL) { if (!gm.getConfiguration().getEnableNether()){ player.sendMessage(Lang.PLAYERS_NETHER_OFF); event.setCancelled(true); return; } // No Going back! if (gm.getScenarioManager().isActivated(Scenario.NOGOINGBACK) && event.getFrom().getWorld().getEnvironment() == Environment.NETHER){ player.sendMessage(Lang.SCENARIO_NOGOINGBACK_ERROR); event.setCancelled(true); return; } // Handle event using versions utils as on 1.14+ PortalTravelAgent got removed. VersionUtils.getVersionUtils().handleNetherPortalEvent(event); }else if (event.getCause() == TeleportCause.END_PORTAL){ if (gm.getConfiguration().getEnableTheEnd() && event.getFrom().getWorld().getEnvironment() == Environment.NORMAL){ // Teleport to end Location end = new Location(Bukkit.getWorld(gm.getConfiguration().getTheEndUuid()), -42, 48, -18); createEndSpawnAir(end); createEndSpawnObsidian(end); event.setTo(end); } } }
Example 13
Source File: DResourceWorld.java From DungeonsXL with GNU General Public License v3.0 | 4 votes |
@Override public Environment getWorldEnvironment() { return (config != null && config.getWorldEnvironment() != null) ? config.getWorldEnvironment() : Environment.NORMAL; }
Example 14
Source File: OilResource.java From Slimefun4 with GNU General Public License v3.0 | 4 votes |
@Override public int getDefaultSupply(Environment environment, Biome biome) { if (environment != Environment.NORMAL) { return 0; } switch (biome) { case SNOWY_BEACH: case STONE_SHORE: case BEACH: return 6; case DESERT: case DESERT_HILLS: case DESERT_LAKES: return 45; case MOUNTAINS: case GRAVELLY_MOUNTAINS: case MOUNTAIN_EDGE: case RIVER: return 17; case SNOWY_MOUNTAINS: case SNOWY_TUNDRA: case ICE_SPIKES: case FROZEN_OCEAN: case FROZEN_RIVER: return 14; case BADLANDS: case BADLANDS_PLATEAU: case WOODED_BADLANDS_PLATEAU: case ERODED_BADLANDS: case MODIFIED_BADLANDS_PLATEAU: case MODIFIED_WOODED_BADLANDS_PLATEAU: case MUSHROOM_FIELDS: case MUSHROOM_FIELD_SHORE: return 24; case DEEP_OCEAN: case OCEAN: case COLD_OCEAN: case DEEP_COLD_OCEAN: case DEEP_FROZEN_OCEAN: case DEEP_LUKEWARM_OCEAN: case DEEP_WARM_OCEAN: case LUKEWARM_OCEAN: case WARM_OCEAN: return 62; case SWAMP: case SWAMP_HILLS: return 20; default: return 10; } }
Example 15
Source File: ChunkPacketProcessor.java From PacketWrapper with GNU Lesser General Public License v3.0 | 2 votes |
/** * Retrieve the number of 2048 byte segments per chunklet. * <p< * This is usually one for The Overworld, and zero for both The End and The Nether. * @return Number of skylight byte segments. */ protected int getSkylightCount() { // There's no sun/moon in the end or in the nether, so Minecraft doesn't sent any skylight information // This optimization was added in 1.4.6. Note that ideally you should get this from the "f" (skylight) field. return world.getEnvironment() == Environment.NORMAL ? 1 : 0; }