Jump to content

[SOLVED][1.8.9] Need Help Adding Custom Entites


NovaViper

Recommended Posts

Uh... how do you add the entity renderer in 1.8.9? I notice that you need a renderer class that has IRenderFactory. How do I make such a class for this? My code so far:

 

Render

package novaviper.tetracraft.client.render.entity;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;
import novaviper.tetracraft.common.entity.EntityTerrakon;
import novaviper.tetracraft.client.lib.TextureReference;

/**
* Created by NovaViper on 3/1/2016.
* Class Purpose:
*/
public class RenderTerrakon extends RenderLiving<EntityTerrakon>
{
protected ResourceLocation terrakonTexture;

public RenderTerrakon(RenderManager renderManager, ModelBase modelBase, float shadowSize)
{
	super(renderManager, modelBase, shadowSize);
	setEntityTexture();
}

@Override
protected void preRenderCallback(EntityTerrakon entity, float f)
{
	preRenderCallbackSerpent((EntityTerrakon) entity, f);
}

protected void preRenderCallbackSerpent(EntityTerrakon entity, float f)
{
	// some people do some G11 transformations or blends here, like you can do
	// GL11.glScalef(2F, 2F, 2F); to scale up the entity
	// which is used for Slime entities.  I suggest having the entity cast to
	// your custom type to make it easier to access fields from your
	// custom entity, eg. GL11.glScalef(entity.scaleFactor, entity.scaleFactor,
	// entity.scaleFactor);
}

protected void setEntityTexture()
{
	terrakonTexture = TextureReference.terrakon;
}

@Override
protected ResourceLocation getEntityTexture(EntityTerrakon entity) {
	return terrakonTexture;
}
}

 

ClientProxy

package novaviper.tetracraft.client.proxy;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.world.World;
import net.minecraftforge.fml.client.FMLClientHandler;
import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import novaviper.tetracraft.common.lib.Registers;
import novaviper.tetracraft.common.proxy.CommonProxy;
import novaviper.tetracraft.main.ModBlocks;
import novaviper.tetracraft.main.ModItems;
import novaviper.tetracraft.client.model.*;
import novaviper.tetracraft.common.entity.*;
import novaviper.tetracraft.client.render.entity.*;

/**
* Created by NovaViper on 2/6/2016.
* Class Purpose: Loads stuff on the client side
*/
public class ClientProxy extends CommonProxy {

// Client Objects\\
@Override
public void registerRenderThings() {
	ModBlocks.loadRenderers();
	ModItems.loadRenderers();
	ModItems.loadVariants();

	RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
	RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
	Registers.addEntityRender(EntityTerrakon(), new RenderTerrakon(renderManager, new ModelTerrakon(), 0.5F));
}

@Override
public void registerMoreThings() {}

// Client Objects\\
@Override
public EntityPlayer getPlayerEntity(MessageContext ctx) {
	return (ctx.side.isClient() ? Minecraft.getMinecraft().thePlayer
			: super.getPlayerEntity(ctx));
}

@Override
public EntityPlayer getPlayerEntity() {
	return Minecraft.getMinecraft().thePlayer;
}



@Override
public void spawnCrit(World world, Entity entity) {
	FMLClientHandler.instance().getClient().effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT);
}

@Override
public void spawnRoar(World world, Entity entity) {
	FMLClientHandler.instance().getClient().effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.SPELL_WITCH);
	FMLClientHandler.instance().getClient().effectRenderer.emitParticleAtEntity(entity, EnumParticleTypes.CRIT);
}
}

 

Register

	public static void addEntityRender(Class entityClass, IRenderFactory render) {
	RenderingRegistry.registerEntityRenderingHandler(entityClass, render);
}

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

IRenderFactory

is just an interface with a single method:

createRenderFor

. This method is called to create the

Render

instance for the entity class.

 

If you're building against Java 6/7, just use an anonymous class to implement it.

 

If you're building against Java 8, either use an anonymous class or create a constructor in your

Render

class with the same signature as

IRenderFactory#createRenderFor

and use a method reference to that constructor.

 

Constructors implicitly return a new instance of their class, so you just need to match the arguments of

IRenderFactory#createRenderFor

: a single

RenderManager

argument.

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.

Link to comment
Share on other sites

