Jump to content

[1.11.2] [Solved] Problems with PathNodeType in custom block class


Recommended Posts

Posted (edited)

Hey,

 

I'm working on some hedges and would like to use the PathNodeType, to set the PathNodeType of my hedge to fences. But it doesn't seem to work. So I was wondering if it is fully implemented, and working?My hedge class is extending block, so unless the PathNodeType method is in another class, that souldn't be the problem, but maybe I'm using the wrong method to add PathNodeType?

 

Is it still like this, as it is in the github? 

@Nullable
@Override
public PathNodeType getAiPathNodeType(IBlockState state, IBlockAccess world, BlockPos pos)
{
	return PathNodeType.FENCE;
}

 

Any help would be great, not sure how many have any information about this, as it's a relative new 'feature' added to forge.

Edited by Erfurt
Posted
  On 4/21/2017 at 4:59 PM, diesieben07 said:

It should work. Define "doesn't seem to work".

Expand  

Well mobs like Zombies and villagers, try to 'jump' over my hedge, which they shouldn't if the PathNodeType was actually set to FENCE. So that why it doesn't seem to work.

Posted
  On 4/21/2017 at 5:26 PM, diesieben07 said:

Hm. Is the method called at all?

Expand  

You properly want to see my class, so here it is

  Reveal hidden contents

 

Posted
  On 4/21/2017 at 6:20 PM, diesieben07 said:

Hm. Put the breakpoint a bit further up (EntityMoveHelper::onUpdateMoveHelper) and see what is happening.

Expand  

Nothing seems to be happening. Do I need t o implement something or is there something wrong with the method I use?

Posted
  On 4/21/2017 at 6:38 PM, diesieben07 said:

That doesn't sound right.

Expand  

I agree, most likely me who doesn't understand that code. But for the method I'm using, I can't seem to find it anywhere, other than on the github page. I see nothing in ref files, which I find a bit weird if it's completely implemented, but maybe I'm looking in the wrong places? Also I'm on the 13.20.0.2282 build, maybe it's not in that one?

Posted
  On 4/21/2017 at 6:38 PM, diesieben07 said:

That doesn't sound right.

Expand  

I'm an idiot... It would seem that when I updated my mod, I somehow fucked up. So that I was still working in the old 1.10.2 version, which makes so much more sense. Sorry for wasting your time, thanks for your help though

Posted

As a note for the future, using the @Override annotation on all the methods you override from Block will help prevent issues like this - it'd cause a compile time error, as the getAiPathNodeType method doesn't exist in the Block class in 1.10.

 

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.