Jump to content

Recommended Posts

Posted

Hello everyone,

I have been working on a mod for a year now and am almost complete, however something about entity coding trips me up, I have my final entity, a hanging entity, almost working, however the client side function needed for the rendering of my entity is not being called and I am not sure how to call it, I have tried just simply naming the function in my class which references the vanilla class and even completely putting the client side function in my class all to no avail. Help to solve what I'm doing wrong is greatly appreciated!

 

Here is my entity class:

 

  Reveal hidden contents

 

 

This is the function in EntityPainting which I am trying to call

 

  Reveal hidden contents

 

 

Thanks! :)

I'm a novice programmer but I learn from others showing me how to code correctly so thank you for any help you give me! :)

Posted

While I don't know the answer off-hand, I do know that there have been many threads about this exact topic here that you could probably find the answer in if you searched.

 

There is some kind of trick to getting a painting to render correctly that isn't really obvious as it is not handled the same way that most other rendering is in Minecraft.

 

EDIT: Here is a thread with a potential solution.

Posted

Thanks for the reply! But I have spent days combing all the painting rendering related posts and tried at least a hundred things over the past year to still be unable to get it to render. I always try to figure things out myself and hate asking for help but this one problem is too much for me alone. But I do hope whoever knows the solution can help me

 

EDIT: I definitely have spent a lot of time observing that post you suggested, it helped me fix a lot of other problems, but for client side functions I believe changed a bit from 1.7.10 to 1.8, but I will keep looking at what he did

I'm a novice programmer but I learn from others showing me how to code correctly so thank you for any help you give me! :)

  • 3 weeks later...
Posted

So I kind of have no clue what I did but the paintings SPAWN now and WITH my texture (kind of how programming works isn't it?), there's just one slight issue left, which I know gottsch has made a post for a while ago however was never solved, but maybe someone can help me figure this out. Whenever I spawn the painting they stay for about 5 seconds before it shift 1/2 block upwards, to just test if this still occurs when the mod is built and in a non-test environment they acted slightly different but still wrong. Small paintings (1x1 and 2x1) still move up a half block (and sometimes jump a full block up but back down to a half block immediately afterward), however larger paintings (i.e. 2x2) just jump up one block and stay stable there. I am not too sure how to debug why this jump occurs. All help is appreciated and kind thanks to all those who helped me get this far!

 

Coding

 

  Reveal hidden contents

 

 

I hope this also helps anyone else out there struggling to get a custom painting to work in 1.7.10

I'm a novice programmer but I learn from others showing me how to code correctly so thank you for any help you give me! :)

Posted

So after messing around with the code this morning I finally solved the issue, firstly I @Override the readSpawnData and writeSpawnData functions in my entity class which didn't directly solve the issue however did appear to smooth-en the rendering process. However while combing through the forums again I found a post by diesieben07 and changed my registering function to EntityRegistry.registerModEntity(PapPapEntity.class, "PapPapEntity", 113, MainRegistry.modInstance, 128, Integer.MAX_VALUE, false); and wall-la it works wonderfully, thank you very much diesieben07. And thank you kindly jeffryfisher, jabelar, Izzy Axel, and Abastro for helping me progress to this point in my older posts on older issues with my custom painting.

 

  On 4/2/2014 at 6:01 PM, diesieben07 said:

Try using the registering parameters that vanilla uses for Paintings, they work good for my posters:

EntityRegistry.registerModEntity(EntityPoster.class, "poster", 0, this, 160, Integer.MAX_VALUE, false);

 

After a year (I started this mod on April 29, 2015) I can finally clean it up and get this puppy out there, but thank you all for the help, I definitely have a much more hefty knowledge of entity coding now.  :D

I'm a novice programmer but I learn from others showing me how to code correctly so thank you for any help you give me! :)

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.