* Use the correct event for loading models. * Introduce IModelRegistry to wrap the ModelLoader
This commit is contained in:
@@ -21,17 +21,18 @@ package appeng.bootstrap.components;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import appeng.bootstrap.IModelRegistry;
|
||||
|
||||
|
||||
/**
|
||||
* Registers a custom item mesh definition that can be used to dynamically determine the item model based on
|
||||
* item stack properties.
|
||||
*/
|
||||
public class ItemMeshDefinitionComponent implements InitComponent
|
||||
public class ItemMeshDefinitionComponent implements IModelRegistrationComponent
|
||||
{
|
||||
|
||||
private final Item item;
|
||||
@@ -45,8 +46,8 @@ public class ItemMeshDefinitionComponent implements InitComponent
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialize( Side side )
|
||||
public void modelRegistration( Side side, IModelRegistry registry )
|
||||
{
|
||||
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register( this.item, this.meshDefinition );
|
||||
registry.setCustomMeshDefinition( this.item, this.meshDefinition );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user