mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-25 02:54:27 +00:00
API Changes:
-Implemented interfaces for all jobs & roles. ScriptPlayer: -Added getData() function, which returns player data objects. IPlayerData: New class that holds all player data for modification. -Holds dialog, bank, quest, transport, faction, item giver, and mail data. -Also holds companion data, with functions has/set/getCompanion, and a getCompanionID function to differentiate companions.
This commit is contained in:
1 parent
587f63396f
commit
63a1525ee2
66 files changed
+1418
-207
No files matched your search
@@ -35,6 +35,11 @@ public class JobItemGiver extends JobInterface{
|
||||
private List<EntityPlayer> toCheck;
|
||||
public Availability availability = new Availability();
|
||||
|
||||
public JobItemGiver() {
|
||||
super(null);
|
||||
inventory = new NpcMiscInventory(9);
|
||||
}
|
||||
|
||||
public JobItemGiver(EntityNPCInterface npc) {
|
||||
super(npc);
|
||||
inventory = new NpcMiscInventory(9);
|
||||
@@ -61,10 +66,6 @@ public class JobItemGiver extends JobInterface{
|
||||
cooldown = nbttagcompound.getInteger("igCooldown");
|
||||
lines = NBTTags.getStringList(nbttagcompound.getTagList("igLines", 10));
|
||||
inventory.setFromNBT(nbttagcompound.getCompoundTag("igJobInventory"));
|
||||
|
||||
if(itemGiverId == 0 && GlobalDataController.instance != null)
|
||||
itemGiverId = GlobalDataController.instance.incrementItemGiverId();
|
||||
|
||||
availability.readFromNBT(nbttagcompound.getCompoundTag("igAvailability"));
|
||||
}
|
||||
|
||||
@@ -92,7 +93,7 @@ public class JobItemGiver extends JobInterface{
|
||||
return map;
|
||||
}
|
||||
|
||||
private boolean giveItems(EntityPlayer player){
|
||||
public boolean giveItems(EntityPlayer player){
|
||||
PlayerItemGiverData data = PlayerDataController.instance.getPlayerData(player).itemgiverData;
|
||||
if(!canPlayerInteract(data)){
|
||||
return false;
|
||||
@@ -162,7 +163,7 @@ public class JobItemGiver extends JobInterface{
|
||||
private int getDay(){
|
||||
return (int) (npc.worldObj.getTotalWorldTime() / 24000L);
|
||||
}
|
||||
private boolean canPlayerInteract(PlayerItemGiverData data) {
|
||||
public boolean canPlayerInteract(PlayerItemGiverData data) {
|
||||
if(inventory.items.isEmpty())
|
||||
return false;
|
||||
if(isOnTimer()){
|
||||
|
||||
Reference in new issue
Block a user