Jump to content

Recommended Posts

Posted

Hello modders,

I have some questions about rendering the player. Since forge 1.8 RenderPlayerEvents are useless. So now there are ayers.

1. If I want to change the player model and the rendering stuff (like Entities), will I have to redo all layers or is there a better solution?

2. The RenderLivingEntity event still exists, so can I render the EntityPlayer there without doing all the stuff with layers? (I think this wouldn`t work but I better asked)

3. Are the layers cancelable? I don`t want currently armor being rendered. (What else option do I have?)

4. Can I just copy paste minecraft/minecraftforge`s code for layers and just change some values, or is "expands" better?

5. If I have to add my own Layers, where can I register them? And how can I check if the layer, which is currently rendered, if it is my own layer?

6. If i have more models  (3 different types and for every type 2 different texture) can I just make 3 different Layers which have 2 different texture registered (register a layer with texture 1, set ResourceLocation to texture 2 and register the same layer with a different texture a second time?

 

I am currently looking in the source code to find the answers, but if somebody can answer it faster, please do.

If I found an answer, I will post it.

Sorry for my bad English and thanks for your help.

Androm

Posted

Bump.

I am confused with the Layers and how it`s rendered. :o

But I think, I just need an own RenderManager and an own RenderPlayer which holds the models and textures, check which textures are needed and then apply it.. Is there a better way? :-\

Posted

I managed to write some LayerRenderers and apply them to all players, but do I really have to delete the LayerRenderers which I don't need, or is there an event where I can cancel special LayerRenderers?

Some of my classes: (If you have problems to understand it, tell it me please)

 

 

LayerRenderer for ModelDwarfFemale:

package com.myhtrpg.www.entities.Models.Layers;

import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper;

import com.myhtrpg.www.entities.Models.ModelDwarfFemale;
import com.myhtrpg.www.entities.Models.ModelRenderer.M_ModelRenderer;
import com.myhtrpg.www.utils.ResourceHelper;

public class M_LayerDwarfFemale implements LayerRenderer {
public ModelDwarfFemale mDF = new ModelDwarfFemale();
public RenderPlayer pR;

public M_LayerDwarfFemale(RenderPlayer render) {
	this.pR = render;
}

public void doRenderLayer(EntityPlayer player, float f, float f1,
		float renderTick, float f2, float f3, float f4, float f5) {
	if ((!player.isInvisible())) {
		this.pR.bindTexture(ResourceHelper.location_DwarfFemale);

		GlStateManager.pushMatrix();
		if (player.isSneaking()) {
			GlStateManager.translate(0.0F, 0.265F, 0.0F);
		}
		GlStateManager.rotate(
				M_ModelRenderer.interpolateRotation(
						player.prevRotationYawHead, player.rotationYawHead,
						renderTick)
						- M_ModelRenderer.interpolateRotation(
								player.prevRenderYawOffset,
								player.renderYawOffset, renderTick), 0.0F,
				1.0F, 0.0F);
		GlStateManager.rotate(
				M_ModelRenderer.interpolateRotation(
						player.prevRotationPitch, player.rotationPitch,
						renderTick), 1.0F, 0.0F, 0.0F);

		M_ModelRenderer.mRs.get(this.mDF).render(0.0625F);

		GlStateManager.popMatrix();
	}
}

public boolean shouldCombineTextures() {
	return false;
}

public void doRenderLayer(EntityLivingBase p_177141_1_, float p_177141_2_,
		float p_177141_3_, float p_177141_4_, float p_177141_5_,
		float p_177141_6_, float p_177141_7_, float p_177141_8_) {
	doRenderLayer((EntityPlayer) p_177141_1_, p_177141_2_, p_177141_3_,
			p_177141_4_, p_177141_5_, p_177141_6_, p_177141_7_, p_177141_8_);
}
}

The other LayerRenderers are the same, just with others locations and modells.

 

My ModelRenderer:

package com.myhtrpg.www.entities.Models.ModelRenderer;

import java.util.ArrayList;
import java.util.HashMap;

import com.myhtrpg.www.entities.Models.ModelDwarfFemale;
import com.myhtrpg.www.entities.Models.ModelDwarfMale;
import com.myhtrpg.www.entities.Models.ModelElfFemale;
import com.myhtrpg.www.entities.Models.ModelElfMale;
import com.myhtrpg.www.entities.Models.ModelOrkFemale;
import com.myhtrpg.www.entities.Models.ModelOrkMale;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;

public class M_ModelRenderer {

public static HashMap<ModelBase, ModelRenderer> mRs;

public M_ModelRenderer() {
	mRs = new HashMap<ModelBase, ModelRenderer>();
	ArrayList<ModelBase> mBs = new ArrayList<ModelBase>();
	mBs.add(new ModelDwarfFemale());
	mBs.add(new ModelDwarfMale());
	mBs.add(new ModelElfFemale());
	mBs.add(new ModelElfMale());
	mBs.add(new ModelOrkFemale());
	mBs.add(new ModelOrkMale());
	ModelRenderer temp;

	for(int i = 0; i < mBs.size(); i++) {
		ModelBase mB = mBs.get(i);
		temp = new ModelRenderer(mB);
		mRs.put(mB, temp);
	}

}

public static float interpolateRotation(float prevRotation, float nextRotation, float partialTick)
  {
	float rot = nextRotation - prevRotation;
	while (rot >= 180.0F) {
	      rot -= 360.0F;
	    }
	while (rot >= 180.0F) {
	      rot -= 360.0F;
	    }
    return prevRotation + partialTick * rot;
  }
}

In my client proxy:

@Override
public void init() {
	RenderManagerUtils rmu = new RenderManagerUtils();
	M_RendererHelper mrh = new M_RendererHelper();

	//default
	RenderPlayer rp_default = rmu.getValueOfSkinMap("default");
	//LayerRenderers
	List<LayerRenderer> layerrenderers = new M_RendererHelper().getListOfLayerRenderers(rp_default);
	layerrenderers.add(new M_LayerDwarfFemale(rp_default));
	layerrenderers.add(new M_LayerDwarfMale(rp_default));
	layerrenderers.add(new M_LayerElfFemale(rp_default));
	layerrenderers.add(new M_LayerElfMale(rp_default));
	layerrenderers.add(new M_LayerOrkFemale(rp_default));
	layerrenderers.add(new M_LayerOrkMale(rp_default));
	mrh.addLayers(rp_default, (LayerRenderer[]) layerrenderers.toArray());

	//slim
	RenderPlayer rp_slim = rmu.getValueOfSkinMap("slim");
	//LayerRenderers
	layerrenderers = new M_RendererHelper().getListOfLayerRenderers(rp_slim);
	layerrenderers.add(new M_LayerDwarfFemale(rp_slim));
	layerrenderers.add(new M_LayerDwarfMale(rp_slim));
	layerrenderers.add(new M_LayerElfFemale(rp_slim));
	layerrenderers.add(new M_LayerElfMale(rp_slim));
	layerrenderers.add(new M_LayerOrkFemale(rp_slim));
	layerrenderers.add(new M_LayerOrkMale(rp_slim));
	mrh.addLayers(rp_slim, (LayerRenderer[]) layerrenderers.toArray());

	//apply patches now
	rmu.setValueOfKeyInSkinMap(rp_default, "default");
	rmu.setValueOfKeyInSkinMap(rp_slim, "slim");
	rmu.applyPatch();
}

RenderManagerUtils:

package com.myhtrpg.www.utils;

import java.lang.reflect.Field;
import java.util.Map;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderPlayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import com.google.common.collect.Maps;

@SideOnly(Side.CLIENT)
public class RenderManagerUtils {

private Map M_skinMap;
private Map old;
private boolean readingSucces;
private boolean nothinginside;

public RenderManagerUtils() {
	this.M_skinMap = Maps.newHashMap();
	this.old = Maps.newHashMap();
	RenderManager rm = Minecraft.getMinecraft().getRenderManager();
	try {
		Field privateSkinMapMinecraft = rm.getClass().getDeclaredField("skinMap");
		privateSkinMapMinecraft.setAccessible(true);
		M_skinMap = (Map) privateSkinMapMinecraft.get(rm);
		privateSkinMapMinecraft.setAccessible(false);
		old = M_skinMap;
	} catch (Exception e) {
		this.readingSucces = false;
		e.printStackTrace();
	}
	this.readingSucces = true;
	if(M_skinMap == null) this.nothinginside = true;
	else {
		this.nothinginside = false;
	}
}

public RenderPlayer getValueOfSkinMap(String key) { //keys are "default" and "slim"
	if(readingSucces && !nothinginside && this.M_skinMap.containsKey(key)) return (RenderPlayer) this.M_skinMap.get(key);
	else return null;
}

public boolean setValueOfKeyInSkinMap(RenderPlayer rp, String key) {
	if(readingSucces && !nothinginside) {
		this.M_skinMap.put(key, rp);
		if(this.M_skinMap.get("default").equals(rp) && this.M_skinMap.get("slim").equals(rp)) return true;
		else return false;
	} else return false;
}

public boolean applyPatch() {
	RenderManager rm = Minecraft.getMinecraft().getRenderManager();
	Map newMap = Maps.newHashMap();
	Field privateSkinMapMinecraft = null;
	try {
		privateSkinMapMinecraft = rm.getClass().getDeclaredField("skinMap");
		privateSkinMapMinecraft.setAccessible(true);
		newMap = (Map) privateSkinMapMinecraft.get(rm);
		privateSkinMapMinecraft.setAccessible(false);
	} catch (Exception e) {
		e.printStackTrace();
		return false;
	}
	if(newMap == null) return false;
	else {
		if(newMap.equals(old) && privateSkinMapMinecraft != null) {
			privateSkinMapMinecraft.setAccessible(true);
			try {
				privateSkinMapMinecraft.set(rm, M_skinMap);
				if(privateSkinMapMinecraft.get(rm).equals(M_skinMap)) {
					privateSkinMapMinecraft.setAccessible(false);
					return true;
				}
				privateSkinMapMinecraft.setAccessible(false);
				return false;
			} catch (Exception e) {
				e.printStackTrace();
				return false;
			}
		} else return false; //TODO Maybe trying to check changes
	}
}
}

My RendererHelper (needed a special package, because I am using protected methodes):

package net.minecraft.client.renderer.entity;

import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;

import com.myhtrpg.www.entities.Models.Layers.M_LayerDwarfFemale;

import net.minecraft.client.renderer.entity.layers.LayerRenderer;

public class M_RendererHelper {

public RenderPlayer addLayer(RenderPlayer old, LayerRenderer layer) {
	old.addLayer(layer);
	return old;
}

public RenderPlayer removeLayer(RenderPlayer old, LayerRenderer layer) {
	old.removeLayer(layer);
	return old;
}

public boolean containsLayer(RenderPlayer old, LayerRenderer layer) {
	return old.layerRenderers.contains(layer);
}

public boolean containsLayers(RenderPlayer old, Collection layers) {
	return old.layerRenderers.containsAll(layers);
}

public List<LayerRenderer> getListOfLayerRenderers(RenderPlayer old) {
	return old.layerRenderers;
}

public RenderPlayer setListOfLayerRenderers(RenderPlayer old, List<LayerRenderer> lrs) {
	old.layerRenderers = lrs;
	return old;
}

public RenderPlayer addLayers(RenderPlayer old, LayerRenderer[] layers) {
	for (LayerRenderer layer : layers) old.addLayer(layer);
	return old;
}

public RenderPlayer removeLayers(RenderPlayer old, LayerRenderer[] layers) {
	for (LayerRenderer layer : layers) old.removeLayer(layer);
	return old;
}
}

 

 

Posted

If I go in the Thirdperson view, minecraft crashes with following error:

 

 

[13:59:12] [Client thread/FATAL]: Reported exception thrown!

net.minecraft.util.ReportedException: Rendering entity in world

at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:425) ~[RenderManager.class:?]

