use of kingdoms.server.PlayerProvider in project Tale-of-Kingdoms by Ivasik78.
the class SPacketBank method server.
@Override
public void server(EntityPlayerMP player) {
PlayerProvider provider = PlayerProvider.get(player);
int count = buf().readShort();
boolean deposit = buf().readBoolean();
if (deposit) {
if (provider.getGoldTotal() >= count) {
provider.addBankGold(count);
provider.decreaseGold(count);
}
} else {
if (provider.getBankGold() >= count) {
provider.addGold(count);
provider.decreaseBankGold(count, player);
}
}
}
use of kingdoms.server.PlayerProvider in project Tale-of-Kingdoms by Ivasik78.
the class SPacketWarden method server.
@Override
public void server(EntityPlayerMP player) {
PlayerProvider provider = PlayerProvider.get(player);
if (provider.getGoldTotal() >= 1000) {
EntityLiving entity = (EntityLiving) UltimateHelper.INSTANCE.getEntity(ByteBufUtils.readUTF8String(buf()), player.worldObj);
entity.setLocationAndAngles(player.posX, player.posY, player.posZ, 0.0F, 0.0F);
player.worldObj.spawnEntityInWorld(entity);
PlayerProvider.get(player).decreaseGold(1000);
}
}
use of kingdoms.server.PlayerProvider in project Tale-of-Kingdoms by Ivasik78.
the class CPacketSyncBank method client.
@Override
public void client(EntityPlayer player) {
PlayerProvider provider = PlayerProvider.get(player);
int count = buf().readInt();
boolean bank = buf().readBoolean();
if (bank) {
provider.setBankGold(count);
} else {
provider.setGoldTotal(count);
}
}
Aggregations