Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.8] Entity-sensitive rendering.


Ernio
 Share

Recommended Posts

I am making NPCs, and since it would be cool to have universal renderer I'd like to make rendering entity-sensitive.

 

What was in my mind:

public class EntityNPC extends EntityLiving
{
private String model = "biped";
private String texture = "steve";
....

 

So basically I am looking for a good way to make server TELL client what model/renderer/texture should this particular entity choose.

Goal:

Accept ANY registered renderer, any resource and model. (in case that client cant find it - render Biped steve)

 

I am still looking at code, so any info/ideas would be nice.

What bothers me is that each Entity.class has it's own STATIC renderer. So what I would have to do is actually override EVERYTHING from the most basic level - that is Render.class to make all methods actually read my entity.

 

Questions:

- How to get all models registered on client?

- How much does server know? I will probably have to use reference HashMaps that will be read with packet.

 

Just to clarify:

I spawn NPC:  /npc create render:dragon texture:reddragon

Entity on client side obviously receives packet with some string values like "render:dragon" and "texture:reddragon"

and my renderer tries to make this entity be rendered using RenderDragon.class with texture (Render.getEntityTexture(Entity entity))

also provided.

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

The thing is, most of these special render classes like RenderDragon specifically require an EntityDragon for example and don't work with any other entity (they'll crash with a ClassCastException).

But for the texture you can just make a String field in your Entity and send it to the client using IEntityAdditionalSpawnData.

Link to comment
Share on other sites

I got some idea by looking at IChun's Morph mod, and I decided to only make good preparations (abstractions) for future (since I have lot of other more important things to code).

 

Interesting resources:

Citizens2 - allows to make e.g sheep NPCs.

IChun's Morph - make "wtf" models for entities.

 

Problem postponed.

1.7.10 is no longer supported by forge, you are on your own.

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

 Share



×
×
  • Create New...

Important Information

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