at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:334) ~[RenderManager.class:?]

at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:301) ~[RenderManager.class:?]

at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:657) ~[RenderGlobal.class:?]

at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1350) ~[EntityRenderer.class:?]

at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1263) ~[EntityRenderer.class:?]

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1088) ~[EntityRenderer.class:?]

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1108) ~[Minecraft.class:?]

at net.minecraft.client.Minecraft.run(Minecraft.java:376) [Minecraft.class:?]

at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?]

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_75]

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_75]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_75]

at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_75]

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

at GradleStart.main(Unknown Source) [start/:?]

Caused by: java.lang.NullPointerException

at com.myhtrpg.www.entities.Models.Layers.M_LayerDwarfFemale.doRenderLayer(M_LayerDwarfFemale.java:44) ~[M_LayerDwarfFemale.class:?]

at com.myhtrpg.www.entities.Models.Layers.M_LayerDwarfFemale.doRenderLayer(M_LayerDwarfFemale.java:57) ~[M_LayerDwarfFemale.class:?]

at com.myhtrpg.www.Events.PlayerRenderEvents.onRenderLiving(PlayerRenderEvents.java:69) ~[PlayerRenderEvents.class:?]

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_9_PlayerRenderEvents_onRenderLiving_Pre.invoke(.dynamic) ~[?:?]

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55) ~[ASMEventHandler.class:?]

