-
-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove debugging code and make vehicle enter blocked for boats/mineca…
…rts if Controllable is not enabled
- Loading branch information
Showing
3 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
main/src/main/java/net/citizensnpcs/npc/ai/EnhancedMovementExaminer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package net.citizensnpcs.npc.ai; | ||
|
||
import java.util.List; | ||
|
||
import org.bukkit.util.Vector; | ||
|
||
import com.google.common.collect.Lists; | ||
|
||
import net.citizensnpcs.api.astar.pathfinder.BlockSource; | ||
import net.citizensnpcs.api.astar.pathfinder.NeighbourGeneratorBlockExaminer; | ||
import net.citizensnpcs.api.astar.pathfinder.PathPoint; | ||
|
||
public class EnhancedMovementExaminer implements NeighbourGeneratorBlockExaminer { | ||
@Override | ||
public float getCost(BlockSource source, PathPoint point) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public List<PathPoint> getNeighbours(BlockSource source, PathPoint point) { | ||
Vector location = point.getVector(); | ||
List<PathPoint> neighbours = Lists.newArrayList(); | ||
for (int x = -1; x <= 1; x++) { | ||
for (int y = -1; y <= 1; y++) { | ||
for (int z = -1; z <= 1; z++) { | ||
if (x == 0 && y == 0 && z == 0) | ||
continue; | ||
if (x != 0 && z != 0) | ||
continue; | ||
Vector mod = location.clone().add(new Vector(x, y, z)); | ||
if (mod.equals(location)) | ||
continue; | ||
neighbours.add(point.createAtOffset(mod)); | ||
} | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public PassableState isPassable(BlockSource source, PathPoint point) { | ||
return null; | ||
} | ||
} |