File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
src/main/java/net/kjp12/ddc Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 11# Project Specifics
2- projectVersion =0.2.0
2+ projectVersion =0.2.1
33modrinthId =jsiDlnm9
44
55# Minecraft
Original file line number Diff line number Diff line change 88
99import it .unimi .dsi .fastutil .objects .Object2FloatArrayMap ;
1010import it .unimi .dsi .fastutil .objects .Object2FloatMap ;
11+ import it .unimi .dsi .fastutil .objects .Object2FloatMaps ;
1112import it .unimi .dsi .fastutil .objects .Object2FloatOpenHashMap ;
1213import net .fabricmc .fabric .api .event .lifecycle .v1 .ServerLifecycleEvents ;
1314import net .minecraft .block .ComposterBlock ;
@@ -93,6 +94,18 @@ public static void hotLoad() {
9394 logger .info ("[DDC] Evoking {} as `disableDatapackRegistry` for the composter is enabled." ,
9495 ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE );
9596 ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE .clear ();
97+ } else {
98+ logger .info ("[DDC] Evoking vanilla registry entries manually to account for other mods." );
99+ // Capture a working map to avoid spamming the logs when our logger is enabled.
100+ var intermediary = new Object2FloatOpenHashMap <>(ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE );
101+ ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE .clear ();
102+
103+ // Manually clear out all *exact* entries from the intermediate step.
104+ Object2FloatMaps .fastForEach (vanillaCompostableItems ,
105+ e -> intermediary .remove (e .getKey (), e .getFloatValue ()));
106+
107+ // Set the intermediate step back into working.
108+ ComposterBlock .ITEM_TO_LEVEL_INCREASE_CHANCE .putAll (intermediary );
96109 }
97110 } else {
98111 // Same as above, but redeploys the vanilla registry.
You can’t perform that action at this time.
0 commit comments