Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package terramagna.utils;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.world.*;
- import net.minecraftforge.event.ForgeSubscribe;
- import net.minecraftforge.event.entity.EntityJoinWorldEvent;
- public class PlayerStatsUtil extends WorldSavedData
- {
- public PlayerStatsUtil(String par1Str){super(par1Str);}
- private static String username;
- private static EntityPlayer player;
- @ForgeSubscribe
- public void onEntityJoinWorld(EntityJoinWorldEvent event)
- {
- if (!event.entity.worldObj.isRemote && event.entity instanceof EntityPlayer)
- {
- player = (EntityPlayer) event.entity;
- username = player.username;
- }
- }
- @Override
- public void readFromNBT(NBTTagCompound nbttagcompound)
- {
- }
- @Override
- public void writeToNBT(NBTTagCompound nbttagcompound)
- {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment