mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-23 21:49:53 +00:00
Profile Sync Quest Data Crash Fix
This commit is contained in:
1 parent
5cf9b26a2e
commit
15749c8ad7
10 files changed
+179
-8
No files matched your search
@@ -2,6 +2,8 @@ package noppes.npcs.controllers.data;
|
||||
|
||||
import kamkeel.npcs.controllers.ProfileController;
|
||||
import kamkeel.npcs.controllers.data.profile.Profile;
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import noppes.npcs.client.ProfileClientConfig;
|
||||
import kamkeel.npcs.network.packets.data.QuestCompletionPacket;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
@@ -176,13 +178,22 @@ public class Quest implements ICompatibilty, IQuest {
|
||||
}
|
||||
|
||||
public long getTimeUntilRepeat(EntityPlayer player) {
|
||||
if (ConfigMain.ProfilesEnabled && profileOptions.enableOptions && profileOptions.cooldownControl == EnumProfileSync.Shared) {
|
||||
Profile profile = ProfileController.Instance.getProfile(player);
|
||||
if (profile != null) {
|
||||
Long questTime = profile.sharedQuestTimestamps.get(this.id);
|
||||
if (questTime == null) return 0L;
|
||||
if (profileOptions.enableOptions && profileOptions.cooldownControl == EnumProfileSync.Shared) {
|
||||
Long questTime = null;
|
||||
if (ProfileController.Instance != null) {
|
||||
if (ConfigMain.ProfilesEnabled) {
|
||||
Profile profile = ProfileController.Instance.getProfile(player);
|
||||
if (profile != null) {
|
||||
questTime = profile.sharedQuestTimestamps.get(this.id);
|
||||
}
|
||||
}
|
||||
} else if (ClientCacheHandler.allowProfiles) {
|
||||
questTime = ProfileClientConfig.getSharedQuestTimestamp(this.id);
|
||||
}
|
||||
if (questTime != null) {
|
||||
return calculateRemainingCooldown(player, questTime);
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
IPlayerQuestData questData = PlayerData.get(player).getQuestData();
|
||||
return getTimeUntilRepeatQuestData(player, questData);
|
||||
|
||||
Reference in new issue
Block a user