本文整理汇总了Java中org.bukkit.material.Gate类的典型用法代码示例。如果您正苦于以下问题:Java Gate类的具体用法?Java Gate怎么用?Java Gate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Gate类属于org.bukkit.material包,在下文中一共展示了Gate类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkMove
import org.bukkit.material.Gate; //导入依赖的package包/类
@Override
public void checkMove(MoveData inData)
{
if(inData.isValid())
return;
if(inData.getAboveBlock().getType() == Material.FENCE_GATE)
{
Gate g = (Gate)inData.getAboveBlock().getState().getData();
if(g.isOpen())
inData.setValid(true);
}
else if(inData.getAboveBlock().getType() == Material.WOOD_DOOR || (!this.m_ironDoor && inData.getAboveBlock().getType() == Material.IRON_DOOR_BLOCK))
{
Door d = (Door)inData.getAboveBlock().getState().getData();
if(d.isOpen())
inData.setValid(true);
}
}
示例2: checkMove
import org.bukkit.material.Gate; //导入依赖的package包/类
@Override
public void checkMove(MoveData inData)
{
if(!inData.isValid())
return;
if(inData.getYDiff() == 1)
{
if(inData.getXDiff() == 0 && inData.getZDiff() == 0 && !Pathfinder.isLiquid(inData.getFrom().getBlock()))
{
inData.setValid(false);
return;
}
Block aboveHead = inData.getFrom().getBlock().getRelative(BlockFace.UP, 3);
if(!Pathfinder.isTransparent(aboveHead))
{
inData.setValid(false);
return;
}
Block to = inData.getTo().getBlock();
if(to.getType() == Material.FENCE || (to.getType() == Material.FENCE_GATE && !((Gate)to.getState().getData()).isOpen()))
inData.setValid(false);
}
}
示例3: isInteractiveBlock
import org.bukkit.material.Gate; //导入依赖的package包/类
/**
* 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;
}
示例4: Gate
import org.bukkit.material.Gate; //导入依赖的package包/类
public Gate() {
}
示例5: clone
import org.bukkit.material.Gate; //导入依赖的package包/类
public Gate clone() {
return null;
}
示例6: isFenceGate
import org.bukkit.material.Gate; //导入依赖的package包/类
/**
* @param type the material
* @return true if the material is a fence-gate.
*/
public static boolean isFenceGate(Material type) {
return type.getData() == Gate.class;
}