at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138) ~[EventBus.class:?]

at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:100) ~[RendererLivingEntity.class:?]

at net.minecraft.client.renderer.entity.RenderPlayer.func_180596_a(RenderPlayer.java:70) ~[RenderPlayer.class:?]

at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:273) ~[RenderPlayer.class:?]

at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:377) ~[RenderManager.class:?]

... 17 more

[13:59:12] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:660]: ---- Minecraft Crash Report ----

// But it works on my machine.

 

Time: 05.04.15 13:59

Description: Rendering entity in world

 

java.lang.NullPointerException: Rendering entity in world

at com.myhtrpg.www.entities.Models.Layers.M_LayerDwarfFemale.doRenderLayer(M_LayerDwarfFemale.java:44)

at com.myhtrpg.www.entities.Models.Layers.M_LayerDwarfFemale.doRenderLayer(M_LayerDwarfFemale.java:57)

at com.myhtrpg.www.Events.PlayerRenderEvents.onRenderLiving(PlayerRenderEvents.java:69)

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_9_PlayerRenderEvents_onRenderLiving_Pre.invoke(.dynamic)

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55)

at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138)

at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:100)

at net.minecraft.client.renderer.entity.RenderPlayer.func_180596_a(RenderPlayer.java:70)

at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:273)

at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:377)

