@@ -256,6 +256,8 @@ protected RElementValue(Window parentFrame, Class<?> InputType, FieldFilter Filt
256256 JComboBox <String > newInput ;
257257 if (anno .value ()[0 ].equals ("_VANILLABIOMES" ))
258258 newInput = new JComboBox <String >(SourceBiomeElement .getVanillaBiomeNames ());
259+ else if (anno .value ()[0 ].equals ("_PREFIXEDVANILLABIOMES" ))
260+ newInput = new JComboBox <String >(SourceBiomeElement .getPrefixedVanillaBiomeNames ());
259261 else
260262 newInput = new JComboBox <String >(anno .value ());
261263
@@ -272,6 +274,19 @@ protected RElementValue(Window parentFrame, Class<?> InputType, FieldFilter Filt
272274 }
273275 }
274276
277+ JButton removeButton = new JButton ("-" );
278+
279+ toAdd .Lay .putConstraint (SpringLayout .VERTICAL_CENTER , removeButton , 0 ,
280+ SpringLayout .VERTICAL_CENTER , toAdd );
281+ toAdd .Lay .putConstraint (SpringLayout .WEST , toAdd .Input , 3 , SpringLayout .EAST , removeButton );
282+
283+ toAdd .add (removeButton );
284+ removeButton .addActionListener (ac -> {
285+ HashMapInnerPane .remove (toAdd );
286+ HashMapInnerPane .repaint ();
287+ HashMapInnerPane .revalidate ();
288+ });
289+
275290 toAdd .setAlignmentX (0.5f );
276291
277292 HashMapInnerPane .add (Box .createVerticalStrut (10 ));
@@ -341,19 +356,17 @@ protected RElementValue(Window parentFrame, Class<?> InputType, FieldFilter Filt
341356 } else if (anno != null && field != null ) { // dropdown string
342357 if (anno .value ()[0 ].equals ("_VANILLABIOMES" ))
343358 Input = new JComboBox <String >(SourceBiomeElement .getVanillaBiomeNames ());
359+ else if (anno .value ()[0 ].equals ("_PREFIXEDVANILLABIOMES" ))
360+ Input = new JComboBox <String >(SourceBiomeElement .getPrefixedVanillaBiomeNames ());
344361 else
345362 Input = new JComboBox <String >(anno .value ());
346363 try {
347364 // if its strict, dont make it editable
348365 ((JComboBox <String >) Input ).setEditable (!anno .strict ());
349366 if (!FromEmpty ) {
350367 ((JComboBox <String >) Input ).setSelectedItem (field .get (TargetFile ));
351- } else {
352- if (anno .value ()[0 ].equals ("_VANILLABIOMES" ))
353- ((JComboBox <String >) Input )
354- .setSelectedItem (SourceBiomeElement .getVanillaBiomeNames ()[0 ]);
355- else
356- ((JComboBox <String >) Input ).setSelectedItem (anno .value ()[0 ]);
368+ } else if (anno .strict ()) {
369+ ((JComboBox <String >) Input ).setSelectedIndex (0 );
357370 }
358371 } catch (Exception e ) {
359372
@@ -935,6 +948,8 @@ else if (!InputType.isAssignableFrom(value.getClass())) {
935948 JComboBox <String > newInput ;
936949 if (anno .value ()[0 ].equals ("_VANILLABIOMES" )) {
937950 newInput = new JComboBox <String >(SourceBiomeElement .getVanillaBiomeNames ());
951+ } else if (anno .value ()[0 ].equals ("_PREFIXEDVANILLABIOMES" )) {
952+ newInput = new JComboBox <String >(SourceBiomeElement .getPrefixedVanillaBiomeNames ());
938953 } else {
939954 newInput = new JComboBox <String >(anno .value ());
940955 }
@@ -952,6 +967,19 @@ else if (!InputType.isAssignableFrom(value.getClass())) {
952967 ((JComboBox <String >) newInput ).setSelectedItem (entry );
953968 }
954969
970+ JButton removeButton = new JButton ("-" );
971+
972+ toAdd .Lay .putConstraint (SpringLayout .VERTICAL_CENTER , removeButton , 0 , SpringLayout .VERTICAL_CENTER ,
973+ toAdd );
974+ toAdd .Lay .putConstraint (SpringLayout .WEST , toAdd .Input , 3 , SpringLayout .EAST , removeButton );
975+
976+ toAdd .add (removeButton );
977+ removeButton .addActionListener (ac -> {
978+ HashMapInnerPane .remove (toAdd );
979+ HashMapInnerPane .repaint ();
980+ HashMapInnerPane .revalidate ();
981+ });
982+
955983 HashMapInnerPane .add (Box .createRigidArea (new Dimension (100 , 10 )));
956984 HashMapInnerPane .add (toAdd );
957985 }
@@ -961,7 +989,7 @@ else if (!InputType.isAssignableFrom(value.getClass())) {
961989 } else if (Map .class .isAssignableFrom (InputType )) {
962990 try {
963991 for (Map .Entry <Object , Object > entry : ((HashMap <Object , Object >) value ).entrySet ()) {
964- var ToAdd = new RElementMapValue (parentFrame ,
992+ RElementMapValue ToAdd = new RElementMapValue (parentFrame ,
965993 RMapElement .LookupMap .get (entry .getKey ().toString ()));
966994 ToAdd .setVal (entry .getValue ());
967995
@@ -1060,7 +1088,7 @@ public Object getValue() {
10601088 var casted = ((JComboBox <String >) Input );
10611089 return (casted .getSelectedIndex () == 0 );
10621090 } else if (Map .class .isAssignableFrom (InputType )) {
1063- var mapToBuild = new HashMap <RMapElement , Object >();
1091+ HashMap < RMapElement , Object > mapToBuild = new HashMap <RMapElement , Object >();
10641092 for (Component comp : HashMapInnerPane .getComponents ()) {
10651093 if (comp instanceof RElementMapValue remv ) {
10661094 RElementMapValue mapElement = remv ;
0 commit comments