@@ -41,8 +41,8 @@ public static void init() {
41
41
vanillaCompostableItems = new Object2FloatArrayMap <>(ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE );
42
42
43
43
// Generate settings if they aren't already present.
44
- if (!Config .INSTANCE .isReady ()) {
45
- Config .INSTANCE .generateSettings ();
44
+ if (!Config .instance .isReady ()) {
45
+ Config .instance .generateSettings ();
46
46
}
47
47
48
48
ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE .clear ();
@@ -55,8 +55,10 @@ public static void init() {
55
55
// This is somewhat hacky, but intends to make sure that other implementations
56
56
// such as QSL has the ability to register its own additions via its internal
57
57
// registries.
58
- ServerLifecycleEvents .START_DATA_PACK_RELOAD
59
- .register ((server , resourceManager ) -> ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE .clear ());
58
+ ServerLifecycleEvents .START_DATA_PACK_RELOAD .register ((server , resourceManager ) -> {
59
+ ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE .clear ();
60
+ Config .reload ();
61
+ });
60
62
61
63
ServerLifecycleEvents .END_DATA_PACK_RELOAD .register ((server , resourceManager , success ) -> hotLoad ());
62
64
@@ -67,7 +69,7 @@ public static void init() {
67
69
ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE .putAll (vanillaCompostableItems );
68
70
69
71
vanillaCompostableItems = null ;
70
- } else if (Config .INSTANCE .disableDefaultVanillaRegistry ) {
72
+ } else if (Config .instance .disableDefaultVanillaRegistry ) {
71
73
logger .warn ("The vanillaCompostableItems map is missing. This shouldn't happen!" );
72
74
}
73
75
});
@@ -84,18 +86,18 @@ public static void hotLoad() {
84
86
// cleared.
85
87
// This intends to clear any interference that may otherwise be caused by
86
88
// hot reloading.
87
- if (Config .INSTANCE .disableDefaultVanillaRegistry ) {
89
+ if (Config .instance .disableDefaultVanillaRegistry ) {
88
90
// The registry is already cleared by the outer method prior to reloading.
89
91
// This only clears if datapack clearing is also enabled.
90
- if (Config .INSTANCE .disableDatapackRegistry ) {
92
+ if (Config .instance .disableDatapackRegistry ) {
91
93
logger .info ("[DDC] Evoking {} as `disableDatapackRegistry` for the composter is enabled." ,
92
94
ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE );
93
95
ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE .clear ();
94
96
}
95
97
} else {
96
98
// Same as above, but redeploys the vanilla registry.
97
99
// Not sure why you want this, but here you go.
98
- if (Config .INSTANCE .disableDatapackRegistry ) {
100
+ if (Config .instance .disableDatapackRegistry ) {
99
101
logger .info (
100
102
"[DDC] Evoking {} in favour of vanilla registry base as `disableDatapackRegistry` for the composter is enabled." ,
101
103
ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE );
@@ -128,7 +130,7 @@ public static void hotLoad() {
128
130
public static void register () {
129
131
var compostableItems = new Object2FloatOpenHashMap <ItemConvertible >();
130
132
131
- Config .INSTANCE .compostableItems .forEach ((k , v ) -> {
133
+ Config .instance .compostableItems .forEach ((k , v ) -> {
132
134
var item = Registry .ITEM .getOrEmpty (k );
133
135
if (item .isEmpty ()) {
134
136
logger .warn ("{} -> {} not preset at current time." , k , v );
0 commit comments