File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/main/java/org/mvplugins/multiverse/inventories/share Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 3636import java .util .LinkedList ;
3737import java .util .List ;
3838import java .util .Map ;
39+ import java .util .Objects ;
3940import java .util .Set ;
4041import java .util .UUID ;
4142import java .util .stream .Collectors ;
@@ -793,7 +794,9 @@ public boolean updatePlayer(Player player, ProfileData profile) {
793794 @ Override
794795 public void updateProfile (ProfileData profile , Player player ) {
795796 List <String > recipes = player .getDiscoveredRecipes ().stream ()
796- .map (NamespacedKey ::toString )
797+ // Save space by removing the namespace if its default minecraft
798+ .map (key -> NamespacedKey .MINECRAFT .equals (key .getNamespace ())
799+ ? key .getKey () : key .toString ())
797800 .toList ();
798801 profile .set (RECIPES , recipes );
799802 }
@@ -808,6 +811,7 @@ public boolean updatePlayer(Player player, ProfileData profile) {
808811
809812 Set <NamespacedKey > discoveredRecipes = player .getDiscoveredRecipes ();
810813 Set <NamespacedKey > toDiscover = recipes .stream ().map (NamespacedKey ::fromString )
814+ .filter (Objects ::nonNull )
811815 .collect (Collectors .toSet ());
812816
813817 player .undiscoverRecipes (Sets .difference (discoveredRecipes , toDiscover ));
You can’t perform that action at this time.
0 commit comments