File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
enigma-swing/src/main/java/org/quiltmc/enigma/gui/config Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 3232import java .awt .Point ;
3333import java .nio .file .Path ;
3434import java .nio .file .Paths ;
35+ import java .util .Objects ;
3536
3637/**
3738 * Enigma config is separated into several {@value #FORMAT} files with names matching the methods used to access them:
@@ -237,7 +238,11 @@ public static Vec2i fromPoint(Point point) {
237238
238239 @ Override
239240 public Vec2i convertFrom (ValueMap <Integer > representation ) {
240- return new Vec2i (representation .get ("x" ), representation .get ("y" ));
241+ final int defaultValue = Objects .requireNonNullElse (representation .getDefaultValue (), 0 );
242+ return new Vec2i (
243+ representation .getOrDefault ("x" , defaultValue ),
244+ representation .getOrDefault ("y" , defaultValue )
245+ );
241246 }
242247
243248 @ Override
You can’t perform that action at this time.
0 commit comments