Skip to content

Commit

Permalink
refactor: Improve documentation for BlockPathingBehavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jellysquid3 committed Jan 18, 2021
1 parent 37ea312 commit 7d0b688
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* Provides the ability for mods to specify what {@link PathNodeType} their block uses for path-finding. This exists
* because Lithium replaces a large amount of entity path-finding logic, which can cause other mods which mixin to
* this code to fail or explode into other issues.
*
* This interface should be added to your {@link net.minecraft.block.Block} type to replace the default implementation.
*/
public interface BlockPathingBehavior {
/**
Expand Down Expand Up @@ -39,5 +41,5 @@ public interface BlockPathingBehavior {
* @return The path node type for the given block state when this block is being searched as a
* neighbor of another path node
*/
PathNodeType getNeighborPathNodeType(BlockState state);
PathNodeType getPathNodeTypeAsNeighbor(BlockState state);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private void init(CallbackInfo ci) {
BlockPathingBehavior behavior = (BlockPathingBehavior) this.getBlock();

this.pathNodeType = Validate.notNull(behavior.getPathNodeType(state));
this.pathNodeTypeNeighbor = Validate.notNull(behavior.getNeighborPathNodeType(state));
this.pathNodeTypeNeighbor = Validate.notNull(behavior.getPathNodeTypeAsNeighbor(state));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public PathNodeType getPathNodeType(BlockState state) {
}

@Override
public PathNodeType getNeighborPathNodeType(BlockState state) {
public PathNodeType getPathNodeTypeAsNeighbor(BlockState state) {
return PathNodeDefaults.getNeighborNodeType(state);
}
}

0 comments on commit 7d0b688

Please sign in to comment.