Java 类net.minecraft.server.EntityHanging 实例源码

项目:Craftbukkit    文件:CraftHanging.java   
public boolean setFacingDirection(BlockFace face, boolean force) {
    EntityHanging hanging = getHandle();
    EnumDirection dir = hanging.direction;
    switch (face) {
        case SOUTH:
        default:
            getHandle().setDirection(EnumDirection.SOUTH);
            break;
        case WEST:
            getHandle().setDirection(EnumDirection.WEST);
            break;
        case NORTH:
            getHandle().setDirection(EnumDirection.NORTH);
            break;
        case EAST:
            getHandle().setDirection(EnumDirection.EAST);
            break;
    }
    if (!force && !hanging.survives()) {
        // Revert since it doesn't fit
        hanging.setDirection(dir);
        return false;
    }
    return true;
}
项目:SpigotSource    文件:CraftHanging.java   
public boolean setFacingDirection(BlockFace face, boolean force) {
    EntityHanging hanging = getHandle();
    EnumDirection dir = hanging.direction;
    switch (face) {
        case SOUTH:
        default:
            getHandle().setDirection(EnumDirection.SOUTH);
            break;
        case WEST:
            getHandle().setDirection(EnumDirection.WEST);
            break;
        case NORTH:
            getHandle().setDirection(EnumDirection.NORTH);
            break;
        case EAST:
            getHandle().setDirection(EnumDirection.EAST);
            break;
    }
    if (!force && !hanging.survives()) {
        // Revert since it doesn't fit
        hanging.setDirection(dir);
        return false;
    }
    return true;
}
项目:CraftBukkit    文件:CraftHanging.java   
public boolean setFacingDirection(BlockFace face, boolean force) {
    Block block = getLocation().getBlock().getRelative(getAttachedFace()).getRelative(face.getOppositeFace()).getRelative(getFacing());
    EntityHanging hanging = getHandle();
    int x = hanging.x, y = hanging.y, z = hanging.z, dir = hanging.direction;
    hanging.x = block.getX();
    hanging.y = block.getY();
    hanging.z = block.getZ();
    switch (face) {
        case SOUTH:
        default:
            getHandle().setDirection(0);
            break;
        case WEST:
            getHandle().setDirection(1);
            break;
        case NORTH:
            getHandle().setDirection(2);
            break;
        case EAST:
            getHandle().setDirection(3);
            break;
    }
    if (!force && !hanging.survives()) {
        // Revert since it doesn't fit
        hanging.x = x;
        hanging.y = y;
        hanging.z = z;
        hanging.setDirection(dir);
        return false;
    }
    return true;
}
项目:Almura-Server    文件:CraftHanging.java   
public boolean setFacingDirection(BlockFace face, boolean force) {
    Block block = getLocation().getBlock().getRelative(getAttachedFace()).getRelative(face.getOppositeFace()).getRelative(getFacing());
    EntityHanging hanging = getHandle();
    int x = hanging.x, y = hanging.y, z = hanging.z, dir = hanging.direction;
    hanging.x = block.getX();
    hanging.y = block.getY();
    hanging.z = block.getZ();
    switch (face) {
        case SOUTH:
        default:
            getHandle().setDirection(0);
            break;
        case WEST:
            getHandle().setDirection(1);
            break;
        case NORTH:
            getHandle().setDirection(2);
            break;
        case EAST:
            getHandle().setDirection(3);
            break;
    }
    if (!force && !hanging.survives()) {
        // Revert since it doesn't fit
        hanging.x = x;
        hanging.y = y;
        hanging.z = z;
        hanging.setDirection(dir);
        return false;
    }
    return true;
}
项目:Tweakkit-Server    文件:CraftHanging.java   
public boolean setFacingDirection(BlockFace face, boolean force) {
    Block block = getLocation().getBlock().getRelative(getAttachedFace()).getRelative(face.getOppositeFace()).getRelative(getFacing());
    EntityHanging hanging = getHandle();
    int x = hanging.x, y = hanging.y, z = hanging.z, dir = hanging.direction;
    hanging.x = block.getX();
    hanging.y = block.getY();
    hanging.z = block.getZ();
    switch (face) {
        case SOUTH:
        default:
            getHandle().setDirection(0);
            break;
        case WEST:
            getHandle().setDirection(1);
            break;
        case NORTH:
            getHandle().setDirection(2);
            break;
        case EAST:
            getHandle().setDirection(3);
            break;
    }
    if (!force && !hanging.survives()) {
        // Revert since it doesn't fit
        hanging.x = x;
        hanging.y = y;
        hanging.z = z;
        hanging.setDirection(dir);
        return false;
    }
    return true;
}
项目:Craft-city    文件:CraftHanging.java   
public boolean setFacingDirection(BlockFace face, boolean force) {
    Block block = getLocation().getBlock().getRelative(getAttachedFace()).getRelative(face.getOppositeFace()).getRelative(getFacing());
    EntityHanging hanging = getHandle();
    int x = hanging.x, y = hanging.y, z = hanging.z, dir = hanging.direction;
    hanging.x = block.getX();
    hanging.y = block.getY();
    hanging.z = block.getZ();
    switch (face) {
        case SOUTH:
        default:
            getHandle().setDirection(0);
            break;
        case WEST:
            getHandle().setDirection(1);
            break;
        case NORTH:
            getHandle().setDirection(2);
            break;
        case EAST:
            getHandle().setDirection(3);
            break;
    }
    if (!force && !hanging.survives()) {
        // Revert since it doesn't fit
        hanging.x = x;
        hanging.y = y;
        hanging.z = z;
        hanging.setDirection(dir);
        return false;
    }
    return true;
}
项目:CraftBukkit    文件:CraftHanging.java   
public CraftHanging(CraftServer server, EntityHanging entity) {
    super(server, entity);
}
项目:CraftBukkit    文件:CraftHanging.java   
@Override
public EntityHanging getHandle() {
    return (EntityHanging) entity;
}
项目:Craftbukkit    文件:CraftHanging.java   
public CraftHanging(CraftServer server, EntityHanging entity) {
    super(server, entity);
}
项目:Craftbukkit    文件:CraftHanging.java   
@Override
public EntityHanging getHandle() {
    return (EntityHanging) entity;
}
项目:Almura-Server    文件:CraftHanging.java   
public CraftHanging(CraftServer server, EntityHanging entity) {
    super(server, entity);
}
项目:Almura-Server    文件:CraftHanging.java   
@Override
public EntityHanging getHandle() {
    return (EntityHanging) entity;
}
项目:Tweakkit-Server    文件:CraftHanging.java   
public CraftHanging(CraftServer server, EntityHanging entity) {
    super(server, entity);
}
项目:Tweakkit-Server    文件:CraftHanging.java   
@Override
public EntityHanging getHandle() {
    return (EntityHanging) entity;
}
项目:SpigotSource    文件:CraftHanging.java   
public CraftHanging(CraftServer server, EntityHanging entity) {
    super(server, entity);
}
项目:SpigotSource    文件:CraftHanging.java   
@Override
public EntityHanging getHandle() {
    return (EntityHanging) entity;
}
项目:Craft-city    文件:CraftHanging.java   
public CraftHanging(CraftServer server, EntityHanging entity) {
    super(server, entity);
}
项目:Craft-city    文件:CraftHanging.java   
@Override
public EntityHanging getHandle() {
    return (EntityHanging) entity;
}