I tried that, it just crashes with this error

 

[15:37:20] [server thread/INFO]: Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@192f3cb2)
[15:37:20] [server thread/INFO]: Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@192f3cb2)
[15:37:21] [server thread/INFO]: Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@192f3cb2)
[15:37:21] [server thread/INFO]: Preparing start region for level 0
[15:37:22] [server thread/INFO]: Preparing spawn area: 0%
[15:37:23] [server thread/INFO]: Preparing spawn area: 23%
[15:37:24] [server thread/INFO]: Preparing spawn area: 43%
[15:37:26] [server thread/INFO]: Preparing spawn area: 57%
[15:37:27] [Realms Notification Availability checker #1/INFO]: Could not authorize you against Realms server: Invalid session id
[15:37:29] [server thread/INFO]: Changing view distance to 12, from 10
[15:37:29] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2090ms behind, skipping 41 tick(s)
[15:37:39] [Netty Local Client IO #0/INFO]: Server protocol version 2
[15:37:39] [Netty Server IO #1/INFO]: Client protocol version 2
[15:37:39] [Netty Server IO #1/INFO]: Client attempting to join with 5 mods : [email protected],[email protected],[email protected],[email protected],[email protected]
[15:37:39] [Netty Local Client IO #0/INFO]: [Netty Local Client IO #0] Client side modded connection established
[15:37:39] [server thread/INFO]: [server thread] Server side modded connection established
[15:37:39] [server thread/INFO]: Player722[local:E:78b828b2] logged in with entity id 89 at (-462.5, 4.0, 775.5)
[15:37:39] [server thread/INFO]: Player722 joined the game
[15:37:54] [server thread/INFO]: Saving and pausing game...
[15:37:54] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[15:37:54] [pool-2-thread-1/WARN]: Couldn't look up profile properties for com.mojang.authlib.GameProfile@8256b38[id=48c2e6c7-8875-31cc-9a01-be7eaa5f9386,name=Player722,properties={},legacy=false]
com.mojang.authlib.exceptions.AuthenticationException: The client has sent too many requests within a certain amount of time
at com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService.makeRequest(YggdrasilAuthenticationService.java:65) ~[YggdrasilAuthenticationService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillGameProfile(YggdrasilMinecraftSessionService.java:175) [YggdrasilMinecraftSessionService.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:59) [YggdrasilMinecraftSessionService$1.class:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService$1.load(YggdrasilMinecraftSessionService.java:56) [YggdrasilMinecraftSessionService$1.class:?]
at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3938) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4821) [guava-17.0.jar:?]
at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4827) [guava-17.0.jar:?]
at com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService.fillProfileProperties(YggdrasilMinecraftSessionService.java:165) [YggdrasilMinecraftSessionService.class:?]
at net.minecraft.client.Minecraft.func_181037_M(Minecraft.java:2915) [Minecraft.class:?]
at net.minecraft.client.resources.SkinManager$3.run(SkinManager.java:130) [skinManager$3.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_73]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_73]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_73]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_73]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_73]
[15:37:57] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[15:37:57] [server thread/INFO]: Saving chunks for level 'New World'/The End
[15:37:58] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 12437ms behind, skipping 248 tick(s)
[15:37:59] [Client thread/ERROR]: Couldn't render entity
java.lang.NullPointerException
at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:102) ~[Render.class:?]
at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:95) ~[Render.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderModel(RendererLivingEntity.java:265) ~[RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:178) [RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:54) [RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:16) [RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:380) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:337) [RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:304) [RenderManager.class:?]
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:672) [RenderGlobal.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1369) [EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1283) [EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1111) [EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1107) [Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:380) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:116) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_73]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_73]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_73]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_73]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_73]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_73]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) [idea_rt.jar:?]
[15:38:01] [server thread/INFO]: Stopping server
[15:38:01] [server thread/INFO]: Saving players
[15:38:01] [server thread/INFO]: Saving worlds
[15:38:01] [server thread/INFO]: Saving chunks for level 'New World'/Overworld
[15:38:01] [server thread/INFO]: Saving chunks for level 'New World'/Nether
[15:38:01] [server thread/INFO]: Saving chunks for level 'New World'/The End
[15:38:04] [server thread/INFO]: Unloading dimension 0
[15:38:04] [server thread/INFO]: Unloading dimension -1
[15:38:04] [server thread/INFO]: Unloading dimension 1
[15:38:04] [server thread/INFO]: Applying holder lookups
[15:38:04] [server thread/INFO]: Holder lookups applied
[15:38:06] [Client thread/FATAL]: Reported exception thrown!
net.minecraft.util.ReportedException: Rendering entity in world
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:428) ~[RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:337) ~[RenderManager.class:?]
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:304) ~[RenderManager.class:?]
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:672) ~[RenderGlobal.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1369) ~[EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1283) ~[EntityRenderer.class:?]
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1111) ~[EntityRenderer.class:?]
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1107) ~[Minecraft.class:?]
at net.minecraft.client.Minecraft.run(Minecraft.java:380) [Minecraft.class:?]
at net.minecraft.client.main.Main.main(Main.java:116) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_73]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_73]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_73]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_73]
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?]
at GradleStart.main(GradleStart.java:26) [start/:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_73]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_73]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_73]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_73]
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144) [idea_rt.jar:?]
Caused by: java.lang.NullPointerException
at net.minecraft.client.renderer.entity.RendererLivingEntity.canRenderName(RendererLivingEntity.java:590) ~[RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:26) ~[RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:16) ~[RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderName(RendererLivingEntity.java:509) ~[RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderName(RendererLivingEntity.java:31) ~[RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.Render.doRender(Render.java:59) ~[Render.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:208) ~[RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:54) ~[RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:16) ~[RenderLiving.class:?]
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:380) ~[RenderManager.class:?]
... 26 more
[15:38:06] [Client thread/INFO]: [net.minecraft.init.Bootstrap:printToSYSOUT:612]: ---- Minecraft Crash Report ----
// Don't do that.

Time: 3/1/16 3:38 PM
Description: Rendering entity in world

java.lang.NullPointerException: Rendering entity in world
at net.minecraft.client.renderer.entity.RendererLivingEntity.canRenderName(RendererLivingEntity.java:590)
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:26)
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:16)
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderName(RendererLivingEntity.java:509)
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderName(RendererLivingEntity.java:31)
at net.minecraft.client.renderer.entity.Render.doRender(Render.java:59)
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:208)
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:54)
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:16)
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:380)
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:337)
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:304)
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:672)
at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1369)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1283)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1111)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1107)
at net.minecraft.client.Minecraft.run(Minecraft.java:380)
at net.minecraft.client.main.Main.main(Main.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at net.minecraft.client.renderer.entity.RendererLivingEntity.canRenderName(RendererLivingEntity.java:590)
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:26)
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:16)
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderName(RendererLivingEntity.java:509)
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderName(RendererLivingEntity.java:31)
at net.minecraft.client.renderer.entity.Render.doRender(Render.java:59)
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:208)
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:54)
at net.minecraft.client.renderer.entity.RenderLiving.doRender(RenderLiving.java:16)