at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:334)

at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:301)

at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:657)

at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1350)

at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1263)

at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1088)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1108)

at net.minecraft.client.Minecraft.run(Minecraft.java:376)

at net.minecraft.client.main.Main.main(Main.java:117)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

 

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

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at com.myhtrpg.www.entities.Models.Layers.M_LayerDwarfFemale.doRenderLayer(M_LayerDwarfFemale.java:44)

at com.myhtrpg.www.entities.Models.Layers.M_LayerDwarfFemale.doRenderLayer(M_LayerDwarfFemale.java:57)

at com.myhtrpg.www.Events.PlayerRenderEvents.onRenderLiving(PlayerRenderEvents.java:69)

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_9_PlayerRenderEvents_onRenderLiving_Pre.invoke(.dynamic)

at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:55)

at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:138)

at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:100)

at net.minecraft.client.renderer.entity.RenderPlayer.func_180596_a(RenderPlayer.java:70)

at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:273)

 

-- Entity being rendered --

Details:

Entity Type: null (net.minecraft.client.entity.EntityPlayerSP)

Entity ID: 181

Entity Name: Player694

Entity's Exact location: 0,00, 78,00, 0,00

Entity's Block location: 0,00,78,00,0,00 - World: (0,78,0), Chunk: (at 0,4,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

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: net.minecraft.client.renderer.entity.RenderPlayer@6800f291

