Xyfero Posted April 7, 2017 Posted April 7, 2017 (edited) Using Minecraft Forge 1.11.2-13.20.0.2264. I've got this in my ClientProxy: RenderingRegistry.registerEntityRenderingHandler(EntityCustomCow.class, RenderCustomCow::new); and I've checked that this is executing by printing to the console before this line. EntityCustomCow extends EntityCow and RenderCustomCow looks like this: @SideOnly(Side.CLIENT) public class RenderCustomCow extends RenderLiving<EntityCustomCow> { private static final ResourceLocation texture = new ResourceLocation("textures/entity/cow/mooshroom.png"); public RenderCustomCow(RenderManager manager) { super(manager, new ModelCow(), 0.7F); } @Override protected ResourceLocation getEntityTexture(EntityCustomCow entity) { return texture; } } However the cow still has the default cow texture, not the mooshroom one. Not sure what I'm doing wrong here. Edited April 8, 2017 by Xyfero Quote
Xyfero Posted April 8, 2017 Author Posted April 8, 2017 CustomCow.java package com.xyfero.customcow; import com.xyfero.customcow.proxy.CommonProxy; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; @Mod(modid = CustomCow.MODID, version = CustomCow.VERSION) public class CustomCow { public static final String MODID = "customcow"; public static final String VERSION = "1.0"; @Instance(CustomCow.MODID) public static CustomCow instance; @SidedProxy(clientSide="com.xyfero.customcow.proxy.ClientProxy", serverSide="com.xyfero.customcow.proxy.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLInitializationEvent event) { proxy.preInit(event); } } ClientProxy.java package com.xyfero.customcow.proxy; import com.xyfero.customcow.EntityCustomCow; import com.xyfero.customcow.client.RenderCustomCow; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.event.FMLInitializationEvent; public class ClientProxy extends CommonProxy { @Override public void preInit(FMLInitializationEvent event) { super.preInit(event); RenderingRegistry.registerEntityRenderingHandler(EntityCustomCow.class, RenderCustomCow::new); } } CommonProxy.java package com.xyfero.customcow.proxy; import com.xyfero.customcow.CustomCow; import com.xyfero.customcow.EntityCustomCow; import com.xyfero.customcow.client.RenderCustomCow; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.registry.EntityRegistry; public class CommonProxy { public void preInit(FMLInitializationEvent event) { EntityRegistry.registerModEntity(new ResourceLocation(CustomCow.MODID, "custom_cow"), EntityCustomCow.class, CustomCow.MODID + ":custom_cow", 0, CustomCow.instance, 80, 3, false, 0, 1); } } Then I'm using the command "/summon customcow:custom_cow" and the cow's texture is the original rather than the mooshroom one. I must be missing something but I just can't find it. Quote
Xyfero Posted April 8, 2017 Author Posted April 8, 2017 (edited) Thank you so much. I spent so long trying to figure this out thinking it was something wrong with my render file and it just turns out that I had just forgotten to change that one word, thought I was going crazy. You deserve a medal. Edited April 8, 2017 by Xyfero Quote
DrLogiq Posted May 6, 2017 Posted May 6, 2017 (edited) Hey, I'm just wondering, as I'm also using Forge 1.11.2, how come you don't have to pass the RenderCustomCow class a RenderManager when you instantiate it in the ClientProxy? As I'm trying to make a tile entity renderer for a block which can draw lines in the world (for testing purposes) and having no luck as I have no clue what it wants a RenderManager for or where to get/make one. Edit: Nevermind, I realized it's not an Entity, it's a TileEntity. *DERP* Edited May 6, 2017 by DrLogiq I derped... once again Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.