Search in sources :

Example 1 with PacketEditTileEntity

use of ivorius.reccomplex.network.PacketEditTileEntity in project RecurrentComplex by Ivorforce.

the class BlockScript method onBlockActivated.

@Override
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
    if (!worldIn.isRemote && playerIn instanceof EntityPlayerMP && playerIn.canUseCommand(2, "")) {
        TileEntity tileEntity = worldIn.getTileEntity(pos);
        RecurrentComplex.network.sendTo(new PacketEditTileEntity((TileEntityBlockScript) tileEntity), (EntityPlayerMP) playerIn);
    }
    return true;
}
Also used : PacketEditTileEntity(ivorius.reccomplex.network.PacketEditTileEntity) TileEntity(net.minecraft.tileentity.TileEntity) PacketEditTileEntity(ivorius.reccomplex.network.PacketEditTileEntity) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP)

Aggregations

PacketEditTileEntity (ivorius.reccomplex.network.PacketEditTileEntity)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 TileEntity (net.minecraft.tileentity.TileEntity)1