热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.bukkit.block.Biome类的使用及代码示例

本文整理了Java中org.bukkit.block.Biome类的一些代码示例,展示了Biome类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一

本文整理了Java中org.bukkit.block.Biome类的一些代码示例,展示了Biome类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Biome类的具体详情如下:
包路径:org.bukkit.block.Biome
类名称:Biome

Biome介绍

[英]Holds all accepted Biomes in the default server
[中]在默认服务器中保存所有已接受的生物群落

代码示例

代码示例来源:origin: GlowstoneMC/Glowstone

public Collection getBiomes() {
return Collections.unmodifiableList(Arrays.asList(Biome.values()));
}

代码示例来源:origin: GlowstoneMC/Glowstone

private static void set(int id, Biome biome) {
ids[biome.ordinal()] = id;
biomes[id] = biome;
}

代码示例来源:origin: eccentricdevotion/TARDIS

public TARDISTravelCommands(TARDIS plugin) {
this.plugin = plugin;
for (Biome bi : Biome.values()) {
if (!bi.equals(Biome.NETHER) && !bi.equals(Biome.THE_END) && !bi.equals(Biome.THE_VOID)) {
BIOME_SUBS.add(bi.toString());
}
}
}

代码示例来源:origin: TheBusyBiscuit/Slimefun4

public static void registerResource(OreGenResource resource) {
map.put(resource.getName(), resource);
System.out.println("[Slimefun - GEO] Registering Ore Gen: " + resource.getName());

Config cfg = new Config("plugins/Slimefun/generators/" + resource.getName() + ".cfg");
for (Biome biome: Biome.values()) {
cfg.setDefaultValue(biome.toString(), resource.getDefaultSupply(biome));
}
cfg.save();
}

代码示例来源:origin: EngineHub/CommandHelper

public static void build() {
NULL = new BukkitMCBiomeType(MCVanillaBiomeType.UNKNOWN, null);
for(MCVanillaBiomeType v : MCVanillaBiomeType.values()) {
if(v.existsInCurrent()) {
Biome type;
try {
type = getBukkitType(v);
} catch (IllegalArgumentException | NoSuchFieldError ex) {
CHLog.GetLogger().w(CHLog.Tags.RUNTIME, "Could not find a Bukkit BiomeType for " + v.name(),
Target.UNKNOWN);
continue;
}
BukkitMCBiomeType wrapper = new BukkitMCBiomeType(v, type);
MAP.put(v.name(), wrapper);
BUKKIT_MAP.put(type, wrapper);
}
}
for(Biome b : Biome.values()) {
if(!BUKKIT_MAP.containsKey(b)) {
MAP.put(b.name(), new BukkitMCBiomeType(MCVanillaBiomeType.UNKNOWN, b));
BUKKIT_MAP.put(b, new BukkitMCBiomeType(MCVanillaBiomeType.UNKNOWN, b));
}
}
}

代码示例来源:origin: EngineHub/CommandHelper

private static Biome getBukkitType(MCVanillaBiomeType v) {
return Biome.valueOf(v.name());
}
}

代码示例来源:origin: TheBusyBiscuit/Slimefun4

private static int getDefault(OreGenResource resource, Biome biome) {
if (resource == null) return 0;
Config cfg = new Config("plugins/Slimefun/generators/" + resource.getName() + ".cfg");
return cfg.getInt(biome.toString());
}

代码示例来源:origin: eccentricdevotion/TARDIS

