-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed server side trying to register an ISimpleItemRenderer
- Loading branch information
1 parent
942c49f
commit ce549e8
Showing
3 changed files
with
301 additions
and
302 deletions.
There are no files selected for viewing
32 changes: 23 additions & 9 deletions
32
src/main/scala/com/builtbroken/mc/core/registry/ClientRegistryProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,32 @@ | ||
package com.builtbroken.mc.core.registry; | ||
|
||
import com.builtbroken.mc.api.items.ISimpleItemRenderer; | ||
import com.builtbroken.mc.lib.render.block.ItemRenderHandler; | ||
import com.builtbroken.mc.lib.render.block.RenderTileDummy; | ||
import cpw.mods.fml.client.registry.ClientRegistry; | ||
import net.minecraft.block.Block; | ||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.tileentity.TileEntity; | ||
import com.builtbroken.mc.lib.render.block.RenderTileDummy; | ||
|
||
public class ClientRegistryProxy extends CommonRegistryProxy | ||
{ | ||
@Override | ||
public void registerDummyRenderer(Class<? extends TileEntity> clazz) | ||
{ | ||
if (!TileEntityRendererDispatcher.instance.mapSpecialRenderers.containsKey(clazz)) | ||
{ | ||
ClientRegistry.bindTileEntitySpecialRenderer(clazz, new RenderTileDummy()); | ||
} | ||
} | ||
@Override | ||
public void registerTileEntity(String name, String prefix, Block block, TileEntity tile) | ||
{ | ||
super.registerTileEntity(name, prefix, block, tile); | ||
if (tile instanceof ISimpleItemRenderer) | ||
{ | ||
ItemRenderHandler.register(new ItemStack(block).getItem(), (ISimpleItemRenderer) tile); | ||
} | ||
} | ||
|
||
@Override | ||
public void registerDummyRenderer(Class<? extends TileEntity> clazz) | ||
{ | ||
if (!TileEntityRendererDispatcher.instance.mapSpecialRenderers.containsKey(clazz)) | ||
{ | ||
ClientRegistry.bindTileEntitySpecialRenderer(clazz, new RenderTileDummy()); | ||
} | ||
} | ||
} |
5 changes: 3 additions & 2 deletions
5
src/main/scala/com/builtbroken/mc/core/registry/CommonRegistryProxy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.