LapisSea

Untitled

Aug 26th, 2016
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. public class EntityFoo extends EntityCreature{
  2.    
  3.     public EntityFoo(World worldIn){
  4.         super(worldIn);
  5.         this.forgePathfinderFlag(true); // tells class to init the forge pathfinder and replace the vanilla one (what is same as the vanilla one but with the "block preference" feature)
  6.        
  7.         this.tasks.addTask(......);
  8.  
  9.         this(.navigator).someKindOfPreferenceMap.put(FooModBlocks.road, 1.5F); // 50% more desireable to walk on the specified block (distance of path points with block below matching the specified block is divided thus possibly overriding a shorter path), Type HashMap<Block,Float>
  10.     }
  11. }
  12.  
  13.  
  14. //forge patch/new class: everything is extended except the part where a path is being chosen. Logic process: 1. Try to match block that is being walked. 2. if found divide distance of path point, if nothing found use vanilla PathNodeType.
Add Comment
Please, Sign In to add comment