當前位置: 首頁>>代碼示例>>Java>>正文


Java Biome類代碼示例

本文整理匯總了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;
        }
    }
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:12,代碼來源:CraftWorld.java

示例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);
        }
    }
}
 
開發者ID:tastybento,項目名稱:bskyblock,代碼行數:25,代碼來源:IslandGuard.java

示例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;
}
 
開發者ID:IzzelAliz,項目名稱:TalentZzzz,代碼行數:9,代碼來源:BasicTerrainGenerator.java

示例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;

}
 
開發者ID:Qballl,項目名稱:WildernessTp,代碼行數:22,代碼來源:Checks.java

示例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
	}
}
 
開發者ID:nfell2009,項目名稱:Skript,代碼行數:24,代碼來源:ClassesTest.java

示例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());
}
 
開發者ID:CardinalDevelopment,項目名稱:EllyCommand,代碼行數:19,代碼來源:ProviderRegistry.java

示例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;
}
 
開發者ID:Samistine,項目名稱:BloodMoon,代碼行數:25,代碼來源:DungeonProperties.java

示例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;
        }
    }
}
 
開發者ID:Pishka,項目名稱:UOConverter,代碼行數:19,代碼來源:LandWorker.java

示例9: biomeBaseToBiome

import org.bukkit.block.Biome; //導入依賴的package包/類
public static Biome biomeBaseToBiome(BiomeGenBase base) {
    if (base == null) {
        return null;
    }

    return BIOME_MAPPING[base.biomeID];
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:8,代碼來源:CraftBlock.java

示例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;
}
 
開發者ID:tastybento,項目名稱:bskyblock,代碼行數:36,代碼來源:SchematicsMgr.java

示例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;
}
 
開發者ID:tastybento,項目名稱:bskyblock,代碼行數:10,代碼來源:Schematic.java

示例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;
}
 
開發者ID:StarWishsama,項目名稱:Slimefun4-Chinese-Version,代碼行數:10,代碼來源:NetherIceResource.java

示例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();
}
 
開發者ID:StarWishsama,項目名稱:Slimefun4-Chinese-Version,代碼行數:16,代碼來源:OreGenSystem.java

示例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());
    }
}
 
開發者ID:StarWishsama,項目名稱:Slimefun4-Chinese-Version,代碼行數:12,代碼來源:OreGenSystem.java

示例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);
	}
}
 
開發者ID:smessie,項目名稱:SkyWarsReloaded,代碼行數:30,代碼來源:Game.java


注:本文中的org.bukkit.block.Biome類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。