Search in sources :

Example 1 with BlockJukeBox

use of net.minecraft.server.v1_12_R1.BlockJukeBox in project PaperDev by Kamillaova.

the class CraftJukebox method eject.

@Override
public boolean eject() {
    requirePlaced();
    TileEntity tileEntity = this.getTileEntityFromWorld();
    if (!(tileEntity instanceof TileEntityRecordPlayer))
        return false;
    TileEntityRecordPlayer jukebox = (TileEntityRecordPlayer) tileEntity;
    boolean result = !jukebox.getRecord().isEmpty();
    CraftWorld world = (CraftWorld) this.getWorld();
    ((BlockJukeBox) Blocks.JUKEBOX).dropRecord(world.getHandle(), new BlockPosition(getX(), getY(), getZ()), null);
    return result;
}
Also used : TileEntity(net.minecraft.server.v1_12_R1.TileEntity) BlockJukeBox(net.minecraft.server.v1_12_R1.BlockJukeBox) BlockPosition(net.minecraft.server.v1_12_R1.BlockPosition) CraftWorld(org.bukkit.craftbukkit.v1_12_R1.CraftWorld) TileEntityRecordPlayer(net.minecraft.server.v1_12_R1.BlockJukeBox.TileEntityRecordPlayer)

Aggregations

BlockJukeBox (net.minecraft.server.v1_12_R1.BlockJukeBox)1 TileEntityRecordPlayer (net.minecraft.server.v1_12_R1.BlockJukeBox.TileEntityRecordPlayer)1 BlockPosition (net.minecraft.server.v1_12_R1.BlockPosition)1 TileEntity (net.minecraft.server.v1_12_R1.TileEntity)1 CraftWorld (org.bukkit.craftbukkit.v1_12_R1.CraftWorld)1