File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/main/java/com/cleanroommc/groovyscript/compat/mods/chisel Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -41,13 +41,19 @@ public static CarvingGroup carvingGroup(String group) {
41
41
42
42
@ Override
43
43
public void onReload () {
44
- removeScripted ().forEach (pair -> getRegistry ().removeVariation (pair .getValue (), pair .getKey ()));
45
- restoreFromBackup ().forEach (pair -> getRegistry ().addVariation (pair .getKey (), CarvingUtils .variationFor (pair .getValue (), 0 )));
46
-
47
44
groupStorage .restoreFromBackup ().forEach (group -> getRegistry ().addGroup (CarvingUtils .getDefaultGroupFor (group )));
48
45
groupStorage .removeScripted ().forEach (getRegistry ()::removeGroup );
49
46
50
- soundStorage .restoreFromBackup ().forEach (pair -> getRegistry ().setVariationSound (pair .getKey (), pair .getValue ()));
47
+ removeScripted ().forEach (pair -> {
48
+ if (getRegistry ().getGroup (pair .getKey ()) != null ) getRegistry ().removeVariation (pair .getValue (), pair .getKey ());
49
+ });
50
+ restoreFromBackup ().forEach (pair -> {
51
+ if (getRegistry ().getGroup (pair .getKey ()) != null ) getRegistry ().addVariation (pair .getKey (), CarvingUtils .variationFor (pair .getValue (), 0 ));
52
+ });
53
+
54
+ soundStorage .restoreFromBackup ().forEach (pair -> {
55
+ if (getRegistry ().getGroup (pair .getKey ()) != null ) getRegistry ().setVariationSound (pair .getKey (), pair .getValue ());
56
+ });
51
57
}
52
58
53
59
@ MethodDescription (example = {@ Example ("'demo', item('minecraft:diamond_block')" ),
You can’t perform that action at this time.
0 commit comments