Guest User

Untitled

a guest
Sep 9th, 2013
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. package terramagna.utils;
  2.  
  3. import net.minecraft.entity.player.EntityPlayer;
  4. import net.minecraft.nbt.NBTTagCompound;
  5. import net.minecraft.world.*;
  6. import net.minecraftforge.event.ForgeSubscribe;
  7. import net.minecraftforge.event.entity.EntityJoinWorldEvent;
  8.  
  9. public class PlayerStatsUtil extends WorldSavedData
  10. {
  11.  
  12. public PlayerStatsUtil(String par1Str){super(par1Str);}
  13.  
  14. private static String username;
  15. private static EntityPlayer player;
  16.  
  17. @ForgeSubscribe
  18. public void onEntityJoinWorld(EntityJoinWorldEvent event)
  19. {
  20.  
  21. if (!event.entity.worldObj.isRemote && event.entity instanceof EntityPlayer)
  22. {
  23.  
  24. player = (EntityPlayer) event.entity;
  25. username = player.username;
  26.  
  27. }
  28.  
  29. }
  30.  
  31. @Override
  32. public void readFromNBT(NBTTagCompound nbttagcompound)
  33. {
  34.  
  35.  
  36.  
  37. }
  38.  
  39. @Override
  40. public void writeToNBT(NBTTagCompound nbttagcompound)
  41. {
  42.  
  43.  
  44.  
  45. }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment