From 8d1cba57f81e8b287048ded77749662e1ffb2111 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 14 Aug 2012 18:05:18 -0400 Subject: [PATCH] Add in a helper for code migrating from ML renderer stuff --- .../fml/client/registry/RenderingRegistry.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/client/cpw/mods/fml/client/registry/RenderingRegistry.java b/client/cpw/mods/fml/client/registry/RenderingRegistry.java index 38cf827f14..f9be503907 100644 --- a/client/cpw/mods/fml/client/registry/RenderingRegistry.java +++ b/client/cpw/mods/fml/client/registry/RenderingRegistry.java @@ -19,6 +19,10 @@ import cpw.mods.fml.client.TextureFXManager; import cpw.mods.fml.client.modloader.ModLoaderBlockRendererHandler; import cpw.mods.fml.common.ObfuscationReflectionHelper; +/** + * @author cpw + * + */ public class RenderingRegistry { private static final RenderingRegistry INSTANCE = new RenderingRegistry(); @@ -63,6 +67,18 @@ public class RenderingRegistry instance().blockRenderers.put(handler.getRenderId(), handler); } + /** + * Register the simple block rendering handler + * This version will not call getRenderId on the passed in handler, instead using the supplied ID, so you + * can easily re-use the same rendering handler for multiple IDs + * + * @param renderId + * @param handler + */ + public static void registerBlockHandler(int renderId, ISimpleBlockRenderingHandler handler) + { + instance().blockRenderers.put(renderId, handler); + } /** * Get the next available renderId from the block render ID list *