Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

A custom mob, called Swordie Mienshao, I am making renders as just a box. I am not sure why despite trying to follow what other mods/posts do. I am modding for 1.8.9-11.15.1.1722

 

I'll try and supply everything I thought was relevant:

 

Main Class:

@Mod(modid = ModStrings.MODID, name = ModStrings.name, version = ModStrings.version)
public class PokemonMD 
{
@SidedProxy(clientSide = ModStrings.CLIENT_PROXY_CLASS, serverSide = ModStrings.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
public static SimpleNetworkWrapper network;

@Instance(value = ModStrings.MODID)
public static PokemonMD instance;

public static final int packetIDActionAnimation = 0;

public static final String[] fTimer;

static 
{
	fTimer = new String[] {"timer"};
}

public enum GUI_ENUM 
{
    VERDANT_PURIFIER,
    VESPENE_CONDENSER
}

@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	PokemonMDCreativeTabs.initializeTabs();

	PokemonMDBlocks.init();
	PokemonMDBlocks.register();

	PokemonMDItems.init();
	PokemonMDItems.register();

	proxy.registerTileEntities();

	RecipesCrafting.mainRegistry();

	PokemonMDEntities.registerEntityMob();
}

@EventHandler
public void init(FMLInitializationEvent event)
{
	proxy.registerRenders();
}

@EventHandler
public void postInt(FMLPostInitializationEvent event)
{
	proxy.initTimer();

	PokemonMDEntities.addSpawnLocations();
}

public static boolean isClient() 
{
	return FMLCommonHandler.instance().getSide().isClient();
}

public static boolean isEffectiveClient() 
{
	return FMLCommonHandler.instance().getEffectiveSide().isClient();
}

public static void sendAnimationPacket(IAnimatedEntity entity, int animationID) 
{
	if(isEffectiveClient()) 
		return;

	entity.setAnimationID(animationID);
	network.sendToAll(new PacketAnimation((byte)animationID, ((Entity)entity).getEntityId()));
}
}

 

"ModStrings.class"

public class ModStrings
{
public static final String MODID = "pokemonmd";
public static final String name = "PokemonMD: Undaunted Heroes";
public static final String version = "1.8.9 - developer ver 0.0";

public static final String CLIENT_PROXY_CLASS = "com.fuzzyacornindustries.pokemonmd.proxy.ClientProxy";
public static final String SERVER_PROXY_CLASS = "com.fuzzyacornindustries.pokemonmd.proxy.CommonProxy";
}

 

Client Proxy:

public class ClientProxy extends CommonProxy
{
private Timer mcTimer;

@Override
public void registerRenders()
{
	PokemonMDBlocks.registerRenders();
	PokemonMDItems.registerRenders();

	RenderingRegistry.registerEntityRenderingHandler(EntitySwordieMienshao.class, new IRenderFactory<EntitySwordieMienshao>()
                {
                       @Override
                       public Render<? super EntitySwordieMienshao> createRenderFor(RenderManager manager)
                       {
                               return new RenderSwordieMienshao(manager, new ModelSwordieMienshao(), 0.2F);
                       }
                });

	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityVerdantPurifier.class, new RendererVerdantPurifier());
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityVespeneCondenser.class, new RendererVespeneCondenser());
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityXelNagaDynamo.class, new RendererXelNagaDynamo());
	ClientRegistry.bindTileEntitySpecialRenderer(TileEntityXelNagaPylon.class, new RendererXelNagaPylon());
}

public void initTimer() 
{
	mcTimer = ReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), PokemonMD.fTimer);
}

public float getPartialTick() 
{
	return mcTimer.renderPartialTicks;
}

@Override
public World getWorldClient() 
{
	return FMLClientHandler.instance().getWorldClient();
}
}

 

Render Class:

@SideOnly(Side.CLIENT)
public class RenderSwordieMienshao extends RenderLiving<EntitySwordieMienshao>
{
private static final ResourceLocation mainTexture = new ResourceLocation(ModStrings.MODID + ":" +"textures/mobs/swordiemienshao.png");

public RenderSwordieMienshao(RenderManager renderManagerIn, ModelBase modelBaseIn, float shadowSizeIn)
    {
        super(renderManagerIn, modelBaseIn, shadowSizeIn);
    }

@Override
    protected ResourceLocation getEntityTexture(EntitySwordieMienshao entity)
    {
        return mainTexture;
    }
}

 

Entity "registration" class

public class PokemonMDEntities
{
public static void registerEntityMob()
{
	createEntity(EntitySwordieMienshao.class, EntitySwordieMienshao.getMobName(), LibraryEntityID.SWORDIE_MIENSHAO, 0x2b2e3f, 0x096859);
}

public static void addSpawnLocations()
{
	EntityRegistry.addSpawn(EntitySwordieMienshao.class, 100, 1, 1, EnumCreatureType.MONSTER, 
			BiomeGenBase.coldTaiga, 
			BiomeGenBase.coldTaigaHills, 
			BiomeGenBase.extremeHills, 
			BiomeGenBase.extremeHillsEdge, 
			BiomeGenBase.extremeHillsPlus, 
			BiomeGenBase.frozenOcean, 
			BiomeGenBase.frozenRiver, 
			BiomeGenBase.iceMountains, 
			BiomeGenBase.icePlains, 
			BiomeGenBase.megaTaiga, 
			BiomeGenBase.megaTaigaHills, 
			BiomeGenBase.stoneBeach, 
			BiomeGenBase.taiga, 
			BiomeGenBase.taigaHills 
			);
}

public static void createEntity(Class entityClass, String entityName, int entityID, int parPrimaryColor, int parSecondaryColor)
{
	int trackingRange = 64;
	int updateFrequency = 1;
	boolean sendsVelocityUpdates = true;

	EntityRegistry.registerModEntity(entityClass, entityName, entityID, PokemonMD.instance, trackingRange, updateFrequency, sendsVelocityUpdates);
	EntityRegistry.registerEgg(entityClass, parPrimaryColor, parSecondaryColor);
}
}

 

You may notice there are some TileEntity blocks in the proxy. They render and animate just fine.

 

If changes were supposed to be made to the Model class when updating from 1.7.10 to 1.8.9, I am not aware of any. It's just a copy paste of the older version.

 

 

RenderingRegistry#registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>)

must be called in preInit, as noted by its doc comment. You're currently calling it in init.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.