本文整理汇总了Java中org.bukkit.Material.WOOD_DOOR属性的典型用法代码示例。如果您正苦于以下问题:Java Material.WOOD_DOOR属性的具体用法?Java Material.WOOD_DOOR怎么用?Java Material.WOOD_DOOR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.WOOD_DOOR属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPlace
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlace(BlockPlaceEvent e) {
if (!cm.isAntiPlaceDoorDupe) {
return;
}
// 判断手里的物品是否为门
if (e.getItemInHand().getType() == Material.WOOD_DOOR || e.getItemInHand().getType() == Material.IRON_DOOR) {
// 清理所在区块的甘蔗掉落物
for (Entity entity : e.getPlayer().getLocation().getChunk().getEntities()) {
if (entity instanceof Item) {
Material itemType = ((Item) entity).getItemStack().getType();
if (itemType == Material.SUGAR_CANE || itemType == Material.CACTUS) {
entity.remove();
}
}
}
}
}
示例2: onClick
public static void onClick(Player p, ItemStack item)
{
if (item.getType() == Material.WOOD_DOOR)
p.closeInventory();
if (item.getType() != Material.WOOL)
return ;
for (TeamColor color : getColors(AgarMC.get().getGame().getGameType()))
if (color.getData() == item.getDurability())
{
CPlayer cplayer = AgarMC.get().getGame().getCPlayer(p);
if (cplayer != null)
{
cplayer.setColor(color.getChatColor());
cplayer.updateColor();
p.sendMessage(ChatColor.YELLOW + "Vous êtes maintenant" + (AgarMC.get().getGame().getGameType() == GameType.TEAMS ? " dans l'équipe" : "") + " : " + color.getDisplayName());
return ;
}
}
}
示例3: onPickup
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onPickup(PlayerPickupItemEvent e) {
if (!cm.isAntiPlaceDoorDupe) {
return;
}
if (e.getPlayer().getItemInHand().getType() == Material.WOOD_DOOR || e.getPlayer().getItemInHand().getType() == Material.IRON_DOOR) {
if (e.getItem().getItemStack().getType() == Material.SUGAR_CANE || e.getItem().getItemStack().getType() == Material.CACTUS) {
e.setCancelled(true);
}
}
}
示例4: getLeaveItem
@Override
public ItemStack getLeaveItem()
{
ItemStack door = new ItemStack(Material.WOOD_DOOR, 1);
ItemMeta meta = door.getItemMeta();
meta.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD + "Quitter le jeu");
door.setItemMeta(meta);
return door;
}
示例5: ShieldWeapon
public ShieldWeapon() {
super("Bouclier", "", new ItemStack(Material.WOOD_DOOR));
}