File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
src/main/java/anticope/rejects Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -73,9 +73,9 @@ protected NbtCompound save(NbtCompound tag) {
7373 protected Map <String , String > load (NbtCompound tag ) {
7474 get ().clear ();
7575
76- Optional < NbtCompound > valueTag = tag .getCompound ("map" );
77- for (String key : valueTag .get (). getKeys ()) {
78- get ().put (key , String .valueOf (valueTag .get (). getString (key )));
76+ NbtCompound valueTag = tag .getCompoundOrEmpty ("map" );
77+ for (String key : valueTag .getKeys ()) {
78+ get ().put (key , String .valueOf (valueTag .getString (key )));
7979 }
8080
8181 return get ();
Original file line number Diff line number Diff line change 88import net .minecraft .text .*;
99import net .minecraft .util .Formatting ;
1010
11- import java .util .Optional ;
12-
1311public class Seed {
1412 public final Long seed ;
1513 public final MCVersion version ;
@@ -28,10 +26,10 @@ public NbtCompound toTag() {
2826 return tag ;
2927 }
3028
31- public static Seed fromTag (Optional < NbtCompound > tag ) {
29+ public static Seed fromTag (NbtCompound tag ) {
3230 return new Seed (
33- tag .get (). getLong ("seed" , 1 ),
34- MCVersion .fromString (String .valueOf (tag .get (). getString ("version" )))
31+ tag .getLong ("seed" , 1 ),
32+ MCVersion .fromString (String .valueOf (tag .getString ("version" )))
3533 );
3634 }
3735
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ public NbtCompound toTag() {
8383 @ Override
8484 public Seeds fromTag (NbtCompound tag ) {
8585 tag .getKeys ().forEach (key -> {
86- seeds .put (key , Seed .fromTag (tag .getCompound (key )));
86+ seeds .put (key , Seed .fromTag (tag .getCompoundOrEmpty (key )));
8787 });
8888 return this ;
8989 }
You can’t perform that action at this time.
0 commit comments