From 7ed7da159ec881517a1e1dbd80b9209c5821e53a Mon Sep 17 00:00:00 2001 From: Lex Manos Date: Fri, 6 Feb 2015 21:35:11 -0800 Subject: [PATCH] Fixed debugging Dedicated server in Forge Dev workspace. --- .../minecraftforge/debug/ModelLoaderRegistryDebug.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/test/java/net/minecraftforge/debug/ModelLoaderRegistryDebug.java b/src/test/java/net/minecraftforge/debug/ModelLoaderRegistryDebug.java index b0d08782f..3fe304b15 100644 --- a/src/test/java/net/minecraftforge/debug/ModelLoaderRegistryDebug.java +++ b/src/test/java/net/minecraftforge/debug/ModelLoaderRegistryDebug.java @@ -42,11 +42,13 @@ import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; +import net.minecraftforge.fml.relauncher.Side; import com.google.common.base.Function; import com.google.common.primitives.Ints; @Mod(modid = ModelLoaderRegistryDebug.MODID, version = ModelLoaderRegistryDebug.VERSION) + public class ModelLoaderRegistryDebug { public static final String MODID = "ForgeDebugModelLoaderRegistry"; @@ -54,10 +56,16 @@ public class ModelLoaderRegistryDebug @EventHandler public void preInit(FMLPreInitializationEvent event) + { + GameRegistry.registerBlock(CustomModelBlock.instance, CustomModelBlock.name); + if (event.getSide() == Side.CLIENT) + clientPreInit(); + } + + private void clientPreInit() { //ModelLoaderRegistry.registerLoader(DummyModelLoader.instance); B3DLoader.instance.addDomain(MODID.toLowerCase()); - GameRegistry.registerBlock(CustomModelBlock.instance, CustomModelBlock.name); //ModelBakery.addVariantName(Item.getItemFromBlock(CustomModelBlock.instance), "forgedebug:dummymodel"); String modelLocation = MODID.toLowerCase() + ":untitled2.b3d"; ModelBakery.addVariantName(Item.getItemFromBlock(CustomModelBlock.instance), modelLocation);