Search in sources :

Example 1 with CraftHanging

use of org.bukkit.craftbukkit.v1_18_R2.entity.CraftHanging in project MagicPlugin by elBukkit.

the class CompatibilityUtils method getHangingLocation.

@Override
public Location getHangingLocation(Entity entity) {
    Location location = entity.getLocation();
    if (!(entity instanceof Hanging))
        return location;
    HangingEntity nms = ((CraftHanging) entity).getHandle();
    BlockPos position = nms.blockPosition();
    location.setX(position.getX());
    location.setY(position.getY());
    location.setZ(position.getZ());
    return location;
}
Also used : HangingEntity(net.minecraft.world.entity.decoration.HangingEntity) Hanging(org.bukkit.entity.Hanging) CraftHanging(org.bukkit.craftbukkit.v1_17_R1.entity.CraftHanging) BlockPos(net.minecraft.core.BlockPos) CraftHanging(org.bukkit.craftbukkit.v1_17_R1.entity.CraftHanging) Location(org.bukkit.Location)

Example 2 with CraftHanging

use of org.bukkit.craftbukkit.v1_18_R2.entity.CraftHanging in project MagicPlugin by elBukkit.

the class CompatibilityUtils method getHangingLocation.

@Override
public Location getHangingLocation(Entity entity) {
    Location location = entity.getLocation();
    if (!(entity instanceof Hanging))
        return location;
    HangingEntity nms = ((CraftHanging) entity).getHandle();
    BlockPos position = nms.blockPosition();
    location.setX(position.getX());
    location.setY(position.getY());
    location.setZ(position.getZ());
    return location;
}
Also used : HangingEntity(net.minecraft.world.entity.decoration.HangingEntity) Hanging(org.bukkit.entity.Hanging) CraftHanging(org.bukkit.craftbukkit.v1_17_R1.entity.CraftHanging) BlockPos(net.minecraft.core.BlockPos) CraftHanging(org.bukkit.craftbukkit.v1_17_R1.entity.CraftHanging) Location(org.bukkit.Location)

Example 3 with CraftHanging

use of org.bukkit.craftbukkit.v1_18_R2.entity.CraftHanging in project MagicPlugin by elBukkit.

the class CompatibilityUtils method getHangingLocation.

@Override
public Location getHangingLocation(Entity entity) {
    Location location = entity.getLocation();
    if (!(entity instanceof Hanging))
        return location;
    HangingEntity nms = ((CraftHanging) entity).getHandle();
    BlockPos position = nms.blockPosition();
    location.setX(position.getX());
    location.setY(position.getY());
    location.setZ(position.getZ());
    return location;
}
Also used : HangingEntity(net.minecraft.world.entity.decoration.HangingEntity) Hanging(org.bukkit.entity.Hanging) CraftHanging(org.bukkit.craftbukkit.v1_18_R2.entity.CraftHanging) BlockPos(net.minecraft.core.BlockPos) CraftHanging(org.bukkit.craftbukkit.v1_18_R2.entity.CraftHanging) Location(org.bukkit.Location)

Example 4 with CraftHanging

use of org.bukkit.craftbukkit.v1_18_R2.entity.CraftHanging in project MagicPlugin by elBukkit.

the class CompatibilityUtils method getHangingLocation.

@Override
public Location getHangingLocation(Entity entity) {
    Location location = entity.getLocation();
    if (!(entity instanceof Hanging))
        return location;
    HangingEntity nms = ((CraftHanging) entity).getHandle();
    BlockPos position = nms.blockPosition();
    location.setX(position.getX());
    location.setY(position.getY());
    location.setZ(position.getZ());
    return location;
}
Also used : HangingEntity(net.minecraft.world.entity.decoration.HangingEntity) Hanging(org.bukkit.entity.Hanging) CraftHanging(org.bukkit.craftbukkit.v1_18_R1.entity.CraftHanging) BlockPos(net.minecraft.core.BlockPos) CraftHanging(org.bukkit.craftbukkit.v1_18_R1.entity.CraftHanging) Location(org.bukkit.Location)

Example 5 with CraftHanging

use of org.bukkit.craftbukkit.v1_18_R2.entity.CraftHanging in project MagicPlugin by elBukkit.

the class CompatibilityUtils method getHangingLocation.

@Override
public Location getHangingLocation(Entity entity) {
    Location location = entity.getLocation();
    if (!(entity instanceof Hanging))
        return location;
    HangingEntity nms = ((CraftHanging) entity).getHandle();
    BlockPos position = nms.blockPosition();
    location.setX(position.getX());
    location.setY(position.getY());
    location.setZ(position.getZ());
    return location;
}
Also used : HangingEntity(net.minecraft.world.entity.decoration.HangingEntity) Hanging(org.bukkit.entity.Hanging) CraftHanging(org.bukkit.craftbukkit.v1_18_R1.entity.CraftHanging) BlockPos(net.minecraft.core.BlockPos) CraftHanging(org.bukkit.craftbukkit.v1_18_R1.entity.CraftHanging) Location(org.bukkit.Location)

Aggregations

BlockPos (net.minecraft.core.BlockPos)5 HangingEntity (net.minecraft.world.entity.decoration.HangingEntity)5 Location (org.bukkit.Location)5 Hanging (org.bukkit.entity.Hanging)5 CraftHanging (org.bukkit.craftbukkit.v1_17_R1.entity.CraftHanging)2 CraftHanging (org.bukkit.craftbukkit.v1_18_R1.entity.CraftHanging)2 CraftHanging (org.bukkit.craftbukkit.v1_18_R2.entity.CraftHanging)1