Fixed crash caused by delayed block registration.

Added Callback section for the Model Registry event to the builder setup.
Moved the State Mapper section to the Model Registry Callback section.
This commit is contained in:
Gunther De Wachter
2017-07-06 14:05:54 +02:00
parent d8c5e6a5fa
commit 198ea9f16e
8 changed files with 58 additions and 46 deletions
@@ -0,0 +1,15 @@
package appeng.bootstrap.components;
import appeng.bootstrap.IBootstrapComponent;
import net.minecraftforge.fml.relauncher.Side;
/**
* @author GuntherDW
*/
@FunctionalInterface
public interface ModelRegComponent extends IBootstrapComponent {
void modelReg(Side side);
}
@@ -31,7 +31,7 @@ import net.minecraftforge.fml.relauncher.Side;
/**
* Registers a custom state mapper for a given block.
*/
public class StateMapperComponent implements PreInitComponent
public class StateMapperComponent implements ModelRegComponent
{
private final Block block;
@@ -45,7 +45,7 @@ public class StateMapperComponent implements PreInitComponent
}
@Override
public void preInitialize( Side side )
public void modelReg( Side side )
{
ModelLoader.setCustomStateMapper( block, stateMapper );
if( stateMapper instanceof IResourceManagerReloadListener )