Location: 0,00,0,00,0,00 - World: (0,0,0), Chunk: (at 0,0,0 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Rotation: -202.95001

Delta: 0.3445344

Stacktrace:

at net.minecraft.client.renderer.entity.RenderManager.doRenderEntity(RenderManager.java:377)

at net.minecraft.client.renderer.entity.RenderManager.renderEntityStatic(RenderManager.java:334)

at net.minecraft.client.renderer.entity.RenderManager.renderEntitySimple(RenderManager.java:301)

at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:657)

at net.minecraft.client.renderer.EntityRenderer.renderWorldPass(EntityRenderer.java:1350)

at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1263)

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityPlayerSP['Player694'/181, l='MpServer', x=0,00, y=78,00, z=0,00]]

Chunk stats: MultiplayerChunkCache: 25, 25

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: 13,00,64,00,277,00 - World: (13,64,277), Chunk: (at 13,4,5 in 0,17; contains blocks 0,0,272 to 15,255,287), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 789 game time, 789 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: 44 total; [EntitySkeleton['Skeleton'/205, l='MpServer', x=45,50, y=19,00, z=53,50], EntityCreeper['Creeper'/204, l='MpServer', x=39,50, y=18,00, z=57,50], EntityCreeper['Creeper'/207, l='MpServer', x=39,50, y=18,00, z=58,50], EntityZombie['Zombie'/206, l='MpServer', x=46,50, y=19,00, z=57,50], EntityRabbit['Rabbit'/201, l='MpServer', x=53,34, y=96,00, z=-1,66], EntityRabbit['Rabbit'/200, l='MpServer', x=53,34, y=96,00, z=-4,66], EntityZombie['Zombie'/203, l='MpServer', x=-39,50, y=30,00, z=35,50], EntityBat['Bat'/202, l='MpServer', x=-28,19, y=14,75, z=58,31], EntityCreeper['Creeper'/197, l='MpServer', x=-0,50, y=38,00, z=48,50], EntityWitch['Witch'/196, l='MpServer', x=-15,50, y=24,00, z=63,50], EntityBat['Bat'/199, l='MpServer', x=-10,75, y=13,06, z=-39,28], EntityCreeper['Creeper'/198, l='MpServer', x=-4,50, y=38,00, z=55,50], EntityRabbit['Rabbit'/193, l='MpServer', x=51,50, y=86,00, z=1,50], EntityCreeper['Creeper'/192, l='MpServer', x=13,50, y=20,00, z=-47,50], EntityBat['Bat'/195, l='MpServer', x=-8,25, y=15,28, z=60,25], EntityCreeper['Creeper'/194, l='MpServer', x=0,50, y=38,00, z=48,50], EntitySkeleton['Skeleton'/220, l='MpServer', x=63,50, y=38,00, z=-45,50], EntityZombie['Zombie'/221, l='MpServer', x=48,50, y=19,00, z=58,50], EntityCreeper['Creeper'/222, l='MpServer', x=51,50, y=19,00, z=48,50], EntitySkeleton['Skeleton'/223, l='MpServer', x=48,19, y=19,00, z=52,66], EntityCreeper['Creeper'/216, l='MpServer', x=-40,50, y=16,00, z=-39,50], EntitySkeleton['Skeleton'/217, l='MpServer', x=60,50, y=31,00, z=-47,50], EntityZombie['Zombie'/218, l='MpServer', x=61,69, y=32,00, z=-45,88], EntitySpider['Spider'/219, l='MpServer', x=61,50, y=38,00, z=-45,50], EntityBat['Bat'/212, l='MpServer', x=-40,78, y=24,00, z=-43,53], EntityBat['Bat'/213, l='MpServer', x=-36,53, y=25,31, z=-45,66], EntityBat['Bat'/214, l='MpServer', x=-49,81, y=26,00, z=-32,44], EntityItem['item.tile.gravel'/215, l='MpServer', x=-37,69, y=-57,47, z=-41,88], EntityCreeper['Creeper'/208, l='MpServer', x=36,50, y=36,00, z=62,50], EntityZombie['Zombie'/209, l='MpServer', x=-47,97, y=14,00, z=-36,47], EntityZombie['Zombie'/210, l='MpServer', x=-46,63, y=14,00, z=-42,03], EntitySpider['Spider'/211, l='MpServer', x=-46,72, y=14,02, z=-35,72], EntityPlayerSP['Player694'/181, l='MpServer', x=0,00, y=78,00, z=0,00], EntityZombie['Zombie'/224, l='MpServer', x=48,50, y=19,00, z=54,50], EntityRabbit['Rabbit'/186, l='MpServer', x=-26,63, y=77,00, z=-8,38], EntityRabbit['Rabbit'/187, l='MpServer', x=-21,06, y=83,00, z=-14,97], EntityBat['Bat'/184, l='MpServer', x=5,75, y=16,09, z=38,25], EntityRabbit['Rabbit'/185, l='MpServer', x=-29,50, y=77,00, z=-6,50], EntityRabbit['Rabbit'/190, l='MpServer', x=-19,50, y=89,02, z=-20,25], EntityCreeper['Creeper'/191, l='MpServer', x=13,50, y=20,00, z=-46,50], EntityEnderman['Enderman'/188, l='MpServer', x=30,50, y=23,00, z=45,50], EntityRabbit['Rabbit'/189, l='MpServer', x=-19,91, y=90,00, z=-22,28], EntityRabbit['Rabbit'/182, l='MpServer', x=-24,03, y=77,00, z=0,47], EntitySkeleton['Skeleton'/183, l='MpServer', x=9,50, y=20,00, z=39,50]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:392)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2601)

