本文整理汇总了Java中org.bukkit.Material.DIAMOND_ORE属性的典型用法代码示例。如果您正苦于以下问题:Java Material.DIAMOND_ORE属性的具体用法?Java Material.DIAMOND_ORE怎么用?Java Material.DIAMOND_ORE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.DIAMOND_ORE属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockBreak
/**
* Write a message when a player mine a diamond
*
* @param event Event
*/
@EventHandler(ignoreCancelled = true)
public void onBlockBreak(BlockBreakEvent event)
{
if (event.getBlock().getType() != Material.DIAMOND_ORE)
return;
Location location = event.getBlock().getLocation();
StringBuilder builder = new StringBuilder();
builder.append(ChatColor.GOLD).append("[").append(ChatColor.YELLOW);
builder.append("Paranoïa");
builder.append(ChatColor.GOLD).append("]").append(ChatColor.YELLOW);
builder.append(" Le joueur ").append(ChatColor.GOLD).append(event.getPlayer().getName()).append(ChatColor.YELLOW);
builder.append(" a miné un bloc de diamant aux coordonnées ").append(ChatColor.GOLD);
builder.append(location.getBlockX()).append("; ").append(location.getBlockY()).append("; ").append(location.getBlockZ());
builder.append(ChatColor.YELLOW).append(" !");
Bukkit.broadcastMessage(builder.toString());
}
示例2: onBlockBreak
@EventHandler(priority = EventPriority.LOW)
public void onBlockBreak(BlockBreakEvent evt) {
Location at = evt.getBlock().getLocation();
if (at.getY() > 20 || !at.getWorld().equals(Core.getMainWorld()))
return;
// Remember mined blocks.
BrokenBlock bk = new BrokenBlock(evt.getPlayer(), evt.getBlock());
blocks.add(bk);
if ((bk.getType() == Material.DIAMOND_ORE || Utils.randChance(20))
&& (getBlockScore(evt.getPlayer()) >= 20 || getTimeScore(evt.getPlayer()) >= 20))
blocks.detect(bk);
// Handle suspicious ascending / descending.
if (elevation.getDetections(evt.getPlayer()).stream().noneMatch(b -> b.getLocation().getY() == at.getY()))
elevation.detect(bk);
}
示例3: onBlockBreak
/**
* Damage the player when he mine a diamond ore
*
* @param event Event
*/
@EventHandler(ignoreCancelled = true)
public void onBlockBreak(BlockBreakEvent event)
{
if (event.getBlock().getType() == Material.DIAMOND_ORE)
event.getPlayer().damage((double) this.moduleConfiguration.get("damages"));
}
示例4: onBlockBreak
@EventHandler
public void onBlockBreak(BlockBreakEvent evt) {
if (evt.getBlock().getType() != Material.DIAMOND_ORE || evt.getBlock().getLocation().getY() > 20)
return;
Core.alertStaff(ChatColor.BLUE + evt.getPlayer().getName() + " mined some "
+ ChatColor.AQUA + "diamond ore" + ChatColor.BLUE + ".");
MetadataManager.setCooldown(evt.getPlayer(), "lastDiamond", 6000); // 5 minutes
}
示例5: BlockDiamondOre
public BlockDiamondOre() {
super( Material.DIAMOND_ORE );
}