当前位置: 首页>>代码示例>>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;未经允许,请勿转载。