本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
}