Skip to content

Commit

Permalink
Register OreDict recipes during registry event. Fixes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
BrockWS committed Jan 14, 2019
1 parent 2de0387 commit 4a92d73
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/main/java/minechem/init/ModEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -400,19 +400,6 @@ else if (fluidBlock.getFluid() instanceof FluidMolecule) {
}
}

@SubscribeEvent
public void onOreEvent(OreDictionary.OreRegisterEvent event) {
String oreName = event.getName();
if (ModRecipes.getOreDictionaryHandlers() != null) {
for (IOreDictionaryHandler handler : ModRecipes.getOreDictionaryHandlers()) {
if (handler.canHandle(oreName)) {
handler.handle(oreName);
return;
}
}
}
}

@SubscribeEvent
public void onDecayEvent(RadiationDecayEvent event) {
if (event.getPlayer() != null) {
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/minechem/init/ModRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -2001,6 +2001,18 @@ public static void registerCustomRecipes(IForgeRegistry<IRecipe> registry) {
registry.register(new RecipePotionCoating());
registry.register(new RecipePotionSpiking());
registry.register(new RecipeCloneChemistJournal());

for (String oreName : OreDictionary.getOreNames()) {
ModLogger.debug("Checking oredict " + oreName);
if (ModRecipes.getOreDictionaryHandlers() != null) {
for (IOreDictionaryHandler handler : ModRecipes.getOreDictionaryHandlers()) {
if (handler.canHandle(oreName)) {
handler.handle(oreName);
break;
}
}
}
}
}

//TODO
Expand Down

0 comments on commit 4a92d73

Please sign in to comment.