continue;
if (current.getBlock().getBiome().toString().equals(first)) {
continue;
biome = Biome.valueOf(first);
} catch (IllegalArgumentException iae) {

代码示例来源:origin: eccentricdevotion/TARDIS

if (im.hasDisplayName() && im.getDisplayName().equals("TARDIS Biome Reader")) {
Biome biome = event.getClickedBlock().getBiome();
if (TARDISConstants.END_BIOMES.contains(biome) || biome.equals(Biome.NETHER) || biome.equals(Biome.THE_VOID)) {
TARDISMessage.send(player, "BIOME_READER_NOT_VALID");
return;
try {
ItemStack[] disks1 = TARDISSerializeInventory.itemStacksFromString(rs.getBiomesOne());
if (!hasBiomeDisk(disks1, biome.toString())) {
ItemStack[] disks2 = TARDISSerializeInventory.itemStacksFromString(rs.getBiomesTwo());
if (!hasBiomeDisk(disks2, biome.toString())) {
ItemStack bd = new ItemStack(Material.MUSIC_DISC_CAT, 1);
ItemMeta dim = bd.getItemMeta();
dim.setDisplayName("Biome Storage Disk");
List disk_lore = new ArrayList<>();
disk_lore.add(biome.toString());
dim.setLore(disk_lore);
bd.setItemMeta(dim);
whereu.put("uuid", uuid.toString());
new QueryFactory(plugin).doUpdate("storage", set, whereu);
TARDISMessage.send(player, "BIOME_READER_ADDED", biome.toString(), "1");
} else {
slot = getNextFreeSlot(disks2);
whereu.put("uuid", uuid.toString());
new QueryFactory(plugin).doUpdate("storage", set, whereu);
TARDISMessage.send(player, "BIOME_READER_ADDED", biome.toString(), "2");
} else {

代码示例来源:origin: DenizenScript/Denizen-For-Bukkit

public BiomeNMS(Biome biome) {
this.name = biome.name();
}

代码示例来源:origin: eccentricdevotion/TARDIS

for (int row = -3; row <4; row++) {
Biome b = w.getBlockAt(x + col, 64, z + row).getBiome();
if (b.equals(Biome.DEEP_OCEAN)) {
found++;
if (found <3 && !b.equals(Biome.DEEP_OCEAN)) {
if (found == 3 && !b.equals(Biome.DEEP_OCEAN)) {

代码示例来源:origin: eccentricdevotion/TARDIS

public TARDISTravelTabComplete(TARDIS plugin) {
for (Biome bi : org.bukkit.block.Biome.values()) {
if (!bi.equals(Biome.NETHER) && !bi.equals(Biome.THE_END) && !bi.equals(Biome.THE_VOID)) {
BIOME_SUBS.add(bi.toString());
}
}
ROOT_SUBS.addAll(Arrays.asList("home", "biome", "dest", "area", "back", "cave", "village", "cancel", "costs"));
ROOT_SUBS.addAll(plugin.getTardisAPI().getWorlds());
ResultSetAreas rsa = new ResultSetAreas(plugin, null, false, true);
if (rsa.resultSet()) {
AREA_SUBS.addAll(rsa.getNames());
}
}

代码示例来源:origin: eccentricdevotion/TARDIS

for (Biome biome : Biome.values()) {
String b = biome.toString();
if (split.contains(b)) {
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () -> {

代码示例来源:origin: elBukkit/MagicPlugin

@Override
public void prepare(CastContext context, ConfigurationSection parameters)
{
super.prepare(context, parameters);
String biomeKey = parameters.getString("biome", "");
try {
biome = Biome.valueOf(biomeKey.toUpperCase());
} catch (Exception biomeEx) {
context.getLogger().warning("Invalid biome: " + biomeKey);
}
}

代码示例来源:origin: eccentricdevotion/TARDIS

@EventHandler(ignoreCancelled = true)
public void onChunkPopulate(ChunkPopulateEvent event) {
Chunk chunk = event.getChunk();
// check world
if (!chunk.getWorld().getName().equals("Gallifrey")) {
return;
}
if (!chunk.getBlock(7, 63, 7).getBiome().toString().equals("GALLIFREY")) {
return;
}
if (chunks.contains(chunk)) {
return;
}
// scan chunk for STRUCTURE_BLOCK between y = 50 , 70
for (int x = 0; x <16; x++) {
for (int z = 0; z <16; z++) {
for (int y = 50; y <71; y++) {
if (chunk.getBlock(x, y, z).getType().equals(Material.STRUCTURE_BLOCK)) {
buildStructure(chunk, x, y, z);
return;
}
}
}
}
}

代码示例来源:origin: eccentricdevotion/TARDIS

continue;
if (current.getBlock().getBiome().toString().equals(first)) {
continue;
biome = Biome.valueOf(first);
} catch (IllegalArgumentException iae) {

代码示例来源:origin: eccentricdevotion/TARDIS

if (chkb.equals(b)) {
TARDISMessage.send(p, "BIOME_E", b.toString());
return new Location(w, east, w.getHighestBlockYAt(east, startz), startz);
if (chkb.equals(b)) {
TARDISMessage.send(p, "BIOME_S", b.toString());
return new Location(w, startx, w.getHighestBlockYAt(startx, south), south);
if (chkb.equals(b)) {
TARDISMessage.send(p, "BIOME_W", b.toString());
return new Location(w, west, w.getHighestBlockYAt(west, startz), startz);
if (chkb.equals(b)) {
TARDISMessage.send(p, "BIOME_N", b.toString());
return new Location(w, startx, w.getHighestBlockYAt(startx, north), north);

代码示例来源:origin: EngineHub/CommandHelper

@Override
public String concreteName() {
Biome b = getConcrete();
if(b == null) {
return "null";
}
return b.name();
}

代码示例来源:origin: eccentricdevotion/TARDIS

private boolean canSpawn(Location l, int r) {
// get biome
Biome biome = l.getBlock().getRelative(plugin.getGeneralKeeper().getFaces().get(r), 2).getBiome();
if (biome.equals(Biome.MUSHROOM_FIELDS) || biome.equals(Biome.MUSHROOM_FIELD_SHORE)) {
return false;
}
// worldguard
if (plugin.isWorldGuardOnServer() && !plugin.getWorldGuardUtils().mobsCanSpawnAtLocation(l)) {
return false;
}
// difficulty
return !l.getWorld().getDifficulty().equals(Difficulty.PEACEFUL);
}

代码示例来源:origin: eccentricdevotion/TARDIS

submarine = rs.getBoolean("submarine");
try {
biome = Biome.valueOf(rs.getString("biome"));
} catch (IllegalArgumentException e) {

推荐阅读
author-avatar
禾漾啊
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有