本文整理汇总了Java中org.bukkit.block.Biome类的典型用法代码示例。如果您正苦于以下问题:Java Biome类的具体用法?Java Biome怎么用?Java Biome使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Biome类属于org.bukkit.block包,在下文中一共展示了Biome类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setBiome
import org.bukkit.block.Biome; //导入依赖的package包/类
public void setBiome(int x, int z, Biome bio) {
net.minecraft.world.biome.BiomeGenBase bb = CraftBlock.biomeToBiomeBase(bio);
if (this.world.blockExists(x, 0, z)) {
net.minecraft.world.chunk.Chunk chunk = this.world.getChunkFromBlockCoords(x, z);
if (chunk != null) {
byte[] biomevals = chunk.getBiomeArray();
biomevals[((z & 0xF) << 4) | (x & 0xF)] = (byte)bb.biomeID;
}
}
}
示例2: onNetherDispenser
import org.bukkit.block.Biome; //导入依赖的package包/类
/**
* Prevents water from being dispensed in hell biomes
*
* @param e
*/
@EventHandler(priority = EventPriority.LOW)
public void onNetherDispenser(final BlockDispenseEvent e) {
if (DEBUG) {
plugin.getLogger().info(e.getEventName());
}
if (!Util.inWorld(e.getBlock().getLocation()) || !e.getBlock().getBiome().equals(Biome.HELL)) {
return;
}
// plugin.getLogger().info("DEBUG: Item being dispensed is " +
// e.getItem().getType().toString());
if (e.getItem().getType().equals(Material.WATER_BUCKET)) {
e.setCancelled(true);
if (plugin.getServer().getVersion().contains("(MC: 1.8") || plugin.getServer().getVersion().contains("(MC: 1.7")) {
e.getBlock().getWorld().playSound(e.getBlock().getLocation(), Sound.valueOf("FIZZ"), 1F, 2F);
} else {
e.getBlock().getWorld().playSound(e.getBlock().getLocation(), Sound.ENTITY_CREEPER_PRIMED, 1F, 2F);
}
}
}
示例3: generateSea
import org.bukkit.block.Biome; //导入依赖的package包/类
private double generateSea(int x, int z, ChunkGenerator.BiomeGrid grid) {
double height = seaAmplitude * seaGenerator.noise(x * seaFreq, z * seaFreq);
if (height < -0.05) {
grid.setBiome((x % 16 + 16) % 16, (z % 16 + 16) % 16, Biome.OCEAN);
if (height < -0.2) grid.setBiome((x % 16 + 16) % 16, (z % 16 + 16) % 16, Biome.DEEP_OCEAN);
}
return height > 0 ? 0 : height;
}
示例4: getSolidBlock
import org.bukkit.block.Biome; //导入依赖的package包/类
public int getSolidBlock(int x, int z, Player target) {
if(target.getWorld().getBiome(target.getLocation().getBlockX(),target.getLocation().getBlockZ()).equals(Biome.HELL))
return getSolidBlockNether(x,z,target);
int y = 0;
if (!wild.getConfig().getBoolean("InvertYSearch"))
return invertSearch(x,z,target);
else {
if(target.getWorld().getBiome(x,z).equals(Biome.HELL))
return getSolidBlockNether(x,z,target);
for (int i = 0; i <= target.getWorld().getMaxHeight(); i++) {
y = i;
if (!target.getWorld().getBlockAt(x, y, z).isEmpty() && target.getWorld().getBlockAt(x, y + 1, z).isEmpty()
&& target.getWorld().getBlockAt(x, y + 2, z).isEmpty()
&& target.getWorld().getBlockAt(x, y + 3, z).isEmpty()
&& !checkBlocks(target, x, y, z))
return y + 3;
}
}
return 5;
}
示例5: test
import org.bukkit.block.Biome; //导入依赖的package包/类
@Test
public void test() {
final Object[] random = {
// Java
(byte) 127, (short) 2000, -1600000, 1L << 40, -1.5f, 13.37,
"String",
// Skript
Color.BLACK, StructureType.RED_MUSHROOM, WeatherType.THUNDER,
new Date(System.currentTimeMillis()), new Timespan(1337), new Time(12000), new Timeperiod(1000, 23000),
new Experience(15), new Direction(0, Math.PI, 10), new Direction(new double[] {0, 1, 0}),
new EntityType(new SimpleEntityData(HumanEntity.class), 300), new CreeperData(), new SimpleEntityData(Snowball.class), new HorseData(Variant.SKELETON_HORSE), new WolfData(), new XpOrbData(50),
// Bukkit - simple classes only
GameMode.ADVENTURE, Biome.EXTREME_HILLS, DamageCause.FALL,
// there is also at least one variable for each class on my test server which are tested whenever the server shuts down.
};
for (final Object o : random) {
Classes.serialize(o); // includes a deserialisation test
}
}
示例6: registerDefaultProviders
import org.bukkit.block.Biome; //导入依赖的package包/类
private void registerDefaultProviders() {
registerProvider(Boolean.class, new BooleanProvider());
registerProvider(Byte.class, new ByteProvider());
registerProvider(Character.class, new CharacterProvider());
registerProvider(Double.class, new DoubleProvider());
registerProvider(Float.class, new FloatProvider());
registerProvider(Integer.class, new IntegerProvider());
registerProvider(Long.class, new LongProvider());
registerProvider(Short.class, new ShortProvider());
registerProvider(String.class, new StringProvider());
registerProvider(Biome.class, new BiomeProvider());
registerProvider(OfflinePlayer.class, new OfflinePlayerProvider());
registerProvider(OfflinePlayers.class, new OfflinePlayersProvider());
registerProvider(Player.class, new PlayerProvider());
registerProvider(Players.class, new PlayersProvider());
registerProvider(World.class, new WorldProvider());
}
示例7: isInChunk
import org.bukkit.block.Biome; //导入依赖的package包/类
/**
* Checks if this dungeon should generate in a Chunk. This will account for
* the world config as well as location.
*
* @param chunk The chunk to check.
* @return True if it should generate.
*/
public boolean isInChunk(Chunk chunk) {
if (!chunk.getWorld().equals(this.world) || chunk.getX() != this.chunkX || chunk.getZ() != this.chunkZ) {
return false;
}
Biome biome = this.world.getBiome((this.chunkX * 16) + 8, (this.chunkZ * 16) + 8);
if (!this.worldConfig.getStringList(Config.FEATURE_DUNGEONS_BIOMES).contains(biome.name())) {
return false;
}
if (this.getRandom().nextInt(100) > this.worldConfig.getInt(Config.FEATURE_DUNGEONS_CHANCE)) {
return false;
}
return true;
}
示例8: blockPrePlace
import org.bukkit.block.Biome; //导入依赖的package包/类
private void blockPrePlace(LandInfo bl, float x, float y, float z, int id) {
if (f.getName().contains("Felucca"))//we are scanning felucca
{
// UOConverter.log.info("We are scanning felucca!");
if (bl.biomeid == Biome.EXTREME_HILLS.ordinal()) {
mod = UOConverter.UOHillsMod;
}
if (x >= 5120) {
mod = UOConverter.UOmod;
}
}
if (f.getName().contains("Malas"))//we are scanning malas
{
if (bl.biomeid == Biome.EXTREME_HILLS.ordinal()) {
mod = UOConverter.UOHillsMod;
}
}
}
示例9: biomeBaseToBiome
import org.bukkit.block.Biome; //导入依赖的package包/类
public static Biome biomeBaseToBiome(BiomeGenBase base) {
if (base == null) {
return null;
}
return BIOME_MAPPING[base.biomeID];
}
示例10: getSchematics
import org.bukkit.block.Biome; //导入依赖的package包/类
/**
* List schematics this player can access. If @param ignoreNoPermission is true, then only
* schematics with a specific permission set will be checked. I.e., no common schematics will
* be returned (including the default one).
* @param player
* @param ignoreNoPermission
* @return List of schematics this player can use based on their permission level
*/
public List<Schematic> getSchematics(Player player, boolean ignoreNoPermission) {
List<Schematic> result = new ArrayList<>();
// Find out what schematics this player can choose from
//Bukkit.getLogger().info("DEBUG: Checking schematics for " + player.getName());
for (Schematic schematic : schematics.values()) {
//Bukkit.getLogger().info("DEBUG: schematic name is '"+ schematic.getName() + "'");
//Bukkit.getLogger().info("DEBUG: perm is " + schematic.getPerm());
if ((!ignoreNoPermission && schematic.getPerm().isEmpty()) || VaultHelper.hasPerm(player, schematic.getPerm())) {
//Bukkit.getLogger().info("DEBUG: player can use this schematic");
// Only add if it's visible
if (schematic.isVisible()) {
// Check if it's a nether island, but the nether is not enables
if (schematic.getBiome().equals(Biome.HELL)) {
if (Settings.netherGenerate && IslandWorld.getNetherWorld() != null) {
result.add(schematic);
}
} else {
result.add(schematic);
}
}
}
}
// Sort according to order
Collections.sort(result, (s1, s2) -> (s2.getOrder() < s1.getOrder()) ? 1 : -1);
return result;
}
示例11: isInNether
import org.bukkit.block.Biome; //导入依赖的package包/类
/**
* @return if Biome is HELL, this is true
*/
public boolean isInNether() {
if (biome == Biome.HELL) {
return true;
}
return false;
}
示例12: getDefaultSupply
import org.bukkit.block.Biome; //导入依赖的package包/类
public int getDefaultSupply(Biome biome)
{
switch($SWITCH_TABLE$org$bukkit$block$Biome()[biome.ordinal()])
{
case 9: // '\t'
return 32;
}
return 0;
}
示例13: registerResource
import org.bukkit.block.Biome; //导入依赖的package包/类
public static void registerResource(OreGenResource resource)
{
map.put(resource.getName(), resource);
System.out.println((new StringBuilder("[Slimefun - GEO] 正在注册矿物生成器: ")).append(resource.getName()).toString());
Config cfg = new Config((new StringBuilder("plugins/Slimefun/generators/")).append(resource.getName()).append(".cfg").toString());
Biome abiome[];
int j = (abiome = Biome.values()).length;
for(int i = 0; i < j; i++)
{
Biome biome = abiome[i];
cfg.setDefaultValue(biome.toString(), Integer.valueOf(resource.getDefaultSupply(biome)));
}
cfg.save();
}
示例14: getDefault
import org.bukkit.block.Biome; //导入依赖的package包/类
private static int getDefault(OreGenResource resource, Biome biome)
{
if(resource == null)
{
return 0;
} else
{
Config cfg = new Config((new StringBuilder("plugins/Slimefun/generators/")).append(resource.getName()).append(".cfg").toString());
return cfg.getInt(biome.toString());
}
}
示例15: setWeather
import org.bukkit.block.Biome; //导入依赖的package包/类
private void setWeather() {
String weather = getWeather();
final World world = SkyWarsReloaded.get().getServer().getWorld(mapName + "_" + gameNumber);
if (weather.equalsIgnoreCase("sunny")) {
world.setStorm(false);
world.setWeatherDuration(Integer.MAX_VALUE);
} else if (weather.equalsIgnoreCase("rain")) {
world.setStorm(true);
world.setWeatherDuration(Integer.MAX_VALUE);
} else if (weather.equalsIgnoreCase("thunder storm")) {
world.setStorm(true);
world.setThundering(true);
world.setThunderDuration(Integer.MAX_VALUE);
world.setWeatherDuration(Integer.MAX_VALUE);
thunderStorm = true;
} else if (weather.equalsIgnoreCase("snow")) {
for (int x = min; x < max; x++) {
for (int z = min; z < max; z++) {
world.setBiome(x, z, Biome.ICE_PLAINS);
}
}
world.setStorm(true);
world.setWeatherDuration(Integer.MAX_VALUE);
List<Chunk> chunks = getChunks();
SkyWarsReloaded.getNMS().updateChunks(mapWorld, chunks);
world.setStorm(true);
world.setWeatherDuration(Integer.MAX_VALUE);
}
}