@Override public void onPlayerLogin(EntityPlayer receiver) { this.par1player = (Player) receiver; getData(receiver); if (receiver.username == "aginsun") { gold.addGold(receiver, 150000); worthy.addWorthy(receiver, 15000F); } PacketDispatcher.sendPacketToPlayer( PacketType.populatePacket(new PacketGold(receiver.username, gold.getGoldTotal(receiver))), par1player); PacketDispatcher.sendPacketToPlayer( PacketType.populatePacket(new PacketWorthy(receiver.username, worthy.getWorthy(receiver))), par1player); }
public void getData(EntityPlayer player) { if (player != null) { data = player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG); if (data.hasKey("GoldTotal")) { int i = data.getInteger("GoldTotal"); gold.setGold(player, i); } if (data.hasKey("Worthy")) ; { float j = data.getFloat("Worthy"); worthy.setWorthy(player, j); } } }
public void SetData(EntityPlayer player) { data = player.getEntityData().getCompoundTag(player.PERSISTED_NBT_TAG); data.setInteger("GoldTotal", gold.getGoldTotal(player)); data.setFloat("Worthy", worthy.getWorthy(player)); player.getEntityData().setCompoundTag(player.PERSISTED_NBT_TAG, data); }