@@ -66,13 +66,6 @@ public static boolean isAwarded(ILootrInfoProvider provider, ServerPlayer player
6666 @ Deprecated
6767 public static boolean isAwarded (UUID uuid , ServerPlayer player ) {
6868 return false ;
69- /* DimensionDataStorage manager = DataStorage.getDataStorage();
70- if (manager == null) {
71- LootrAPI.LOG.error("DataStorage is null at this stage; Lootr cannot determine if advancement has been awarded.");
72- return false;
73- }
74- AdvancementData data = manager.computeIfAbsent(AdvancementData.FACTORY, ADVANCEMENTS);
75- return data.contains(player.getUUID(), uuid);*/
7669 }
7770
7871 @ ApiStatus .Internal
@@ -84,20 +77,16 @@ public static void award(ILootrInfoProvider provider, ServerPlayer player) {
8477 @ ApiStatus .Internal
8578 @ Deprecated
8679 public static void award (UUID id , ServerPlayer player ) {
87- /* DimensionDataStorage manager = DataStorage.getDataStorage();
88- if (manager == null) {
89- LootrAPI.LOG.error("DataStorage is null at this stage; Lootr cannot award advancement.");
90- return;
91- }
92- AdvancementData data = manager.computeIfAbsent(AdvancementData.FACTORY, ADVANCEMENTS);
93- data.add(player.getUUID(), id);*/
9480 }
9581
9682 @ ApiStatus .Internal
9783 public static int getDecayValue (ILootrInfoProvider provider ) {
9884 DimensionDataStorage manager = DataStorage .getDataStorage ();
9985 if (manager == null ) {
100- LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot determine the decay value for " + provider .getInfoUUID () + "." );
86+ if (provider .getInfoLevel () != null && provider .getInfoLevel ().isClientSide ()) {
87+ return -1 ;
88+ }
89+ LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot determine the decay value for {}." , provider .getInfoUUID ());
10190 return -1 ;
10291 }
10392 TickingData data = manager .computeIfAbsent (TickingData .FACTORY , DECAYS );
@@ -108,7 +97,10 @@ public static int getDecayValue(ILootrInfoProvider provider) {
10897 public static boolean isDecayed (ILootrInfoProvider provider ) {
10998 DimensionDataStorage manager = DataStorage .getDataStorage ();
11099 if (manager == null ) {
111- LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot determine the decay value for " + provider .getInfoUUID () + "." );
100+ if (provider .getInfoLevel () != null && provider .getInfoLevel ().isClientSide ()) {
101+ return false ;
102+ }
103+ LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot determine if {} has decayed." , provider .getInfoUUID ());
112104 return false ;
113105 }
114106 TickingData data = manager .computeIfAbsent (TickingData .FACTORY , DECAYS );
@@ -119,7 +111,10 @@ public static boolean isDecayed(ILootrInfoProvider provider) {
119111 public static void setDecaying (ILootrInfoProvider provider ) {
120112 DimensionDataStorage manager = DataStorage .getDataStorage ();
121113 if (manager == null ) {
122- LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot set the decay value for " + provider .getInfoUUID () + "." );
114+ if (provider .getInfoLevel () != null && provider .getInfoLevel ().isClientSide ()) {
115+ return ;
116+ }
117+ LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot set the decay value for {}." , provider .getInfoUUID ());
123118 return ;
124119 }
125120 TickingData data = manager .computeIfAbsent (TickingData .FACTORY , DECAYS );
@@ -130,7 +125,10 @@ public static void setDecaying(ILootrInfoProvider provider) {
130125 public static void removeDecayed (ILootrInfoProvider provider ) {
131126 DimensionDataStorage manager = DataStorage .getDataStorage ();
132127 if (manager == null ) {
133- LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr remove the decay value for " + provider .getInfoUUID () + "." );
128+ if (provider .getInfoLevel () != null && provider .getInfoLevel ().isClientSide ()) {
129+ return ;
130+ }
131+ LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr remove the decay value for {}." , provider .getInfoUUID ());
134132 return ;
135133 }
136134 TickingData data = manager .computeIfAbsent (TickingData .FACTORY , DECAYS );
@@ -152,7 +150,10 @@ public static void doTick() {
152150 public static int getRefreshValue (ILootrInfoProvider provider ) {
153151 DimensionDataStorage manager = DataStorage .getDataStorage ();
154152 if (manager == null ) {
155- LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot determine the refresh value for " + provider .getInfoUUID () + "." );
153+ if (provider .getInfoLevel () != null && provider .getInfoLevel ().isClientSide ()) {
154+ return -1 ;
155+ }
156+ LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot determine the refresh value for {}." , provider .getInfoUUID ());
156157 return -1 ;
157158 }
158159 TickingData data = manager .computeIfAbsent (TickingData .FACTORY , REFRESHES );
@@ -163,7 +164,10 @@ public static int getRefreshValue(ILootrInfoProvider provider) {
163164 public static boolean isRefreshed (ILootrInfoProvider provider ) {
164165 DimensionDataStorage manager = DataStorage .getDataStorage ();
165166 if (manager == null ) {
166- LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot determine the refresh value for " + provider .getInfoUUID () + "." );
167+ if (provider .getInfoLevel () != null && provider .getInfoLevel ().isClientSide ()) {
168+ return false ;
169+ }
170+ LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot determine if {} has refreshed." , provider .getInfoUUID ());
167171 return false ;
168172 }
169173 TickingData data = manager .computeIfAbsent (TickingData .FACTORY , REFRESHES );
@@ -174,7 +178,10 @@ public static boolean isRefreshed(ILootrInfoProvider provider) {
174178 public static void setRefreshing (ILootrInfoProvider provider ) {
175179 DimensionDataStorage manager = DataStorage .getDataStorage ();
176180 if (manager == null ) {
177- LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot set the refresh value for " + provider .getInfoUUID () + "." );
181+ if (provider .getInfoLevel () != null && provider .getInfoLevel ().isClientSide ()) {
182+ return ;
183+ }
184+ LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot set the refresh value for {}." , provider .getInfoUUID ());
178185 return ;
179186 }
180187 TickingData data = manager .computeIfAbsent (TickingData .FACTORY , REFRESHES );
@@ -185,7 +192,10 @@ public static void setRefreshing(ILootrInfoProvider provider) {
185192 public static void removeRefreshed (ILootrInfoProvider provider ) {
186193 DimensionDataStorage manager = DataStorage .getDataStorage ();
187194 if (manager == null ) {
188- LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr remove the refresh value for " + provider .getInfoUUID () + "." );
195+ if (provider .getInfoLevel () != null && provider .getInfoLevel ().isClientSide ()) {
196+ return ;
197+ }
198+ LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr remove the refresh value for {}." ,provider .getInfoUUID ());
189199 return ;
190200 }
191201 TickingData data = manager .computeIfAbsent (TickingData .FACTORY , REFRESHES );
@@ -196,7 +206,10 @@ public static void removeRefreshed(ILootrInfoProvider provider) {
196206 public static LootrSavedData getData (ILootrInfoProvider provider ) {
197207 DimensionDataStorage manager = DataStorage .getDataStorage ();
198208 if (manager == null ) {
199- LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot fetch data for " + provider .getInfoDimension () + " at " + provider .getInfoPos () + " with ID " + provider .getInfoUUID () + " and cannot continue." );
209+ if (provider .getInfoLevel () != null && provider .getInfoLevel ().isClientSide ()) {
210+ return null ;
211+ }
212+ LootrAPI .LOG .error ("DataStorage is null at this stage; Lootr cannot fetch data for {} at {} with ID {} and cannot continue." , provider .getInfoDimension (), provider .getInfoPos (), provider .getInfoUUID ());
200213 return null ;
201214 }
202215 LootrSavedData result = manager .computeIfAbsent (new SavedData .Factory <>(LootrSavedData .fromInfo (provider ), LootrSavedData ::load , null ), provider .getInfoKey ());
0 commit comments