Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int idk, float what, float these, float are)
- {
- TEAltar tileEntity = (TEAltar) world.getTileEntity(x, y, z);
- if (tileEntity == null || player.isSneaking())
- {
- return false;
- }
- ItemStack playerItem = player.getCurrentEquippedItem();
- if (playerItem != null)
- {
- if (playerItem.getItem().equals(ModItems.divinationSigil))
- {
- if (player.worldObj.isRemote)
- {
- world.markBlockForUpdate(x, y, z);
- } else
- {
- tileEntity.sendChatInfoToPlayer(player);
- }
- return true;
- } else if (playerItem.getItem().equals(ModItems.itemSeerSigil))
- {
- if (player.worldObj.isRemote)
- {
- world.markBlockForUpdate(x, y, z);
- } else
- {
- tileEntity.sendMoreChatInfoToPlayer(player);
- }
- return true;
- }else if(playerItem.getItem() instanceof IAltarManipulator)
- {
- return false;
- }
- else if (playerItem.getItem().equals(ModItems.sigilOfHolding))
- {
- ItemStack item = SigilOfHolding.getCurrentSigil(playerItem);
- if (item != null && item.getItem().equals(ModItems.divinationSigil))
- {
- if (player.worldObj.isRemote)
- {
- world.markBlockForUpdate(x, y, z);
- } else
- {
- tileEntity.sendChatInfoToPlayer(player);
- }
- return true;
- } else if (item != null && item.getItem().equals(ModItems.itemSeerSigil))
- {
- if (player.worldObj.isRemote)
- {
- world.markBlockForUpdate(x, y, z);
- } else
- {
- tileEntity.sendMoreChatInfoToPlayer(player);
- }
- return true;
- }
- }
- }
- if (tileEntity.getStackInSlot(0) == null && playerItem != null)
- {
- ItemStack newItem = playerItem.copy();
- newItem.stackSize = 1;
- --playerItem.stackSize;
- tileEntity.setInventorySlotContents(0, newItem);
- tileEntity.startCycle();
- } else if (tileEntity.getStackInSlot(0) != null && playerItem == null)
- {
- player.inventory.addItemStackToInventory(tileEntity.getStackInSlot(0));
- tileEntity.setInventorySlotContents(0, null);
- tileEntity.setActive();
- }
- world.markBlockForUpdate(x, y, z);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment