Jump to content

[SOLVED] Modified EntityArrow hitVec bug


Zaggy1024

Recommended Posts

I've been working on a mod for a while, and for it I modified EntityArrow to do a bunch of things, but now I seem to have hit a bug that I can't seem to squash.

I made a MovingObjectPosition field called lastHitMOP in it that, when not null, will make onUpdate do the hit code (damaging a living entity or seting inGround true). However, it seems that the hitVec value in it gets set to 0, 0, 0 after a few ticks (it doesn't always seem to happen, it's rather unpredictable), and I have no idea why. I also tried making the hit vector be three double fields instead, but they seemed to get reset too. Here's a pastebin of EntityArrow.java:

 

http://pastebin.com/B7sUcKq4

 

lastHitMOP is set on line 1067. The hit code begins on line 737.

 

Example debug output:

2013-05-03 13:32:51 [iNFO] [sTDOUT] CLIENT pre -12.461743733321669, 70.04916143532088, 260.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] CLIENT afterSetPrevMOP -12.461743733321669, 70.04916143532088, 260.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] CLIENT endrealtick -12.461743733321669, 70.04916143532088, 260.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] SERVER pre -12.45898904572035, 70.08384683688837, 260.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] SERVER afterSetPrevMOP -12.45898904572035, 70.08384683688837, 260.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] SERVER endrealtick -12.45898904572035, 70.08384683688837, 260.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] SERVER endrealtick -12.45898904572035, 70.08384683688837, 260.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] CLIENT endrealtick 0.0, 0.0, 0.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] SERVER endrealtick 0.0, 0.0, 0.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] CLIENT endrealtick -12.0, 68.0, 255.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] SERVER endrealtick 0.0, 0.0, 0.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] CLIENT endrealtick -0.093770332634449, 0.24353814125061035, 0.9653477072715759
2013-05-03 13:32:51 [iNFO] [sTDOUT] SERVER endrealtick 0.0, 0.0, 0.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] CLIENT endrealtick -0.093770332634449, 0.24353814125061035, 0.9653477072715759
2013-05-03 13:32:51 [iNFO] [sTDOUT] CLIENT calculations 0.0, 0.0, 0.0
2013-05-03 13:32:51 [iNFO] [sTDOUT] SERVER calculations 0.0, 0.0, 0.0

 

Anyone have any ideas why it's happening?

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.

Announcements



×
×
  • Create New...

Important Information

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