Skip to content

Commit

Permalink
Fixes #85
Browse files Browse the repository at this point in the history
  • Loading branch information
Rongmario committed Aug 31, 2023
1 parent d0e2050 commit 28cc496
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.cleanroommc.groovyscript.helper.recipe.AbstractRecipeBuilder;
import com.cleanroommc.groovyscript.registry.VirtualizedRegistry;
import epicsquid.mysticallib.util.ConfigUtil;
import epicsquid.roots.config.MossConfig;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
Expand All @@ -22,12 +23,7 @@ public class Moss extends VirtualizedRegistry<Pair<ItemStack, ItemStack>> {

public Moss() {
super();
// Roots adds the default ingredients after we have to, but only does so if mossyCobblestones is null.
// So we define it here to prevent NPEs and make sure we still respect the config.
// Probably a better way to do this, but it works.
if (MossConfigAccessor.getMossyCobblestones() == null) {
MossConfigAccessor.setMossyCobblestones(ConfigUtil.parseMap(new HashMap<>(), ConfigUtil::parseItemStack, ConfigUtil::parseItemStack, ",", MossyCobblestones));
}
MossConfig.getMossyCobblestones(); // Initialize backing map first, this way we can respect its config
}

public static RecipeBuilder recipeBuilder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ static Map<ItemStack, ItemStack> getMossyCobblestones() {
throw new UnsupportedOperationException();
}

@Accessor("mossyCobblestones")
static void setMossyCobblestones(Map<ItemStack, ItemStack> map) {
throw new UnsupportedOperationException();
}

@Accessor
static BiMap<Block, Block> getMossyBlocks() {
throw new UnsupportedOperationException();
Expand Down

0 comments on commit 28cc496

Please sign in to comment.