PlayerData:

-Renamed loadPlayerDataFromFile() to load(), and moved it next to the save() function for later addition to the API.
-Moved saving/loading to EP functions where they used to be.
-Removed now unused PlayerData.get() and loadPlayerDataOld() functions

ServerEventsHandler:
-Added new EntityConstructing event to add the PlayerData EP earlier.

NoppesUtilPlayer:
-questCompletion() now saves player data right before its return statement.
This commit is contained in:
Luis C.M committed 2023-05-21 02:48:30 -05:00
1 parent dc42beee15
commit cbf99be297
5 files changed
+30 -84

No files matched your search

@@ -5,6 +5,7 @@ import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.NBTTags;
import noppes.npcs.api.entity.ICustomNpc;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.api.handler.IPlayerFactionData;
import noppes.npcs.api.handler.data.IFaction;
import noppes.npcs.controllers.FactionController;
import noppes.npcs.controllers.PlayerDataController;
@@ -133,8 +134,8 @@ public class Faction implements IFaction {
}
public int playerStatus(IPlayer player) {
PlayerFactionData data = PlayerData.get((EntityPlayer) player.getMCEntity()).factionData;
int points = data.getFactionPoints(this.id);
IPlayerFactionData data = player.getData().getFactionData();
int points = data.getPoints(this.id);
if (points >= this.friendlyPoints) {
return 1;
} else {