mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 15:45:10 +00:00
Merge Initial Fly
This commit is contained in:
commit
39a2e2f991
5 files changed
+488
-46
No files matched your search
@@ -25,6 +25,8 @@ public class FlyPathPoint extends PathPoint
|
||||
public FlyPathPoint previous;
|
||||
/** Indicates this is the origin */
|
||||
public boolean isFirst;
|
||||
public float costMalus;
|
||||
public PathNodeType nodeType = PathNodeType.BLOCKED;
|
||||
private static final String __OBFID = "CL_00000574";
|
||||
|
||||
public FlyPathPoint(int p_i2135_1_, int p_i2135_2_, int p_i2135_3_)
|
||||
@@ -44,7 +46,7 @@ public class FlyPathPoint extends PathPoint
|
||||
/**
|
||||
* Returns the linear distance to another path point
|
||||
*/
|
||||
public float distanceTo(net.minecraft.pathfinding.PathPoint p_75829_1_)
|
||||
public float distanceTo(FlyPathPoint p_75829_1_)
|
||||
{
|
||||
float f = (float)(p_75829_1_.xCoord - this.xCoord);
|
||||
float f1 = (float)(p_75829_1_.yCoord - this.yCoord);
|
||||
@@ -55,7 +57,7 @@ public class FlyPathPoint extends PathPoint
|
||||
/**
|
||||
* Returns the squared distance to another path point
|
||||
*/
|
||||
public float distanceToSquared(net.minecraft.pathfinding.PathPoint p_75832_1_)
|
||||
public float distanceToSquared(FlyPathPoint p_75832_1_)
|
||||
{
|
||||
float f = (float)(p_75832_1_.xCoord - this.xCoord);
|
||||
float f1 = (float)(p_75832_1_.yCoord - this.yCoord);
|
||||
|
||||
@@ -505,7 +505,7 @@ public class PathNavigateFlying extends PathNavigate {
|
||||
int i2 = j + l;
|
||||
int j2 = k + l;
|
||||
ChunkCache chunkcache = new ChunkCache(this.theEntity.worldObj, i1, j1, k1, l1, i2, j2, 0);
|
||||
FlyPathEntity pathentity = (new FlyPathFinder(chunkcache, p_72865_4_, p_72865_5_, p_72865_6_, p_72865_7_)).createEntityPathTo(p_72865_1_, p_72865_2_, p_72865_3_);
|
||||
FlyPathEntity pathentity = (new FlyPathFinder(chunkcache, p_72865_4_, p_72865_5_, p_72865_6_, p_72865_7_, p_72865_1_)).createEntityPathTo(p_72865_1_, p_72865_2_, p_72865_3_);
|
||||
this.theEntity.worldObj.theProfiler.endSection();
|
||||
return pathentity;
|
||||
}
|
||||
@@ -524,7 +524,7 @@ public class PathNavigateFlying extends PathNavigate {
|
||||
int l2 = i1 + k1;
|
||||
int i3 = j1 + k1;
|
||||
ChunkCache chunkcache = new ChunkCache(this.theEntity.worldObj, l1, i2, j2, k2, l2, i3, 0);
|
||||
FlyPathEntity pathentity = (new FlyPathFinder(chunkcache, p_72844_6_, p_72844_7_, p_72844_8_, p_72844_9_)).createEntityPathTo(p_72844_1_, p_72844_2_, p_72844_3_, p_72844_4_, p_72844_5_);
|
||||
FlyPathEntity pathentity = (new FlyPathFinder(chunkcache, p_72844_6_, p_72844_7_, p_72844_8_, p_72844_9_, p_72844_1_)).createEntityPathTo(p_72844_1_, p_72844_2_, p_72844_3_, p_72844_4_, p_72844_5_);
|
||||
this.theEntity.worldObj.theProfiler.endSection();
|
||||
return pathentity;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package noppes.npcs.ai.pathfinder;
|
||||
|
||||
public enum PathNodeType
|
||||
{
|
||||
BLOCKED(-1.0F),
|
||||
OPEN(0.0F),
|
||||
WALKABLE(0.0F),
|
||||
TRAPDOOR(0.0F),
|
||||
FENCE(-1.0F),
|
||||
LAVA(-1.0F),
|
||||
WATER(8.0F),
|
||||
RAIL(0.0F),
|
||||
DANGER_FIRE(8.0F),
|
||||
DAMAGE_FIRE(16.0F),
|
||||
DANGER_CACTUS(8.0F),
|
||||
DAMAGE_CACTUS(-1.0F),
|
||||
DANGER_OTHER(8.0F),
|
||||
DAMAGE_OTHER(-1.0F),
|
||||
DOOR_OPEN(0.0F),
|
||||
DOOR_WOOD_CLOSED(-1.0F),
|
||||
DOOR_IRON_CLOSED(-1.0F);
|
||||
|
||||
private final float priority;
|
||||
|
||||
private PathNodeType(float priorityIn)
|
||||
{
|
||||
this.priority = priorityIn;
|
||||
}
|
||||
|
||||
public float getPriority()
|
||||
{
|
||||
return this.priority;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user