Search in sources :

Example 1 with TileEntityHandle

use of com.bergerkiller.generated.net.minecraft.server.TileEntityHandle in project BKCommonLib by bergerhealer.

the class NMSTileEntity method getBlock.

public static Block getBlock(Object tileEntity) {
    TileEntityHandle handle = TileEntityHandle.createHandle(tileEntity);
    BlockPositionHandle pos = handle.getPosition();
    return handle.getWorld().getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
}
Also used : TileEntityHandle(com.bergerkiller.generated.net.minecraft.server.TileEntityHandle) BlockPositionHandle(com.bergerkiller.generated.net.minecraft.server.BlockPositionHandle)

Example 2 with TileEntityHandle

use of com.bergerkiller.generated.net.minecraft.server.TileEntityHandle in project BKCommonLib by bergerhealer.

the class WrapperConversion method getBlockFromTileEntity.

@ConverterMethod(input = "net.minecraft.server.TileEntity")
public static org.bukkit.block.Block getBlockFromTileEntity(Object nmsTileEntityHandle) {
    TileEntityHandle handle = TileEntityHandle.createHandle(nmsTileEntityHandle);
    BlockPositionHandle pos = handle.getPosition();
    return handle.getWorld().getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
}
Also used : TileEntityHandle(com.bergerkiller.generated.net.minecraft.server.TileEntityHandle) BlockPositionHandle(com.bergerkiller.generated.net.minecraft.server.BlockPositionHandle) ConverterMethod(com.bergerkiller.mountiplex.conversion.annotations.ConverterMethod)

Aggregations

BlockPositionHandle (com.bergerkiller.generated.net.minecraft.server.BlockPositionHandle)2 TileEntityHandle (com.bergerkiller.generated.net.minecraft.server.TileEntityHandle)2 ConverterMethod (com.bergerkiller.mountiplex.conversion.annotations.ConverterMethod)1