-- Entity being rendered --
Details:
Entity Type: tetracraft.Terrakon (novaviper.tetracraft.common.entity.EntityTerrakon)
Entity ID: 24
Entity Name: entity.tetracraft.Terrakon.name
Entity's Exact location: -462.50, 4.00, 778.50
Entity's Block location: -463.00,4.00,778.00 - World: (-463,4,778), Chunk: (at 1,0,10 in -29,48; contains blocks -464,0,768 to -449,255,783), Region: (-1,1; contains chunks -32,32 to -1,63, blocks -512,0,512 to -1,255,1023)
Entity's Momentum: 0.00, -0.08, 0.00
Entity's Rider: ~~ERROR~~ NullPointerException: null
Entity's Vehicle: ~~ERROR~~ NullPointerException: null

-- Renderer details --
Details:
Assigned renderer: novaviper.tetracraft.client.render.entity.RenderTerrakon@6f29ac2
Location: -27.17,-3.51,47.24 - World: (-28,-4,47), Chunk: (at 4,-1,15 in -2,2; contains blocks -32,0,32 to -17,255,47), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511)
Rotation: 119.2626
Delta: 0.9423218
Stacktrace:
at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:380)
at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:337)
at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:304)
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:672)
at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1369)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1283)

-- Affected level --
Details:
Level name: MpServer
All players: 1 total; [EntityPlayerSP['Player722'/89, l='MpServer', x=-462.50, y=4.00, z=775.50]]
Chunk stats: MultiplayerChunkCache: 450, 450
Level seed: 0
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options: 
Level spawn location: -456.00,4.00,785.00 - World: (-456,4,785), Chunk: (at 8,0,1 in -29,49; contains blocks -464,0,784 to -449,255,799), Region: (-1,1; contains chunks -32,32 to -1,63, blocks -512,0,512 to -1,255,1023)
Level time: 1078 game time, 1078 day time
Level dimension: 0
Level storage version: 0x00000 - Unknown?
Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false
Forced entities: 48 total; [EntityVillager['Villager'/64, l='MpServer', x=-390.75, y=5.00, z=730.31], EntitySlime['Slime'/65, l='MpServer', x=-383.47, y=4.41, z=722.69], EntitySlime['Slime'/66, l='MpServer', x=-387.47, y=4.00, z=761.56], EntitySlime['Slime'/67, l='MpServer', x=-395.94, y=4.00, z=765.44], EntityPlayerSP['Player722'/89, l='MpServer', x=-462.50, y=4.00, z=775.50], EntityPig['Pig'/68, l='MpServer', x=-396.09, y=4.00, z=844.94], EntitySlime['Slime'/6, l='MpServer', x=-481.94, y=4.41, z=729.91], EntitySlime['Slime'/7, l='MpServer', x=-481.03, y=4.00, z=830.19], EntitySlime['Slime'/8, l='MpServer', x=-476.66, y=4.00, z=850.97], EntityVillager['Villager'/10, l='MpServer', x=-466.84, y=4.00, z=700.66], EntityVillager['Villager'/11, l='MpServer', x=-470.16, y=5.00, z=717.41], EntitySlime['Slime'/76, l='MpServer', x=-387.31, y=4.00, z=773.50], EntityVillager['Villager'/12, l='MpServer', x=-461.16, y=5.00, z=712.31], EntityRabbit['Rabbit'/13, l='MpServer', x=-479.50, y=4.00, z=726.50], EntitySlime['Slime'/77, l='MpServer', x=-386.25, y=4.78, z=796.22], EntitySlime['Slime'/14, l='MpServer', x=-477.03, y=4.09, z=739.00], EntityVillager['Villager'/16, l='MpServer', x=-458.66, y=4.00, z=696.34], EntitySlime['Slime'/19, l='MpServer', x=-453.78, y=4.00, z=696.72], EntityVillager['Villager'/20, l='MpServer', x=-467.13, y=4.00, z=722.75], EntitySlime['Slime'/21, l='MpServer', x=-449.81, y=4.00, z=703.34], EntityVillager['Villager'/22, l='MpServer', x=-449.47, y=4.00, z=705.22], EntityVillager['Villager'/23, l='MpServer', x=-454.47, y=5.00, z=729.28], EntityTerrakon['entity.tetracraft.Terrakon.name'/24, l='MpServer', x=-462.50, y=4.00, z=778.50], EntityVillager['Villager'/27, l='MpServer', x=-439.41, y=4.00, z=711.72], EntityVillager['Villager'/28, l='MpServer', x=-438.63, y=4.00, z=734.28], EntitySlime['Slime'/29, l='MpServer', x=-434.41, y=5.00, z=737.75], EntitySlime['Slime'/8157, l='MpServer', x=-439.50, y=4.00, z=850.50], EntitySlime['Slime'/30, l='MpServer', x=-439.91, y=4.00, z=840.22], EntitySlime['Slime'/31, l='MpServer', x=-432.81, y=4.00, z=839.91], EntitySlime['Slime'/32, l='MpServer', x=-446.34, y=4.00, z=827.13], EntitySlime['Slime'/33, l='MpServer', x=-446.50, y=4.00, z=845.66], EntitySlime['Slime'/34, l='MpServer', x=-437.44, y=4.09, z=844.22], EntitySlime['Slime'/35, l='MpServer', x=-436.88, y=4.00, z=852.22], EntityVillager['Villager'/37, l='MpServer', x=-418.28, y=4.00, z=696.66], EntityVillager['Villager'/38, l='MpServer', x=-428.50, y=5.00, z=712.50], EntityVillager['Villager'/39, l='MpServer', x=-417.25, y=4.00, z=715.66], EntitySlime['Slime'/40, l='MpServer', x=-435.41, y=4.00, z=707.44], EntityVillager['Villager'/41, l='MpServer', x=-418.28, y=5.00, z=727.47], EntityVillager['Villager'/42, l='MpServer', x=-418.22, y=5.00, z=725.69], EntityVillager['Villager'/43, l='MpServer', x=-414.66, y=5.00, z=736.16], EntitySlime['Slime'/44, l='MpServer', x=-434.69, y=4.00, z=840.69], EntitySlime['Slime'/45, l='MpServer', x=-434.56, y=4.00, z=843.91], EntitySlime['Slime'/47, l='MpServer', x=-426.00, y=4.78, z=853.56], EntityVillager['Villager'/50, l='MpServer', x=-405.75, y=5.00, z=697.34], EntityVillager['Villager'/52, l='MpServer', x=-404.53, y=5.00, z=699.19], EntityVillager['Villager'/53, l='MpServer', x=-405.19, y=5.00, z=722.31], EntitySlime['Slime'/55, l='MpServer', x=-404.13, y=4.00, z=847.66], EntityVillager['Villager'/63, l='MpServer', x=-395.47, y=4.00, z=723.81]]
Retry entities: 0 total; []
Server brand: fml,forge
Server type: Integrated singleplayer server
Stacktrace:
at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:383)
at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2645)
at net.minecraft.client.Minecraft.run(Minecraft.java:401)
at net.minecraft.client.main.Main.main(Main.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

-- System Details --
Details:
Minecraft Version: 1.8.9
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_73, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 519279056 bytes (495 MB) / 781189120 bytes (745 MB) up to 1659371520 bytes (1582 MB)
JVM Flags: 0 total; 
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP 9.19 Powered by Forge 11.15.1.1751 5 mods loaded, 5 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJAAAA	mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) 
UCHIJAAAA	FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.8.9-11.15.1.1751.jar) 
UCHIJAAAA	Forge{11.15.1.1751} [Minecraft Forge] (forgeSrc-1.8.9-11.15.1.1751.jar) 
UCHIJAAAA	tetracraft{0.0.1} [Tetra Craft] (TetraCraft) 
UCHIJAAAA	Ding{MC1.8.9v2} [Ding] (Ding-MC1.8.9v2.jar) 
Loaded coremods (and transformers): 
GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13416 Compatibility Profile Context 15.300.1025.1001' Renderer: 'AMD Radeon(TM) R5 Graphics'
Launched Version: 1.8.9
LWJGL: 2.9.4
OpenGL: AMD Radeon(TM) R5 Graphics GL version 4.5.13416 Compatibility Profile Context 15.300.1025.1001, ATI Technologies Inc.
GL Caps: Using GL 1.3 multitexturing.
Using GL 1.3 texture combiners.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Shaders are available because OpenGL 2.1 is supported.
VBOs are available because OpenGL 1.5 is supported.

