2018-09-13 12:03:28 -04:00
|
|
|
package noppes.npcs.scripted;
|
|
|
|
|
|
|
|
|
|
import net.minecraft.entity.passive.EntityTameable;
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayerMP;
|
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
2022-11-23 23:59:01 -06:00
|
|
|
import noppes.npcs.api.IPixelmonPlayerData;
|
2018-09-13 12:03:28 -04:00
|
|
|
import noppes.npcs.controllers.PixelmonHelper;
|
2021-10-18 06:33:39 -05:00
|
|
|
import noppes.npcs.scripted.entity.ScriptPixelmon;
|
2018-09-13 12:03:28 -04:00
|
|
|
|
2022-11-23 23:59:01 -06:00
|
|
|
public class ScriptPixelmonPlayerData implements IPixelmonPlayerData {
|
2018-09-13 12:03:28 -04:00
|
|
|
private EntityPlayerMP player;
|
|
|
|
|
public ScriptPixelmonPlayerData(EntityPlayerMP player){
|
|
|
|
|
this.player = player;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ScriptPixelmon getPartySlot(int slot){
|
|
|
|
|
NBTTagCompound compound = PixelmonHelper.getPartySlot(slot, player);
|
|
|
|
|
if(compound == null)
|
|
|
|
|
return null;
|
|
|
|
|
EntityTameable pixelmon = PixelmonHelper.pixelmonFromNBT(compound, player);
|
|
|
|
|
return new ScriptPixelmon(pixelmon, compound);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int countPCPixelmon(){
|
|
|
|
|
return PixelmonHelper.countPCPixelmon(player);
|
|
|
|
|
}
|
|
|
|
|
}
|