at net.minecraft.client.Minecraft.run(Minecraft.java:397)

at net.minecraft.client.main.Main.main(Main.java:117)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

at GradleStart.main(Unknown Source)

 

 

Something is null, but I don`t what because the doRender(....) is called and the arguments aren`t null...

Event, where it happens:

@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onRenderLiving(RenderLivingEvent.Pre rlep) {
	if(rlep.entity instanceof EntityPlayer) {
		EntityPlayer player = (EntityPlayer)rlep.entity;
		LayerRenderer lr = new M_LayerDwarfFemale(new RenderManagerUtils().getValueOfSkinMap("default"));
		lr.doRenderLayer((EntityLivingBase)player, 1F, 1F, ClientEvents.partialTicks, (float)player.posX, (float)player.posY, (float)player.posZ, 1F);
		System.out.println("Tried to render player");
	}
}

No class changed since I posted them. Anyone can help me?

 

 

 

Posted

M_ModelRenderer.mRs should be null.

Move following code in M_ModelRenderer's constructor to the static{}:

	mRs = new HashMap<ModelBase, ModelRenderer>();
	ArrayList<ModelBase> mBs = new ArrayList<ModelBase>();
	mBs.add(new ModelDwarfFemale());
	mBs.add(new ModelDwarfMale());
	mBs.add(new ModelElfFemale());
	mBs.add(new ModelElfMale());
	mBs.add(new ModelOrkFemale());
	mBs.add(new ModelOrkMale());

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Posted

No, M_ModelRenderer.mRs wasn't null, but it couldn't get the value for the key. In the hashmap is an object called new ModelDwarFemale, but if i used the key new ModelDwarfFemale or cast it to ModelBase the key doesn't exist. I solved the problem with adding a '.getClass().getName()'. Now there is no error, but nothing is rendered..

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.

Announcements



×
×
  • Create New...

Important Information

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