Using VBOs: No
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: 
Current Language: English (US)
Profiler Position: N/A (disabled)
CPU: 4x AMD A8-6410 APU with AMD Radeon R5 Graphics 
[15:38:06] [Client thread/INFO]: [net.minecraft.init.Bootstrap:printToSYSOUT:612]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\NovaPC\Dropbox\MinecraftMods\TetraCraft\run\.\crash-reports\crash-2016-03-01_15.38.06-client.txt
AL lib: (EE) alc_cleanup: 1 device not closed

Process finished with exit code -1

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

I tried that, it just crashes with this error

 

[15:37:59] [Client thread/ERROR]: Couldn't render entity
java.lang.NullPointerException
at net.minecraft.client.renderer.entity.Render.bindTexture(Render.java:102) ~[Render.class:?]
at net.minecraft.client.renderer.entity.Render.bindEntityTexture(Render.java:95) ~[Render.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderModel(RendererLivingEntity.java:265) ~[RendererLivingEntity.class:?]
at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:178) [RendererLivingEntity.class:?]
...
java.lang.NullPointerException: Rendering entity in world
at net.minecraft.client.renderer.entity.RendererLivingEntity.canRenderName(RendererLivingEntity.java:590)
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:26)
at net.minecraft.client.renderer.entity.RenderLiving.canRenderName(RenderLiving.java:16)
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderName(RendererLivingEntity.java:509)
at net.minecraft.client.renderer.entity.RendererLivingEntity.renderName(RendererLivingEntity.java:31)
at net.minecraft.client.renderer.entity.Render.doRender(Render.java:59)
...

 

