mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 14:14:46 +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
@@ -6,6 +6,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.constants.EnumJobType;
|
||||
import noppes.npcs.constants.EnumRoleType;
|
||||
import noppes.npcs.controllers.GlobalDataController;
|
||||
import noppes.npcs.controllers.data.DialogOption;
|
||||
import noppes.npcs.controllers.data.FactionOptions;
|
||||
import noppes.npcs.controllers.data.Line;
|
||||
@@ -195,8 +196,25 @@ public class DataAdvanced {
|
||||
npc.jobInterface = new JobHealer(npc);
|
||||
else if (job == EnumJobType.Guard && !(npc.jobInterface instanceof JobGuard))
|
||||
npc.jobInterface = new JobGuard(npc);
|
||||
else if (job == EnumJobType.ItemGiver && !(npc.jobInterface instanceof JobItemGiver))
|
||||
npc.jobInterface = new JobItemGiver(npc);
|
||||
else if (job == EnumJobType.ItemGiver && !(npc.jobInterface instanceof JobItemGiver)) {
|
||||
if (!npc.isRemote()) {
|
||||
if (npc.itemGiverId > 0 && GlobalDataController.instance.itemGivers.containsKey(npc.itemGiverId)) {
|
||||
GlobalDataController.instance.itemGivers.get(npc.itemGiverId).npc = npc;
|
||||
npc.jobInterface = GlobalDataController.instance.itemGivers.get(npc.itemGiverId);
|
||||
} else {
|
||||
npc.jobInterface = new JobItemGiver(npc);
|
||||
if (npc.itemGiverId == -1) {
|
||||
((JobItemGiver) npc.jobInterface).itemGiverId = GlobalDataController.instance.incrementItemGiverId();
|
||||
} else {
|
||||
((JobItemGiver) npc.jobInterface).itemGiverId = npc.itemGiverId;
|
||||
}
|
||||
GlobalDataController.instance.itemGivers.put(((JobItemGiver) npc.jobInterface).itemGiverId, (JobItemGiver) npc.jobInterface);
|
||||
npc.itemGiverId = ((JobItemGiver) npc.jobInterface).itemGiverId;
|
||||
}
|
||||
} else {
|
||||
npc.jobInterface = new JobItemGiver(npc);
|
||||
}
|
||||
}
|
||||
else if (job == EnumJobType.Follower && !(npc.jobInterface instanceof JobFollower))
|
||||
npc.jobInterface = new JobFollower(npc);
|
||||
else if (job == EnumJobType.Spawner && !(npc.jobInterface instanceof JobSpawner))
|
||||
|
||||
Reference in new issue
Block a user