Rework custom recipe system (#3232)
This commit is contained in:
@@ -24,12 +24,8 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import appeng.core.AELog;
|
||||
import appeng.recipes.game.IRecipeBakeable;
|
||||
|
||||
|
||||
public class OreDictionaryHandler
|
||||
{
|
||||
@@ -38,8 +34,6 @@ public class OreDictionaryHandler
|
||||
|
||||
private final List<IOreListener> oreListeners = new ArrayList<>();
|
||||
|
||||
private boolean enableRebaking = false;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onOreDictionaryRegister( final OreDictionary.OreRegisterEvent event )
|
||||
{
|
||||
@@ -55,11 +49,6 @@ public class OreDictionaryHandler
|
||||
v.oreRegistered( event.getName(), event.getOre() );
|
||||
}
|
||||
}
|
||||
|
||||
if( this.enableRebaking )
|
||||
{
|
||||
this.bakeRecipes();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -74,26 +63,6 @@ public class OreDictionaryHandler
|
||||
return true;
|
||||
}
|
||||
|
||||
public void bakeRecipes()
|
||||
{
|
||||
this.enableRebaking = true;
|
||||
|
||||
for( final Object o : ForgeRegistries.RECIPES.getValues() )
|
||||
{
|
||||
if( o instanceof IRecipeBakeable )
|
||||
{
|
||||
try
|
||||
{
|
||||
( (IRecipeBakeable) o ).bake();
|
||||
}
|
||||
catch( final Throwable e )
|
||||
{
|
||||
AELog.debug( e );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new IOreListener and immediately notifies it of any previous ores, any ores added latter will be added at
|
||||
* that point.
|
||||
|
||||
Reference in New Issue
Block a user