Search in sources :

Example 6 with EntityItemFrame

use of net.minecraft.server.v1_13_R2.EntityItemFrame in project Citizens2 by CitizensDev.

the class ItemFrameController method createEntity.

@Override
protected Entity createEntity(Location at, NPC npc) {
    Entity e = super.createEntity(at, npc);
    EntityItemFrame item = (EntityItemFrame) ((CraftEntity) e).getHandle();
    item.setDirection(EnumDirection.EAST);
    item.blockPosition = new BlockPosition(at.getX(), at.getY(), at.getZ());
    return e;
}
Also used : Entity(org.bukkit.entity.Entity) CraftEntity(org.bukkit.craftbukkit.v1_16_R3.entity.CraftEntity) EntityItemFrame(net.minecraft.server.v1_16_R3.EntityItemFrame) BlockPosition(net.minecraft.server.v1_16_R3.BlockPosition)

Example 7 with EntityItemFrame

use of net.minecraft.server.v1_13_R2.EntityItemFrame in project Citizens2 by CitizensDev.

the class ItemFrameController method createEntity.

@Override
protected Entity createEntity(Location at, NPC npc) {
    Entity e = super.createEntity(at, npc);
    EntityItemFrame item = (EntityItemFrame) ((CraftEntity) e).getHandle();
    item.setDirection(EnumDirection.EAST);
    item.blockPosition = new BlockPosition(at.getX(), at.getY(), at.getZ());
    return e;
}
Also used : Entity(org.bukkit.entity.Entity) CraftEntity(org.bukkit.craftbukkit.v1_10_R1.entity.CraftEntity) EntityItemFrame(net.minecraft.server.v1_10_R1.EntityItemFrame) BlockPosition(net.minecraft.server.v1_10_R1.BlockPosition)

Example 8 with EntityItemFrame

use of net.minecraft.server.v1_13_R2.EntityItemFrame in project Citizens2 by CitizensDev.

the class ItemFrameController method createEntity.

@Override
protected Entity createEntity(Location at, NPC npc) {
    Entity e = super.createEntity(at, npc);
    EntityItemFrame item = (EntityItemFrame) ((CraftEntity) e).getHandle();
    item.setDirection(EnumDirection.EAST);
    item.blockPosition = new BlockPosition(at.getX(), at.getY(), at.getZ());
    return e;
}
Also used : CraftEntity(org.bukkit.craftbukkit.v1_13_R2.entity.CraftEntity) Entity(org.bukkit.entity.Entity) EntityItemFrame(net.minecraft.server.v1_13_R2.EntityItemFrame) BlockPosition(net.minecraft.server.v1_13_R2.BlockPosition)

Example 9 with EntityItemFrame

use of net.minecraft.server.v1_13_R2.EntityItemFrame in project PaperDev by Kamillaova.

the class CraftItemFrame method update.

private void update() {
    EntityItemFrame old = this.getHandle();
    WorldServer world = ((CraftWorld) getWorld()).getHandle();
    BlockPosition position = old.getBlockPosition();
    EnumDirection direction = old.getDirection();
    ItemStack item = old.getItem() != null ? old.getItem().cloneItemStack() : null;
    old.die();
    EntityItemFrame frame = new EntityItemFrame(world, position, direction);
    frame.setItem(item);
    world.addEntity(frame);
    this.entity = frame;
}
Also used : EntityItemFrame(net.minecraft.server.v1_12_R1.EntityItemFrame) BlockPosition(net.minecraft.server.v1_12_R1.BlockPosition) WorldServer(net.minecraft.server.v1_12_R1.WorldServer) EnumDirection(net.minecraft.server.v1_12_R1.EnumDirection) CraftItemStack(org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack) ItemStack(net.minecraft.server.v1_12_R1.ItemStack) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld)

Aggregations

Entity (org.bukkit.entity.Entity)8 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)2 EntityItemFrame (net.minecraft.server.v1_12_R1.EntityItemFrame)2 BlockPosition (net.minecraft.server.v1_10_R1.BlockPosition)1 EntityItemFrame (net.minecraft.server.v1_10_R1.EntityItemFrame)1 BlockPosition (net.minecraft.server.v1_11_R1.BlockPosition)1 EntityItemFrame (net.minecraft.server.v1_11_R1.EntityItemFrame)1 EnumDirection (net.minecraft.server.v1_12_R1.EnumDirection)1 ItemStack (net.minecraft.server.v1_12_R1.ItemStack)1 WorldServer (net.minecraft.server.v1_12_R1.WorldServer)1 BlockPosition (net.minecraft.server.v1_13_R2.BlockPosition)1 EntityItemFrame (net.minecraft.server.v1_13_R2.EntityItemFrame)1 BlockPosition (net.minecraft.server.v1_14_R1.BlockPosition)1 EntityItemFrame (net.minecraft.server.v1_14_R1.EntityItemFrame)1 BlockPosition (net.minecraft.server.v1_15_R1.BlockPosition)1 EntityItemFrame (net.minecraft.server.v1_15_R1.EntityItemFrame)1 BlockPosition (net.minecraft.server.v1_16_R3.BlockPosition)1 EntityItemFrame (net.minecraft.server.v1_16_R3.EntityItemFrame)1 BlockPosition (net.minecraft.server.v1_8_R3.BlockPosition)1 EntityItemFrame (net.minecraft.server.v1_8_R3.EntityItemFrame)1