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


Java Material.BEDROCK屬性代碼示例

本文整理匯總了Java中org.bukkit.Material.BEDROCK屬性的典型用法代碼示例。如果您正苦於以下問題:Java Material.BEDROCK屬性的具體用法?Java Material.BEDROCK怎麽用?Java Material.BEDROCK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.BEDROCK屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createBlock

/**
 * Makes sure that a certain block exists on the coordinate.
 * Returns that block.
 */
public Block createBlock(Coordinate c)
{
	if (c.y >= height)
		throw new ArrayIndexOutOfBoundsException("Y larger than height");
	else if (c.y < 0)
		throw new ArrayIndexOutOfBoundsException("Y smaller than 0");
	
	Block block;
	if (c.y == 0)
	{
		block = new BlockMock(Material.BEDROCK);
	}
	else if (c.y <= grassHeight)
	{
		block = new BlockMock(defaultBlock);
	}
	else
	{
		block = new BlockMock();
	}
	
	blocks.put(c, block);
	return block;
}
 
開發者ID:seeseemelk,項目名稱:MockBukkit,代碼行數:28,代碼來源:WorldMock.java

示例2: onClickEndPortalFrame

@EventHandler
public void onClickEndPortalFrame(PlayerInteractEvent event) {
	Player player = event.getPlayer();
	World world = player.getWorld();
	Block clickedBlock = event.getClickedBlock();
	if (event.getAction() != Action.RIGHT_CLICK_BLOCK || world.getEnvironment() != Environment.THE_END 
			|| clickedBlock.getType() != Material.BEDROCK || event.getHand() != EquipmentSlot.HAND
			|| (player.getInventory().getItemInMainHand() != null || player.getInventory().getItemInOffHand() != null)) return;
	
	NMSAbstract nmsAbstract = plugin.getNMSAbstract();
	DragonBattle dragonBattle = nmsAbstract.getEnderDragonBattleFromWorld(world);
	Location portalLocation = dragonBattle.getEndPortalLocation();
	
	if (event.getClickedBlock().getLocation().distanceSquared(portalLocation) > 36) return; // 5 blocks
	
	EndWorldWrapper endWorld = plugin.getDEDManager().getWorldWrapper(world);
	int secondsRemaining = endWorld.getTimeUntilRespawn();
	if (secondsRemaining <= 0) return;
	
	plugin.sendMessage(player, "Dragon will respawn in " + ChatColor.YELLOW + secondsRemaining);
}
 
開發者ID:2008Choco,項目名稱:DragonEggDrop,代碼行數:21,代碼來源:PortalClickListener.java

示例3: getMaterial

private Material getMaterial(Location center)
{
    int radius = 2;
    int bX = center.getBlockX();
    int bY = center.getBlockY();
    int bZ = center.getBlockZ();
    int level = 0;
    int x = bX - radius;

    while (x < bX + radius)
    {
        int y = bY - radius;
        while (y < bY + radius)
        {
            int z = bZ - radius;
            while (z < bZ + radius)
            {

                double distance = (bX - x) * (bX - x) + (bZ - z) * (bZ - z) + (bY - y) * (bY - y);
                Location block = new Location(center.getWorld(), (double)x, (double)y, (double)z);
                if (distance < (double)(radius * radius)
                        && (block.getBlock().getType() != Material.BEDROCK)
                        && (block.getBlock().getType() != Material.AIR))
                {
                    if ((level < Priority.getPriority(block.getWorld().getBlockAt(block).getType()).level)
                            &&  ! block.getBlock().hasMetadata("blockBreaker"))
                    {

                        mat = block.getWorld().getBlockAt(block).getType();
                        level = Priority.getPriority(mat).level;
                    }
                } ++ z;
            } ++ y;
        } ++ x;
    }
    return mat;
}
 
開發者ID:ThePhilderbeast,項目名稱:prisonPicks,代碼行數:37,代碼來源:XPickoPlenty.java

示例4: lockFlagIgnored

@Test
public void lockFlagIgnored() throws Throwable {
    ItemStack ref = new ItemStack(Material.BEDROCK);
    ItemStack query = ref.clone();
    ItemTags.LOCKED.set(query, true);
    assertMatches(ref, query);
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:7,代碼來源:ItemMatcherTest.java

示例5: preventSharingFlagIgnored

@Test
public void preventSharingFlagIgnored() throws Throwable {
    ItemStack ref = new ItemStack(Material.BEDROCK);
    ItemStack query = ref.clone();
    ItemTags.PREVENT_SHARING.set(query, true);
    assertMatches(ref, query);
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:7,代碼來源:ItemMatcherTest.java

示例6: run

@Override
public void run() {
	this.animationTime++;
	this.theta += 5;
	
	location.subtract(0, 1 / particleMultiplier, 0);
	if (this.particleStreamInterval < 360) {
		for (int i = 0; i < 360; i += this.particleStreamInterval){
			this.theta += particleStreamInterval;
			this.particleShape.updateVariables(location.getX(), location.getZ(), animationTime, theta);
			this.particleShape.executeExpression(particleType, particleAmount, xOffset, yOffset, zOffset, particleExtra);
		}
	} else {
		this.particleShape.updateVariables(location.getX(), location.getZ(), animationTime, theta);
		this.particleShape.executeExpression(particleType, particleAmount, xOffset, yOffset, zOffset, particleExtra);
	}
	
	// Particles finished, place reward
	if (this.location.getBlock().getType() == Material.BEDROCK) {
		this.location.add(0, 1, 0);
		
		// Summon Zeus!
		for (int i = 0; i < this.lightningAmount; i++)
			this.worldWrapper.getWorld().strikeLightning(location);
		
		DragonBattle dragonBattle = plugin.getNMSAbstract().getEnderDragonBattleFromDragon(dragon);
		DragonTemplate currentBattle = worldWrapper.getActiveBattle();
		
		if (currentBattle != null) {
			currentBattle.getLoot().spawnLootFor(dragonBattle, dragon);
		}

		if (respawnDragon && world.getPlayers().size() > 0 && plugin.getConfig().getBoolean("respawn-on-death", true)) {
			this.worldWrapper.startRespawn(RespawnType.DEATH);
		}
		
		BattleStateChangeEvent bscEventCrystals = new BattleStateChangeEvent(dragonBattle, dragon, BattleState.PARTICLES_START, BattleState.LOOT_SPAWN);
		Bukkit.getPluginManager().callEvent(bscEventCrystals);
		
		this.cancel();
	}
}
 
開發者ID:2008Choco,項目名稱:DragonEggDrop,代碼行數:42,代碼來源:DragonDeathRunnable.java


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