本文整理汇总了Java中org.bukkit.World.Environment方法的典型用法代码示例。如果您正苦于以下问题:Java World.Environment方法的具体用法?Java World.Environment怎么用?Java World.Environment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.World
的用法示例。
在下文中一共展示了World.Environment方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isObfuscated
import org.bukkit.World; //导入方法依赖的package包/类
public static boolean isObfuscated(int id, World.Environment environment) {
if (id < 0)
id += 256;
// Nether case
if (environment == World.Environment.NETHER) {
return id == 87 || NetherObfuscateBlocks[id];
}
// Normal case
return id == 1 || ObfuscateBlocks[id];
}
示例2: createWorld
import org.bukkit.World; //导入方法依赖的package包/类
/**
* Create World.
*
* @param name the name of the world to create
* @param environment the world Environment
* @param preGenerate if the world is loaded or not
*/
public void createWorld(@NonNull String name, @NonNull World.Environment environment, boolean preGenerate){
if (existWorld(name)) {
plugin.debugLog("Este mundo ya existe");
return;
}
World w = plugin.getServer().createWorld(new WorldCreator(name).environment(environment));
plugin.debugLog("Mundo creado " + name);
if (preGenerate){
generateWorld(w, 500);
}
//More
}
示例3: GlowstoneMountainFaction
import org.bukkit.World; //导入方法依赖的package包/类
public GlowstoneMountainFaction() {
super("GlowstoneMountain");
this.safezone = false;
for (World world : Bukkit.getWorlds()) {
int radius = SettingsYML.SPAWN_RADIUS_MAP.get(world.getEnvironment());
if (radius > 0) {
addClaim(new Claim(this, new Location(world, radius, 0, radius), new Location(world, -radius, world.getMaxHeight(), -radius)), null);
final World.Environment environment = world.getEnvironment();
if (environment != World.Environment.THE_END) {
}
}
}
}
示例4: NorthRoadFaction
import org.bukkit.World; //导入方法依赖的package包/类
public NorthRoadFaction() {
super("NorthRoad");
for (World world : Bukkit.getWorlds()) {
World.Environment environment = world.getEnvironment();
if (environment != World.Environment.THE_END) {
int roadLength = SettingsYML.ROAD_LENGTHS.get(environment);
int offset = SettingsYML.SPAWN_RADIUS_MAP.get(environment) + 1;
addClaim(new Claim(this, new Location(world, -ROAD_WIDTH_LEFT, ROAD_MIN_HEIGHT, -offset), new Location(world, ROAD_WIDTH_RIGHT, ROAD_MAX_HEIGHT, -roadLength + ROAD_EDGE_DIFF)),
null);
}
}
}
示例5: EastRoadFaction
import org.bukkit.World; //导入方法依赖的package包/类
public EastRoadFaction() {
super("EastRoad");
for (World world : Bukkit.getWorlds()) {
World.Environment environment = world.getEnvironment();
if (environment != World.Environment.THE_END) {
int roadLength = SettingsYML.ROAD_LENGTHS.get(environment);
int offset = SettingsYML.SPAWN_RADIUS_MAP.get(environment) + 1;
addClaim(new Claim(this, new Location(world, offset, ROAD_MIN_HEIGHT, -ROAD_WIDTH_LEFT), new Location(world, roadLength - ROAD_EDGE_DIFF, ROAD_MAX_HEIGHT, ROAD_WIDTH_RIGHT)), null);
}
}
}
示例6: SouthRoadFaction
import org.bukkit.World; //导入方法依赖的package包/类
public SouthRoadFaction() {
super("SouthRoad");
for (World world : Bukkit.getWorlds()) {
World.Environment environment = world.getEnvironment();
if (environment != World.Environment.THE_END) {
int roadLength = SettingsYML.ROAD_LENGTHS.get(environment);
int offset = SettingsYML.SPAWN_RADIUS_MAP.get(environment) + 1;
addClaim(new Claim(this, new Location(world, ROAD_WIDTH_LEFT, ROAD_MIN_HEIGHT, offset), new Location(world, -ROAD_WIDTH_RIGHT, ROAD_MAX_HEIGHT, roadLength - ROAD_EDGE_DIFF)), null);
}
}
}
示例7: WestRoadFaction
import org.bukkit.World; //导入方法依赖的package包/类
public WestRoadFaction() {
super("WestRoad");
for (World world : Bukkit.getWorlds()) {
World.Environment environment = world.getEnvironment();
if (environment != World.Environment.THE_END) {
int roadLength = SettingsYML.ROAD_LENGTHS.get(environment);
int offset = SettingsYML.SPAWN_RADIUS_MAP.get(environment) + 1;
addClaim(new Claim(this, new Location(world, -offset, ROAD_MIN_HEIGHT, ROAD_WIDTH_LEFT), new Location(world, -roadLength + ROAD_EDGE_DIFF, ROAD_MAX_HEIGHT, -ROAD_WIDTH_RIGHT)),
null);
}
}
}
示例8: createWorld
import org.bukkit.World; //导入方法依赖的package包/类
public World createWorld(String name, World.Environment environment) {
return WorldCreator.name(name).environment(environment).createWorld();
}
示例9: getRandomBlock
import org.bukkit.World; //导入方法依赖的package包/类
public static int getRandomBlock(int index, boolean alternate, World.Environment environment) {
if (environment == World.Environment.NETHER)
return (int) (NetherRandomBlocks[index]);
return (int) (alternate ? RandomBlocks2[index] : RandomBlocks[index]);
}
示例10: getRandomBlocks
import org.bukkit.World; //导入方法依赖的package包/类
public static Integer[] getRandomBlocks(boolean alternate, World.Environment environment) {
if (environment == World.Environment.NETHER)
return NetherRandomBlocks;
return (alternate ? RandomBlocks2 : RandomBlocks);
}