Advertisement
Guest User

Untitled

a guest
Apr 1st, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1.     public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
  2.     {
  3.         if(player instanceof EntityPlayerMP && worldIn.getBlockState(pos).getBlock() instanceof BlockDoor)
  4.         {
  5.             EntityPlayerMP playerMP = (EntityPlayerMP) player;
  6.             PlayerList playerList = playerMP.mcServer.getPlayerList();
  7.             WorldServer dimension = DimensionManager.getWorld(Dimensions.vanqarDimensionID);
  8.  
  9.             //Only executes if the dimension hasnt been entered before
  10.             if(dimension != null)
  11.                 playerList.transferPlayerToDimension(playerMP, Dimensions.vanqarDimensionID, new VanqarTeleporter(dimension));
  12.  
  13.             return EnumActionResult.SUCCESS;
  14.         }
  15.  
  16.         return EnumActionResult.FAIL;
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement