Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) {
- if(!worldIn.isRemote){
- playerIn.openGui(EnergyTools.instance, CommonProxy.GUI_TELEPORTER, worldIn, pos.getX(), pos.getY(), pos.getZ());
- }
- // I want to send a message to the player when he opens the container. <------------!
- /** Tried it without the ! Am starting to get confused -- Noticed playerIn is instanceof EntityPlayerMP with ! */
- if(!worldIn.isRemote){
- TeleporterTE te = (TeleporterTE) worldIn.getTileEntity(pos);
- if(te != null){
- PacketDispatcher.sendTo(new SyncTeleporterContents(te.getCurrentEnergy()), (EntityPlayerMP)playerIn);
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement