Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override def onItemUse(is: ItemStack, player: EntityPlayer, world: World, x: Int, y: Int, z: Int, side: Int, hitX: Float, hitY: Float, hitZ: Float): Boolean =
- {
- // client side, needs to return false to proceed to server
- if (world.isRemote)
- {
- return false
- }
- // server side, do calculation here
- else {
- val compound: NBTTagCompound = is.getTagCompound
- if (compound != null)
- {
- val te = world.getTileEntity(x,y,z)
- if (te.isInstanceOf[TileEntityPylon])
- {
- val pylon = te.asInstanceOf[TileEntityPylon]
- val teRed = pylon.red
- val teGreen = pylon.green
- val teBlue = pylon.blue
- compound.setInteger("colorRed", teRed)
- compound.setInteger("colorGreen", teGreen)
- compound.setInteger("colorBlue", teBlue)
- }
- }
- return true
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement