Jump to content

Recommended Posts

Posted

So I've added a new entity to the game that is like the boat, but it travels on land. It's not finished yet, and theres still some code in it from the boat classes that I don't want to keep, however this issue if preventing me from working on it farther. I mod on my laptop, which isn't the best one in the world, only 3gb RAM, but most of the time it can run eclipse, two clients, and a server with my mod, if I have the graphics at minimum and I change the JVM arguments to allot more RAM. Anyway, after I added the Speeder, everything seemed fine so I created a test world, just on a single client now, to try it out. Everything was going fine until I placed one of the Speeders in the world with an item I created to spawn it in. It doesnt crash, no error, but my CPU use spikes to 100% and the game just sort of freezes. I left it for 10 minutes and it changed frames once. I'll post my src, and hopefully someone can tell me why this entity causes so much lag :D

 

Entity Class:

 

  Reveal hidden contents

 

 

Render Class

 

  Reveal hidden contents

 

 

Relevant part of public void load() method in main class:

 

  Reveal hidden contents

 

 

Yes, there are a lot of spots where it says boat in argument names xD

I should mention that this was working fine until i changed the bounding box of the entity class.

Posted

if (this.worldObj.isAABBInMaterial(axisalignedbb, Material.air))
            {
                d0 += 1.0D / (double)b0;
            }
//...
if (d0 < 1.0D)
            {
                d4 = d0 * 2.0D - 1.0D;
                this.motionY += 0.03999999910593033D * d4;
            }
            else
            {
                if (this.motionY < 0.0D)
                {
                    this.motionY /= 2.0D;
                }

                this.motionY += 0.007000000216066837D;
            }

So...your thing is going up into the air until it reaches max world height ?

Posted

Ohhh, that's some old leftover boat code that made it float to the top of water, can't believe i didn't see that. I'll try to fix that now, and edit this post to say whether or not it worked :D

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.