当前位置: 首页>>代码示例>>Java>>正文


Java Material.IRON_DOOR属性代码示例

本文整理汇总了Java中org.bukkit.Material.IRON_DOOR属性的典型用法代码示例。如果您正苦于以下问题:Java Material.IRON_DOOR属性的具体用法?Java Material.IRON_DOOR怎么用?Java Material.IRON_DOOR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.IRON_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();
				}
			}
		}
	}
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:18,代码来源:AntiPlaceDoorDupe.java

示例2: onPlayerInteract

public void onPlayerInteract(PlayerInteractEvent e) {
	if (e.isCancelled()) return;
     KingdomFactionsPlayer p = PlayerModule.getInstance().getPlayer(e.getPlayer());        
		if(p.getSettingsProfile().hasAdminMode()) return;
	if (e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
		if (e.getClickedBlock() == null) return;

		Block clickedBlock = e.getClickedBlock();
	

		if (clickedBlock.getType().equals(Material.CHEST) || clickedBlock.getType().equals(Material.TRAPPED_CHEST) || clickedBlock.getType().equals(Material.BEACON)) {
			e.setCancelled(!ProtectionModule.getInstance().tryInfluence(p, 500));
			return;
		}

		if (clickedBlock.getType().equals(Material.BURNING_FURNACE) || clickedBlock.getType().equals(Material.FURNACE) || clickedBlock.getType().equals(Material.DISPENSER) || clickedBlock.getType().equals(Material.HOPPER) || clickedBlock.getType().equals(Material.DROPPER)) {
			e.setCancelled(!ProtectionModule.getInstance().tryInfluence(p, 150));
			return;
		}

		MaterialData data = clickedBlock.getState() != null ? clickedBlock.getState().getData() : null;
		if (data instanceof Openable) {
			if (clickedBlock.getType() == Material.IRON_TRAPDOOR || clickedBlock.getType() == Material.IRON_DOOR) return;
			e.setCancelled(!ProtectionModule.getInstance().tryInfluence(p, 150));
			return;
		}
	}
}
 
开发者ID:ThEWiZ76,项目名称:KingdomFactions,代码行数:28,代码来源:PlayerInteractEventListener.java

示例3: isInteractiveBlock

/**
 * checks if this block would give a reaction if you click on it without
 * shifting, e.g. opening a chest or switching a lever
 */
public static boolean isInteractiveBlock(Block b) {
	if (b == null || b.getState() == null) {
		return false;
	}
	if (b.getType() == Material.WORKBENCH || b.getType() == Material.ENCHANTMENT_TABLE || b.getType() == Material.ANVIL || b.getType() == Material.BREWING_STAND || b.getState() instanceof InventoryHolder || b.getState() instanceof NoteBlock) {
		return true;
	}
	if (b.getState().getData() instanceof Button || b.getState().getData() instanceof Lever || b.getState().getData() instanceof Door || b.getState().getData() instanceof TrapDoor || b.getState().getData() instanceof Gate || b.getState().getData() instanceof Comparator) {
		if (b.getType() != Material.IRON_DOOR && b.getType() != Material.IRON_DOOR_BLOCK && b.getType() != Material.IRON_TRAPDOOR) {
			return true;
		}
	}
	return false;
}
 
开发者ID:RoboTricker,项目名称:Transport-Pipes,代码行数:18,代码来源:HitboxUtils.java

示例4: 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);
		}
	}
}
 
开发者ID:jiongjionger,项目名称:NeverLag,代码行数:11,代码来源:AntiPlaceDoorDupe.java

示例5: None

public None(){
    super(0, Material.IRON_DOOR, "Misigno", "");
}
 
开发者ID:cadox8,项目名称:WC,代码行数:3,代码来源:None.java


注:本文中的org.bukkit.Material.IRON_DOOR属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。