Java 类org.bukkit.material.Gate 实例源码

项目:remote-entities-nxt    文件:DoorOpenChecker.java   
@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);
    }
}
项目:remote-entities-nxt    文件:JumpChecker.java   
@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);
    }
}
项目:EndHQ-Libraries    文件:DoorOpenChecker.java   
@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);
    }
}
项目:EndHQ-Libraries    文件:JumpChecker.java   
@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);
    }
}
项目:Transport-Pipes    文件:HitboxUtils.java   
/**
 * 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;
}
项目:BedrockAPI    文件:Gate.java   
public Gate() {
}
项目:BedrockAPI    文件:Gate.java   
public Gate(int type, byte data) {
}
项目:BedrockAPI    文件:Gate.java   
public Gate(byte data) {
}
项目:BedrockAPI    文件:Gate.java   
public Gate clone() {
    return null;
}
项目:Arc-v2    文件:MaterialHelper.java   
/**
 * @param type the material
 * @return true if the material is a fence-gate.
 */
public static boolean isFenceGate(Material type) {
    return type.getData() == Gate.class;
}