I suspect the

Render#renderManager

field is

null

. Upload your the latest versions of your

Registers

,

ClientProxy

and

RenderTerrakon

classes to Gist/Pastebin with syntax highlighting and link them here.

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.

Link to comment
Share on other sites

Register

	public static void addEntityRender(Class entityClass, IRenderFactory render) {
	RenderingRegistry.registerEntityRenderingHandler(entityClass, render);
}

 

Client

		RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
	RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();

	Registers.addEntityRender(EntityTerrakon.class, new RenderTerrakon(renderManager, new ModelTerrakon(), 0.5F));

 

Renderer

@SideOnly(Side.CLIENT)
public class RenderTerrakon extends RenderLiving<EntityTerrakon> implements IRenderFactory
{
private static final ResourceLocation cowTextures = new ResourceLocation("textures/entity/cow/cow.png");

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

/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityTerrakon entity)
{
	return TextureReference.terrakon;
}

@Override
public Render createRenderFor(RenderManager manager) {
	return this;
}
}

 

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

I dont know how to highlight them either one of these

 

To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page.

 

Register

	public static void addEntityRender(Class entityClass, IRenderFactory render) {
	RenderingRegistry.registerEntityRenderingHandler(entityClass, render);
}

 

Client

		RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
	RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();

	Registers.addEntityRender(EntityTerrakon.class, new RenderTerrakon(renderManager, new ModelTerrakon(), 0.5F));

 

