77import dev .oribuin .fishing .manager .TotemManager ;
88import dev .oribuin .fishing .model .item .ItemConstruct ;
99import dev .oribuin .fishing .model .item .ItemRegistry ;
10- import dev .oribuin .fishing .storage .util .PersistKeys ;
10+ import dev .oribuin .fishing .storage .util .KeyRegistry ;
1111import dev .oribuin .fishing .util .FishUtils ;
1212import dev .oribuin .fishing .util .math .MathL ;
1313import dev .rosewood .rosegarden .utils .StringPlaceholders ;
@@ -221,13 +221,13 @@ public void saveTo(ItemStack itemStack) {
221221 * @param container The container to save the values to
222222 */
223223 public void saveToContainer (PersistentDataContainer container ) {
224- container .set (PersistKeys .TOTEM_OWNER , DataType .UUID , this .owner );
225- container .set (PersistKeys .TOTEM_OWNERNAME , DataType .STRING , this .ownerName );
226- container .set (PersistKeys .TOTEM_RADIUS , DataType .INTEGER , this .radius );
227- container .set (PersistKeys .TOTEM_ACTIVE , DataType .BOOLEAN , this .active );
228- container .set (PersistKeys .TOTEM_DURATION , DataType .LONG , this .duration .toMillis ());
229- container .set (PersistKeys .TOTEM_COOLDOWN , DataType .LONG , this .cooldown .toMillis ());
230- container .set (PersistKeys .TOTEM_LASTACTIVE , DataType .LONG , this .lastActive );
224+ container .set (KeyRegistry .TOTEM_OWNER , DataType .UUID , this .owner );
225+ container .set (KeyRegistry .TOTEM_OWNERNAME , DataType .STRING , this .ownerName );
226+ container .set (KeyRegistry .TOTEM_RADIUS , DataType .INTEGER , this .radius );
227+ container .set (KeyRegistry .TOTEM_ACTIVE , DataType .BOOLEAN , this .active );
228+ container .set (KeyRegistry .TOTEM_DURATION , DataType .LONG , this .duration .toMillis ());
229+ container .set (KeyRegistry .TOTEM_COOLDOWN , DataType .LONG , this .cooldown .toMillis ());
230+ container .set (KeyRegistry .TOTEM_LASTACTIVE , DataType .LONG , this .lastActive );
231231 }
232232
233233 /**
@@ -238,13 +238,13 @@ public void saveToContainer(PersistentDataContainer container) {
238238 * @return The totem object
239239 */
240240 public static Totem fromContainer (PersistentDataContainer container ) {
241- UUID owner = container .get (PersistKeys .TOTEM_OWNER , DataType .UUID );
242- String ownerName = container .getOrDefault (PersistKeys .TOTEM_OWNERNAME , DataType .STRING , "N/A" );
243- Integer radius = container .get (PersistKeys .TOTEM_RADIUS , DataType .INTEGER );
244- boolean active = container .getOrDefault (PersistKeys .TOTEM_ACTIVE , DataType .BOOLEAN , false );
245- Long duration = container .get (PersistKeys .TOTEM_DURATION , DataType .LONG );
246- Long cooldown = container .get (PersistKeys .TOTEM_COOLDOWN , DataType .LONG );
247- long lastActive = container .getOrDefault (PersistKeys .TOTEM_LASTACTIVE , DataType .LONG , System .currentTimeMillis ());
241+ UUID owner = container .get (KeyRegistry .TOTEM_OWNER , DataType .UUID );
242+ String ownerName = container .getOrDefault (KeyRegistry .TOTEM_OWNERNAME , DataType .STRING , "N/A" );
243+ Integer radius = container .get (KeyRegistry .TOTEM_RADIUS , DataType .INTEGER );
244+ boolean active = container .getOrDefault (KeyRegistry .TOTEM_ACTIVE , DataType .BOOLEAN , false );
245+ Long duration = container .get (KeyRegistry .TOTEM_DURATION , DataType .LONG );
246+ Long cooldown = container .get (KeyRegistry .TOTEM_COOLDOWN , DataType .LONG );
247+ long lastActive = container .getOrDefault (KeyRegistry .TOTEM_LASTACTIVE , DataType .LONG , System .currentTimeMillis ());
248248
249249 if (owner == null || radius == null || duration == null || cooldown == null ) return null ;
250250
0 commit comments