Renderer

@SideOnly(Side.CLIENT)
public class RenderTerrakon extends RenderLiving<EntityTerrakon> implements IRenderFactory
{
private static final ResourceLocation cowTextures = new ResourceLocation("textures/entity/cow/cow.png");

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

/**
 * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
 */
protected ResourceLocation getEntityTexture(EntityTerrakon entity)
{
	return TextureReference.terrakon;
}

@Override
public Render createRenderFor(RenderManager manager) {
	return this;
}
}

 

 

Don't implement

IRenderFactory

in your

Render

class. The whole point of

IRenderFactory

is to delay the creation of the

Render

instance until the

RenderManager

instance is created (between the preInit and init phases).

 

Use an anonymous class or method reference to implement

IRenderFactory

, like I described in my first post.

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.

Link to comment
Share on other sites

I did something like this

	public static void addEntityRender(Class entityClass, Render render) {

	RenderingRegistry.registerEntityRenderingHandler(entityClass, new IRenderFactory() {
		@Override
		public Render createRenderFor(RenderManager manager) {
			return render;
		}
	});
}

 

And it still crashes

Main Developer and Owner of Zero Quest

Visit the Wiki for more information

If I helped anyone, please give me a applaud and a thank you!

Link to comment
Share on other sites

Because you're still creating the

Render

instance before the

RenderManager

instance has been created.

IRenderFactory#createRenderFor

must create a new instance of your

Render

class using the supplied

RenderManager

argument.

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.

Link to comment
Share on other sites

In preInit, register an

IRenderFactory

for your entity using an anonymous class or method reference. In this class's

createRenderFor

method, create and return a new instance of the appropriate

Render

class using the

RenderManager

argument.

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.

Link to comment
Share on other sites

Just do this in your client proxy pre-init event handler:

 

        
RenderingRegistry.registerEntityRenderingHandler(YourEntityClass.class, new IRenderFactory<YourEntityClass>() {
            @Override
            public Render<? super YourEntityClass> createRenderFor(RenderManager manager) {
                return new YourRenderClass(manager);
            }
        });

 

DO NOT get a reference to the render manager yourself, left MC do that for you

 

Link to comment
Share on other sites

The IDE says I need the IRenderFactory in my method in order to use it.

That doesn't tell me much. Which method are you talking about? What's the exact error message shown by your IDE?

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.

Link to comment
Share on other sites

Basically, IntelliJ says for the method i'm using, I require a variable that extends to IRenderFactory, not Render

 

So pass it an

IRenderFactory

instead of a

Render

.

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.

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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