Skip to content

Package net.minecraft.world.level.pathfinder

Part 1/1


AmphibiousNodeEvaluator

  • Full name: net.minecraft.world.level.pathfinder.AmphibiousNodeEvaluator
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java
  • Type: class
  • Modifiers: public
  • Extends: WalkNodeEvaluator

net.minecraft.world.level.pathfinder.AmphibiousNodeEvaluator#AmphibiousNodeEvaluator(boolean)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java:15
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ AmphibiousNodeEvaluator ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: prefersShallowSwimming.

Parameters

  • boolean bl

ตัวอย่างใช้งาน

AmphibiousNodeEvaluator instance = new AmphibiousNodeEvaluator(true);

net.minecraft.world.level.pathfinder.AmphibiousNodeEvaluator#done()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java:29
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ done ตาม implementation ของ AmphibiousNodeEvaluator

ทำงานยังไง

เรียกต่อ: setPathfindingMalus().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

AmphibiousNodeEvaluator instance = ...;
instance.done();

net.minecraft.world.level.pathfinder.AmphibiousNodeEvaluator#getNeighbors(Node[],Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java:50
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Neighbors

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getCachedPathType(), getPathfindingMalus(), floor(), max(), maxUpStep(), getFloorLevel(), findAcceptedNode(), isVerticalNeighborValid(). สร้างออบเจ็กต์: BlockPos. คืนค่า: i.

Parameters

  • Node[] nodes
  • Node node

ตัวอย่างใช้งาน

AmphibiousNodeEvaluator instance = ...;
Node[] nodes = ...;
Node node = ...;
int result = instance.getNeighbors(nodes, node);

net.minecraft.world.level.pathfinder.AmphibiousNodeEvaluator#getPathType(PathfindingContext,int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java:92
  • Modifiers: public
  • Return: PathType

คืออะไร

อ่านค่า Path Type

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getPathTypeFromState(), MutableBlockPos(), values(), set(), move(), getX(), getY(), getZ(). สร้างออบเจ็กต์: BlockPos.MutableBlockPos. มีจุด return อย่างน้อย 3 จุด.

Parameters

  • PathfindingContext pathfindingContext
  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

AmphibiousNodeEvaluator instance = ...;
PathfindingContext pathfindingContext = ...;
PathType result = instance.getPathType(pathfindingContext, 0, 0, 0);

net.minecraft.world.level.pathfinder.AmphibiousNodeEvaluator#getStart()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java:36
  • Modifiers: public
  • Return: Node

คืออะไร

อ่านค่า Start

ทำงานยังไง

เรียกต่อ: isInWater(), getStartNode(), floor(), getBoundingBox(). สร้างออบเจ็กต์: BlockPos.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

AmphibiousNodeEvaluator instance = ...;
Node result = instance.getStart();

net.minecraft.world.level.pathfinder.AmphibiousNodeEvaluator#getTarget(double,double,double)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java:45
  • Modifiers: public
  • Return: Target

คืออะไร

อ่านค่า Target

ทำงานยังไง

เรียกต่อ: getTargetNodeAt(). คืนค่า: this.getTargetNodeAt(d, e + 0.5, f).

Parameters

  • double d
  • double e
  • double f

ตัวอย่างใช้งาน

AmphibiousNodeEvaluator instance = ...;
Target result = instance.getTarget(0.0D, 0.0D, 0.0D);

net.minecraft.world.level.pathfinder.AmphibiousNodeEvaluator#isAmphibious()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java:87
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Amphibious

ทำงานยังไง

คืนค่า: true.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

@Override
protected boolean isAmphibious() {
    return super.isAmphibious();
}

net.minecraft.world.level.pathfinder.AmphibiousNodeEvaluator#prepare(PathNavigationRegion,Mob)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator.java:19
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ prepare ตาม implementation ของ AmphibiousNodeEvaluator

ทำงานยังไง

แก้ state: oldWalkableCost, oldWaterBorderCost. เรียกต่อ: setPathfindingMalus(), getPathfindingMalus().

Parameters

  • PathNavigationRegion pathNavigationRegion
  • Mob mob

ตัวอย่างใช้งาน

AmphibiousNodeEvaluator instance = ...;
PathNavigationRegion pathNavigationRegion = ...;
Mob mob = ...;
instance.prepare(pathNavigationRegion, mob);

BinaryHeap

  • Full name: net.minecraft.world.level.pathfinder.BinaryHeap
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/BinaryHeap.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.pathfinder.BinaryHeap#changeCost(Node,float)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/BinaryHeap.java:60
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ changeCost ตาม implementation ของ BinaryHeap

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: upHeap(), downHeap().

Parameters

  • Node node
  • float f

ตัวอย่างใช้งาน

BinaryHeap instance = ...;
Node node = ...;
instance.changeCost(node, 0.0F);

net.minecraft.world.level.pathfinder.BinaryHeap#clear()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/BinaryHeap.java:26
  • Modifiers: public
  • Return: void

คืออะไร

ล้าง clear

ทำงานยังไง

แก้ state: size.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

BinaryHeap instance = ...;
instance.clear();

net.minecraft.world.level.pathfinder.BinaryHeap#getHeap()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/BinaryHeap.java:144
  • Modifiers: public
  • Return: Node[]

คืออะไร

อ่านค่า Heap

ทำงานยังไง

เรียกต่อ: copyOf(). คืนค่า: Arrays.copyOf(this.heap, this.size).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

BinaryHeap instance = ...;
Node[] result = instance.getHeap();

net.minecraft.world.level.pathfinder.BinaryHeap#insert(Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/BinaryHeap.java:9
  • Modifiers: public
  • Return: Node

คืออะไร

ดำเนินการ insert ตาม implementation ของ BinaryHeap

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: size, heap. เรียกต่อ: arraycopy(), upHeap(). สร้างออบเจ็กต์: IllegalStateException. คืนค่า: node.

Parameters

  • Node node

ตัวอย่างใช้งาน

BinaryHeap instance = ...;
Node node = ...;
Node result = instance.insert(node);

net.minecraft.world.level.pathfinder.BinaryHeap#isEmpty()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/BinaryHeap.java:140
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Empty

ทำงานยังไง

แก้ state: size. คืนค่า: this.size == 0.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

BinaryHeap instance = ...;
boolean result = instance.isEmpty();

net.minecraft.world.level.pathfinder.BinaryHeap#peek()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/BinaryHeap.java:30
  • Modifiers: public
  • Return: Node

คืออะไร

ดำเนินการ peek ตาม implementation ของ BinaryHeap

ทำงานยังไง

คืนค่า: this.heap[0].

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

BinaryHeap instance = ...;
Node result = instance.peek();

net.minecraft.world.level.pathfinder.BinaryHeap#pop()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/BinaryHeap.java:34
  • Modifiers: public
  • Return: Node

คืออะไร

ดำเนินการ pop ตาม implementation ของ BinaryHeap

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: downHeap(). คืนค่า: node.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

BinaryHeap instance = ...;
Node result = instance.pop();

net.minecraft.world.level.pathfinder.BinaryHeap#remove(Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/BinaryHeap.java:46
  • Modifiers: public
  • Return: void

คืออะไร

ลบ remove

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: upHeap(), downHeap().

Parameters

  • Node node

ตัวอย่างใช้งาน

BinaryHeap instance = ...;
Node node = ...;
instance.remove(node);

net.minecraft.world.level.pathfinder.BinaryHeap#size()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/BinaryHeap.java:70
  • Modifiers: public
  • Return: int

คืออะไร

ดำเนินการ size ตาม implementation ของ BinaryHeap

ทำงานยังไง

คืนค่า: this.size.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

BinaryHeap instance = ...;
int result = instance.size();

FlyNodeEvaluator

  • Full name: net.minecraft.world.level.pathfinder.FlyNodeEvaluator
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/FlyNodeEvaluator.java
  • Type: class
  • Modifiers: public
  • Extends: WalkNodeEvaluator

net.minecraft.world.level.pathfinder.FlyNodeEvaluator#canStartAt(BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/FlyNodeEvaluator.java:64
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Start At

ทำงานยังไง

เรียกต่อ: getCachedPathType(), getX(), getY(), getZ(), getPathfindingMalus(). คืนค่า: this.mob.getPathfindingMalus(pathType) >= 0.0F.

Parameters

  • BlockPos blockPos

ตัวอย่างใช้งาน

BlockPos blockPos = ...;
@Override
protected boolean canStartAt(BlockPos blockPos) {
    return super.canStartAt(blockPos);
}

net.minecraft.world.level.pathfinder.FlyNodeEvaluator#done()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/FlyNodeEvaluator.java:28
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ done ตาม implementation ของ FlyNodeEvaluator

ทำงานยังไง

เรียกต่อ: onPathfindingDone(), clear().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

FlyNodeEvaluator instance = ...;
instance.done();

net.minecraft.world.level.pathfinder.FlyNodeEvaluator#findAcceptedNode(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/FlyNodeEvaluator.java:267
  • Modifiers: protected
  • Return: Node

คืออะไร

ค้นหา Accepted Node

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getCachedPathType(), getPathfindingMalus(), getNode(), max(). คืนค่า: node.

Parameters

  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

@Override
protected Node findAcceptedNode(int i, int j, int k) {
    return super.findAcceptedNode(i, j, k);
}

net.minecraft.world.level.pathfinder.FlyNodeEvaluator#getCachedPathType(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/FlyNodeEvaluator.java:284
  • Modifiers: protected
  • Return: PathType

คืออะไร

อ่านค่า Cached Path Type

ทำงานยังไง

เรียกต่อ: computeIfAbsent(), asLong(), getPathTypeOfMob(). คืนค่า: this.pathTypeByPosCache.computeIfAbsent(BlockPos.asLong(i, j, k), l -> this.getPathTypeOfMob(this.currentContext, i, j, k, this.mob)).

Parameters

  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

@Override
protected PathType getCachedPathType(int i, int j, int k) {
    return super.getCachedPathType(i, j, k);
}

net.minecraft.world.level.pathfinder.FlyNodeEvaluator#getNeighbors(Node[],Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/FlyNodeEvaluator.java:75
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Neighbors

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: findAcceptedNode(), isOpen(), hasMalus(). คืนค่า: i.

Parameters

  • Node[] nodes
  • Node node

ตัวอย่างใช้งาน

FlyNodeEvaluator instance = ...;
Node[] nodes = ...;
Node node = ...;
int result = instance.getNeighbors(nodes, node);

net.minecraft.world.level.pathfinder.FlyNodeEvaluator#getPathType(PathfindingContext,int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/FlyNodeEvaluator.java:289
  • Modifiers: public
  • Return: PathType

คืออะไร

อ่านค่า Path Type

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getPathTypeFromState(), level(), getMinY(), getX(), getY(), getZ(), equals(), mobPosition(). สร้างออบเจ็กต์: BlockPos. คืนค่า: pathType.

Parameters

  • PathfindingContext pathfindingContext
  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

FlyNodeEvaluator instance = ...;
PathfindingContext pathfindingContext = ...;
PathType result = instance.getPathType(pathfindingContext, 0, 0, 0);

net.minecraft.world.level.pathfinder.FlyNodeEvaluator#getStart()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/FlyNodeEvaluator.java:35
  • Modifiers: public
  • Return: Node

คืออะไร

อ่านค่า Start

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: canFloat(), isInWater(), getBlockY(), MutableBlockPos(), getX(), getZ(), getBlockState(), is(). สร้างออบเจ็กต์: BlockPos.MutableBlockPos. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

FlyNodeEvaluator instance = ...;
Node result = instance.getStart();

net.minecraft.world.level.pathfinder.FlyNodeEvaluator#getTarget(double,double,double)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/FlyNodeEvaluator.java:70
  • Modifiers: public
  • Return: Target

คืออะไร

อ่านค่า Target

ทำงานยังไง

เรียกต่อ: getTargetNodeAt(). คืนค่า: this.getTargetNodeAt(d, e, f).

Parameters

  • double d
  • double e
  • double f

ตัวอย่างใช้งาน

FlyNodeEvaluator instance = ...;
Target result = instance.getTarget(0.0D, 0.0D, 0.0D);

net.minecraft.world.level.pathfinder.FlyNodeEvaluator#prepare(PathNavigationRegion,Mob)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/FlyNodeEvaluator.java:21
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ prepare ตาม implementation ของ FlyNodeEvaluator

ทำงานยังไง

เรียกต่อ: clear(), onPathfindingStart().

Parameters

  • PathNavigationRegion pathNavigationRegion
  • Mob mob

ตัวอย่างใช้งาน

FlyNodeEvaluator instance = ...;
PathNavigationRegion pathNavigationRegion = ...;
Mob mob = ...;
instance.prepare(pathNavigationRegion, mob);

Node

  • Full name: net.minecraft.world.level.pathfinder.Node
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/Node.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.pathfinder.Node#asBlockPos()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:98
  • Modifiers: public
  • Return: BlockPos

คืออะไร

ดำเนินการ asBlockPos ตาม implementation ของ Node

ทำงานยังไง

สร้างออบเจ็กต์: BlockPos. คืนค่า: new BlockPos(this.x, this.y, this.z).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Node instance = ...;
BlockPos result = instance.asBlockPos();

net.minecraft.world.level.pathfinder.Node#asVec3()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:102
  • Modifiers: public
  • Return: Vec3

คืออะไร

ดำเนินการ asVec3 ตาม implementation ของ Node

ทำงานยังไง

สร้างออบเจ็กต์: Vec3. คืนค่า: new Vec3(this.x, this.y, this.z).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Node instance = ...;
Vec3 result = instance.asVec3();

net.minecraft.world.level.pathfinder.Node#cloneAndMove(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:32
  • Modifiers: public
  • Return: Node

คืออะไร

ทำสำเนา And Move

ทำงานยังไง

สร้างออบเจ็กต์: Node. คืนค่า: node.

Parameters

  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

Node instance = ...;
Node result = instance.cloneAndMove(0, 0, 0);

net.minecraft.world.level.pathfinder.Node#createFromStream(FriendlyByteBuf)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:136
  • Modifiers: public static
  • Return: Node

คืออะไร

สร้าง From Stream

ทำงานยังไง

เรียกต่อ: readInt(), readContents(). สร้างออบเจ็กต์: Node. คืนค่า: node.

Parameters

  • FriendlyByteBuf friendlyByteBuf

ตัวอย่างใช้งาน

FriendlyByteBuf friendlyByteBuf = ...;
Node result = Node.createFromStream(friendlyByteBuf);

net.minecraft.world.level.pathfinder.Node#createHash(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:46
  • Modifiers: public static
  • Return: int

คืออะไร

สร้าง Hash

ทำงานยังไง

คืนค่า: j & 0xFF | (i & 32767) << 8 | (k & 32767) << 24 | (i < 0 ? Integer.MIN_VALUE : 0) | (k < 0 ? 32768 : 0).

Parameters

  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

int result = Node.createHash(0, 0, 0);

net.minecraft.world.level.pathfinder.Node#distanceManhattan(BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:91
  • Modifiers: public
  • Return: float

คืออะไร

ดำเนินการ distanceManhattan ตาม implementation ของ Node

ทำงานยังไง

เรียกต่อ: abs(), getX(), getY(), getZ(). คืนค่า: f + g + h.

Parameters

  • BlockPos blockPos

ตัวอย่างใช้งาน

Node instance = ...;
BlockPos blockPos = ...;
float result = instance.distanceManhattan(blockPos);

net.minecraft.world.level.pathfinder.Node#distanceManhattan(Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:84
  • Modifiers: public
  • Return: float

คืออะไร

ดำเนินการ distanceManhattan ตาม implementation ของ Node

ทำงานยังไง

เรียกต่อ: abs(). คืนค่า: f + g + h.

Parameters

  • Node node

ตัวอย่างใช้งาน

Node instance = ...;
Node node = ...;
float result = instance.distanceManhattan(node);

net.minecraft.world.level.pathfinder.Node#distanceTo(BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:63
  • Modifiers: public
  • Return: float

คืออะไร

ดำเนินการ distanceTo ตาม implementation ของ Node

ทำงานยังไง

เรียกต่อ: getX(), getY(), getZ(), sqrt(). คืนค่า: Mth.sqrt(f * f + g * g + h * h).

Parameters

  • BlockPos blockPos

ตัวอย่างใช้งาน

Node instance = ...;
BlockPos blockPos = ...;
float result = instance.distanceTo(blockPos);

net.minecraft.world.level.pathfinder.Node#distanceTo(Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:50
  • Modifiers: public
  • Return: float

คืออะไร

ดำเนินการ distanceTo ตาม implementation ของ Node

ทำงานยังไง

เรียกต่อ: sqrt(). คืนค่า: Mth.sqrt(f * f + g * g + h * h).

Parameters

  • Node node

ตัวอย่างใช้งาน

Node instance = ...;
Node node = ...;
float result = instance.distanceTo(node);

net.minecraft.world.level.pathfinder.Node#distanceToSqr(BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:77
  • Modifiers: public
  • Return: float

คืออะไร

ดำเนินการ distanceToSqr ตาม implementation ของ Node

ทำงานยังไง

เรียกต่อ: getX(), getY(), getZ(). คืนค่า: f * f + g * g + h * h.

Parameters

  • BlockPos blockPos

ตัวอย่างใช้งาน

Node instance = ...;
BlockPos blockPos = ...;
float result = instance.distanceToSqr(blockPos);

net.minecraft.world.level.pathfinder.Node#distanceToSqr(Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:70
  • Modifiers: public
  • Return: float

คืออะไร

ดำเนินการ distanceToSqr ตาม implementation ของ Node

ทำงานยังไง

คืนค่า: f * f + g * g + h * h.

Parameters

  • Node node

ตัวอย่างใช้งาน

Node instance = ...;
Node node = ...;
float result = instance.distanceToSqr(node);

net.minecraft.world.level.pathfinder.Node#distanceToXZ(Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:57
  • Modifiers: public
  • Return: float

คืออะไร

ดำเนินการ distanceToXZ ตาม implementation ของ Node

ทำงานยังไง

เรียกต่อ: sqrt(). คืนค่า: Mth.sqrt(f * f + g * g).

Parameters

  • Node node

ตัวอย่างใช้งาน

Node instance = ...;
Node node = ...;
float result = instance.distanceToXZ(node);

net.minecraft.world.level.pathfinder.Node#equals(Object)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:106
  • Modifiers: public
  • Return: boolean

คืออะไร

เปรียบเทียบความเท่ากัน equals

ทำงานยังไง

แก้ state: hash, x, y, z. คืนค่า: !(object instanceof Node node) ? false : this.hash == node.hash && this.x == node.x && this.y == node.y && this.z == node.z.

Parameters

  • Object object

ตัวอย่างใช้งาน

Node instance = ...;
Object object = ...;
boolean result = instance.equals(object);

net.minecraft.world.level.pathfinder.Node#hashCode()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:111
  • Modifiers: public
  • Return: int

คืออะไร

ดำเนินการ hashCode ตาม implementation ของ Node

ทำงานยังไง

คืนค่า: this.hash.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Node instance = ...;
int result = instance.hashCode();

net.minecraft.world.level.pathfinder.Node#inOpenSet()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:116
  • Modifiers: public
  • Return: boolean

คืออะไร

ดำเนินการ inOpenSet ตาม implementation ของ Node

ทำงานยังไง

คืนค่า: this.heapIdx >= 0.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Node instance = ...;
boolean result = instance.inOpenSet();

net.minecraft.world.level.pathfinder.Node#Node(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:25
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ Node ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: x, y, z, hash. เรียกต่อ: createHash().

Parameters

  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

Node instance = new Node(0, 0, 0);

net.minecraft.world.level.pathfinder.Node#readContents(FriendlyByteBuf,Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:142
  • Modifiers: protected static
  • Return: void

คืออะไร

อ่าน Contents

ทำงานยังไง

เรียกต่อ: readFloat(), readBoolean(), readEnum().

Parameters

  • FriendlyByteBuf friendlyByteBuf
  • Node node

ตัวอย่างใช้งาน

FriendlyByteBuf friendlyByteBuf = ...;
Node node = ...;
@Override
protected void readContents(FriendlyByteBuf friendlyByteBuf, Node node) {
    super.readContents(friendlyByteBuf, node);
}

net.minecraft.world.level.pathfinder.Node#toString()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:120
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ toString ตาม implementation ของ Node

ทำงานยังไง

คืนค่า: "Node{x=" + this.x + ", y=" + this.y + ", z=" + this.z + "}".

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Node instance = ...;
String result = instance.toString();

net.minecraft.world.level.pathfinder.Node#writeToStream(FriendlyByteBuf)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Node.java:125
  • Modifiers: public
  • Return: void

คืออะไร

เขียน To Stream

ทำงานยังไง

เรียกต่อ: writeInt(), writeFloat(), writeBoolean(), writeEnum().

Parameters

  • FriendlyByteBuf friendlyByteBuf

ตัวอย่างใช้งาน

Node instance = ...;
FriendlyByteBuf friendlyByteBuf = ...;
instance.writeToStream(friendlyByteBuf);

NodeEvaluator

  • Full name: net.minecraft.world.level.pathfinder.NodeEvaluator
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/NodeEvaluator.java
  • Type: class
  • Modifiers: public abstract

net.minecraft.world.level.pathfinder.NodeEvaluator#canFloat()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:90
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Float

ทำงานยังไง

คืนค่า: this.canFloat.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
boolean result = instance.canFloat();

net.minecraft.world.level.pathfinder.NodeEvaluator#canOpenDoors()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:86
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Open Doors

ทำงานยังไง

คืนค่า: this.canOpenDoors.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
boolean result = instance.canOpenDoors();

net.minecraft.world.level.pathfinder.NodeEvaluator#canPassDoors()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:82
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Pass Doors

ทำงานยังไง

คืนค่า: this.canPassDoors.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
boolean result = instance.canPassDoors();

net.minecraft.world.level.pathfinder.NodeEvaluator#canWalkOverFences()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:94
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Walk Over Fences

ทำงานยังไง

คืนค่า: this.canWalkOverFences.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
boolean result = instance.canWalkOverFences();

net.minecraft.world.level.pathfinder.NodeEvaluator#done()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:35
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ done ตาม implementation ของ NodeEvaluator

ทำงานยังไง

แก้ state: currentContext, mob.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
instance.done();

net.minecraft.world.level.pathfinder.NodeEvaluator#getNeighbors(Node[],Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:56
  • Modifiers: public abstract
  • Return: int

คืออะไร

อ่านค่า Neighbors

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • Node[] nodes
  • Node node

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
Node[] nodes = ...;
Node node = ...;
int result = instance.getNeighbors(nodes, node);

net.minecraft.world.level.pathfinder.NodeEvaluator#getNode(BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:40
  • Modifiers: protected
  • Return: Node

คืออะไร

อ่านค่า Node

ทำงานยังไง

เรียกต่อ: getX(), getY(), getZ(). คืนค่า: this.getNode(blockPos.getX(), blockPos.getY(), blockPos.getZ()).

Parameters

  • BlockPos blockPos

ตัวอย่างใช้งาน

BlockPos blockPos = ...;
@Override
protected Node getNode(BlockPos blockPos) {
    return super.getNode(blockPos);
}

net.minecraft.world.level.pathfinder.NodeEvaluator#getNode(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:44
  • Modifiers: protected
  • Return: Node

คืออะไร

อ่านค่า Node

ทำงานยังไง

เรียกต่อ: computeIfAbsent(), createHash(). สร้างออบเจ็กต์: Node. คืนค่า: this.nodes.computeIfAbsent(Node.createHash(i, j, k), l -> new Node(i, j, k)).

Parameters

  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

@Override
protected Node getNode(int i, int j, int k) {
    return super.getNode(i, j, k);
}

net.minecraft.world.level.pathfinder.NodeEvaluator#getPathType(Mob,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:62
  • Modifiers: public
  • Return: PathType

คืออะไร

อ่านค่า Path Type

ทำงานยังไง

เรียกต่อ: level(), getX(), getY(), getZ(). สร้างออบเจ็กต์: PathfindingContext. คืนค่า: this.getPathType(new PathfindingContext(mob.level(), mob), blockPos.getX(), blockPos.getY(), blockPos.getZ()).

Parameters

  • Mob mob
  • BlockPos blockPos

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
Mob mob = ...;
BlockPos blockPos = ...;
PathType result = instance.getPathType(mob, blockPos);

net.minecraft.world.level.pathfinder.NodeEvaluator#getPathType(PathfindingContext,int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:60
  • Modifiers: public abstract
  • Return: PathType

คืออะไร

อ่านค่า Path Type

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • PathfindingContext pathfindingContext
  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
PathfindingContext pathfindingContext = ...;
PathType result = instance.getPathType(pathfindingContext, 0, 0, 0);

net.minecraft.world.level.pathfinder.NodeEvaluator#getPathTypeOfMob(PathfindingContext,int,int,int,Mob)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:58
  • Modifiers: public abstract
  • Return: PathType

คืออะไร

อ่านค่า Path Type Of Mob

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • PathfindingContext pathfindingContext
  • int i
  • int j
  • int k
  • Mob mob

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
PathfindingContext pathfindingContext = ...;
Mob mob = ...;
PathType result = instance.getPathTypeOfMob(pathfindingContext, 0, 0, 0, mob);

net.minecraft.world.level.pathfinder.NodeEvaluator#getStart()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:48
  • Modifiers: public abstract
  • Return: Node

คืออะไร

อ่านค่า Start

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
Node result = instance.getStart();

net.minecraft.world.level.pathfinder.NodeEvaluator#getTarget(double,double,double)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:50
  • Modifiers: public abstract
  • Return: Target

คืออะไร

อ่านค่า Target

ทำงานยังไง

ไม่มี implementation ใน declaration นี้; คลาสลูก/implementation เป็นผู้กำหนดพฤติกรรมจริง

Parameters

  • double d
  • double e
  • double f

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
Target result = instance.getTarget(0.0D, 0.0D, 0.0D);

net.minecraft.world.level.pathfinder.NodeEvaluator#getTargetNodeAt(double,double,double)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:52
  • Modifiers: protected
  • Return: Target

คืออะไร

อ่านค่า Target Node At

ทำงานยังไง

เรียกต่อ: getNode(), floor(). สร้างออบเจ็กต์: Target. คืนค่า: new Target(this.getNode(Mth.floor(d), Mth.floor(e), Mth.floor(f))).

Parameters

  • double d
  • double e
  • double f

ตัวอย่างใช้งาน

@Override
protected Target getTargetNodeAt(double d, double e, double f) {
    return super.getTargetNodeAt(d, e, f);
}

net.minecraft.world.level.pathfinder.NodeEvaluator#isBurningBlock(BlockState)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:98
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Burning Block

ทำงานยังไง

เรียกต่อ: is(), isLitCampfire().

Parameters

  • BlockState blockState

ตัวอย่างใช้งาน

BlockState blockState = ...;
boolean result = NodeEvaluator.isBurningBlock(blockState);

net.minecraft.world.level.pathfinder.NodeEvaluator#prepare(PathNavigationRegion,Mob)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:26
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ prepare ตาม implementation ของ NodeEvaluator

ทำงานยังไง

แก้ state: currentContext, mob, entityWidth, entityHeight, entityDepth. เรียกต่อ: clear(), floor(), getBbWidth(), getBbHeight(). สร้างออบเจ็กต์: PathfindingContext.

Parameters

  • PathNavigationRegion pathNavigationRegion
  • Mob mob

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
PathNavigationRegion pathNavigationRegion = ...;
Mob mob = ...;
instance.prepare(pathNavigationRegion, mob);

net.minecraft.world.level.pathfinder.NodeEvaluator#setCanFloat(boolean)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:74
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Can Float

ทำงานยังไง

แก้ state: canFloat.

Parameters

  • boolean bl

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
instance.setCanFloat(true);

net.minecraft.world.level.pathfinder.NodeEvaluator#setCanOpenDoors(boolean)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:70
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Can Open Doors

ทำงานยังไง

แก้ state: canOpenDoors.

Parameters

  • boolean bl

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
instance.setCanOpenDoors(true);

net.minecraft.world.level.pathfinder.NodeEvaluator#setCanPassDoors(boolean)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:66
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Can Pass Doors

ทำงานยังไง

แก้ state: canPassDoors.

Parameters

  • boolean bl

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
instance.setCanPassDoors(true);

net.minecraft.world.level.pathfinder.NodeEvaluator#setCanWalkOverFences(boolean)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/NodeEvaluator.java:78
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Can Walk Over Fences

ทำงานยังไง

แก้ state: canWalkOverFences.

Parameters

  • boolean bl

ตัวอย่างใช้งาน

NodeEvaluator instance = ...;
instance.setCanWalkOverFences(true);

Path

  • Full name: net.minecraft.world.level.pathfinder.Path
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/Path.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.pathfinder.Path#advance()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:29
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ advance ตาม implementation ของ Path

ทำงานยังไง

แก้ state: nextNodeIndex.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
instance.advance();

net.minecraft.world.level.pathfinder.Path#canReach()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:121
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Reach

ทำงานยังไง

คืนค่า: this.reached.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
boolean result = instance.canReach();

net.minecraft.world.level.pathfinder.Path#copy()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:188
  • Modifiers: public
  • Return: Path

คืออะไร

คัดลอก copy

ทำงานยังไง

สร้างออบเจ็กต์: Path. คืนค่า: path.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
Path result = instance.copy();

net.minecraft.world.level.pathfinder.Path#createFromStream(FriendlyByteBuf)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:145
  • Modifiers: public static
  • Return: Path

คืออะไร

สร้าง From Stream

ทำงานยังไง

เรียกต่อ: readBoolean(), readInt(), readBlockPos(), readList(), read(). สร้างออบเจ็กต์: Path. คืนค่า: path.

Parameters

  • FriendlyByteBuf friendlyByteBuf

ตัวอย่างใช้งาน

FriendlyByteBuf friendlyByteBuf = ...;
Path result = Path.createFromStream(friendlyByteBuf);

net.minecraft.world.level.pathfinder.Path#debugData()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:130
  • Modifiers: public
  • Return: Path.DebugData

คืออะไร

ดำเนินการ debugData ตาม implementation ของ Path

ทำงานยังไง

คืนค่า: this.debugData.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
Path.DebugData result = instance.debugData();

net.minecraft.world.level.pathfinder.Path#getDistToTarget()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:166
  • Modifiers: public
  • Return: float

คืออะไร

อ่านค่า Dist To Target

ทำงานยังไง

คืนค่า: this.distToTarget.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
float result = instance.getDistToTarget();

net.minecraft.world.level.pathfinder.Path#getEndNode()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:41
  • Modifiers: public
  • Return: Node

คืออะไร

อ่านค่า End Node

ทำงานยังไง

เรียกต่อ: isEmpty(), get(), size(). คืนค่า: !this.nodes.isEmpty() ? this.nodes.get(this.nodes.size() - 1) : null.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
Node result = instance.getEndNode();

net.minecraft.world.level.pathfinder.Path#getEntityPosAtNode(Entity,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:72
  • Modifiers: public
  • Return: Vec3

คืออะไร

อ่านค่า Entity Pos At Node

ทำงานยังไง

เรียกต่อ: get(), getBbWidth(). สร้างออบเจ็กต์: Vec3. คืนค่า: new Vec3(d, e, f).

Parameters

  • Entity entity
  • int i

ตัวอย่างใช้งาน

Path instance = ...;
Entity entity = ...;
Vec3 result = instance.getEntityPosAtNode(entity, 0);

net.minecraft.world.level.pathfinder.Path#getNextEntityPos(Entity)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:84
  • Modifiers: public
  • Return: Vec3

คืออะไร

อ่านค่า Next Entity Pos

ทำงานยังไง

เรียกต่อ: getEntityPosAtNode(). คืนค่า: this.getEntityPosAtNode(entity, this.nextNodeIndex).

Parameters

  • Entity entity

ตัวอย่างใช้งาน

Path instance = ...;
Entity entity = ...;
Vec3 result = instance.getNextEntityPos(entity);

net.minecraft.world.level.pathfinder.Path#getNextNode()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:92
  • Modifiers: public
  • Return: Node

คืออะไร

อ่านค่า Next Node

ทำงานยังไง

เรียกต่อ: get(). คืนค่า: this.nodes.get(this.nextNodeIndex).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
Node result = instance.getNextNode();

net.minecraft.world.level.pathfinder.Path#getNextNodeIndex()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:64
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Next Node Index

ทำงานยังไง

คืนค่า: this.nextNodeIndex.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
int result = instance.getNextNodeIndex();

net.minecraft.world.level.pathfinder.Path#getNextNodePos()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:88
  • Modifiers: public
  • Return: BlockPos

คืออะไร

อ่านค่า Next Node Pos

ทำงานยังไง

เรียกต่อ: get(), asBlockPos(). คืนค่า: this.nodes.get(this.nextNodeIndex).asBlockPos().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
BlockPos result = instance.getNextNodePos();

net.minecraft.world.level.pathfinder.Path#getNode(int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:46
  • Modifiers: public
  • Return: Node

คืออะไร

อ่านค่า Node

ทำงานยังไง

เรียกต่อ: get(). คืนค่า: this.nodes.get(i).

Parameters

  • int i

ตัวอย่างใช้งาน

Path instance = ...;
Node result = instance.getNode(0);

net.minecraft.world.level.pathfinder.Path#getNodeCount()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:60
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Node Count

ทำงานยังไง

เรียกต่อ: size(). คืนค่า: this.nodes.size().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
int result = instance.getNodeCount();

net.minecraft.world.level.pathfinder.Path#getNodePos(int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:80
  • Modifiers: public
  • Return: BlockPos

คืออะไร

อ่านค่า Node Pos

ทำงานยังไง

เรียกต่อ: get(), asBlockPos(). คืนค่า: this.nodes.get(i).asBlockPos().

Parameters

  • int i

ตัวอย่างใช้งาน

Path instance = ...;
BlockPos result = instance.getNodePos(0);

net.minecraft.world.level.pathfinder.Path#getPreviousNode()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:96
  • Modifiers: public
  • Return: Node

คืออะไร

อ่านค่า Previous Node

ทำงานยังไง

เรียกต่อ: get(). คืนค่า: this.nextNodeIndex > 0 ? this.nodes.get(this.nextNodeIndex - 1) : null.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
Node result = instance.getPreviousNode();

net.minecraft.world.level.pathfinder.Path#getTarget()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:162
  • Modifiers: public
  • Return: BlockPos

คืออะไร

อ่านค่า Target

ทำงานยังไง

คืนค่า: this.target.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
BlockPos result = instance.getTarget();

net.minecraft.world.level.pathfinder.Path#isDone()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:37
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Done

ทำงานยังไง

เรียกต่อ: size(). คืนค่า: this.nextNodeIndex >= this.nodes.size().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
boolean result = instance.isDone();

net.minecraft.world.level.pathfinder.Path#notStarted()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:33
  • Modifiers: public
  • Return: boolean

คืออะไร

ดำเนินการ notStarted ตาม implementation ของ Path

ทำงานยังไง

คืนค่า: this.nextNodeIndex <= 0.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
boolean result = instance.notStarted();

net.minecraft.world.level.pathfinder.Path#Path(List<Node>,BlockPos,boolean)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:22
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ Path ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: nodes, target, distToTarget, reached. เรียกต่อ: isEmpty(), get(), size(), distanceManhattan().

Parameters

  • List<Node> list
  • BlockPos blockPos
  • boolean bl

ตัวอย่างใช้งาน

List<Node> list = ...;
BlockPos blockPos = ...;
Path instance = new Path(list, blockPos, true);

net.minecraft.world.level.pathfinder.Path#replaceNode(int,Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:56
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ replaceNode ตาม implementation ของ Path

ทำงานยังไง

เรียกต่อ: set().

Parameters

  • int i
  • Node node

ตัวอย่างใช้งาน

Path instance = ...;
Node node = ...;
instance.replaceNode(0, node);

net.minecraft.world.level.pathfinder.Path#sameAs(Path)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:101
  • Modifiers: public
  • Return: boolean

คืออะไร

ดำเนินการ sameAs ตาม implementation ของ Path

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: size(), get(). มีจุด return อย่างน้อย 4 จุด.

Parameters

  • Path path

ตัวอย่างใช้งาน

Path instance = ...;
Path path = ...;
boolean result = instance.sameAs(path);

net.minecraft.world.level.pathfinder.Path#setNextNodeIndex(int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:68
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Next Node Index

ทำงานยังไง

แก้ state: nextNodeIndex.

Parameters

  • int i

ตัวอย่างใช้งาน

Path instance = ...;
instance.setNextNodeIndex(0);

net.minecraft.world.level.pathfinder.Path#toString()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:157
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ toString ตาม implementation ของ Path

ทำงานยังไง

เรียกต่อ: Path(), size(). คืนค่า: "Path(length=" + this.nodes.size() + ")".

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Path instance = ...;
String result = instance.toString();

net.minecraft.world.level.pathfinder.Path#truncateNodes(int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:50
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ truncateNodes ตาม implementation ของ Path

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: size(), subList(), clear().

Parameters

  • int i

ตัวอย่างใช้งาน

Path instance = ...;
instance.truncateNodes(0);

net.minecraft.world.level.pathfinder.Path#writeToStream(FriendlyByteBuf)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:135
  • Modifiers: public
  • Return: void

คืออะไร

เขียน To Stream

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: isEmpty(), writeBoolean(), writeInt(), writeBlockPos(), writeCollection(), write().

Parameters

  • FriendlyByteBuf friendlyByteBuf

ตัวอย่างใช้งาน

Path instance = ...;
FriendlyByteBuf friendlyByteBuf = ...;
instance.writeToStream(friendlyByteBuf);

Path$DebugData

  • Full name: net.minecraft.world.level.pathfinder.Path$DebugData
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/Path.java
  • Type: record
  • Modifiers: public

net.minecraft.world.level.pathfinder.Path$DebugData#read(FriendlyByteBuf)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:203
  • Modifiers: public static
  • Return: Path.DebugData

คืออะไร

อ่าน read

ทำงานยังไง

เรียกต่อ: readCollection(), readNodeArray(), DebugData(). สร้างออบเจ็กต์: Path.DebugData. คืนค่า: new Path.DebugData(nodes, nodes2, hashSet).

Parameters

  • FriendlyByteBuf friendlyByteBuf

ตัวอย่างใช้งาน

FriendlyByteBuf friendlyByteBuf = ...;
Path.DebugData result = Path.DebugData.read(friendlyByteBuf);

net.minecraft.world.level.pathfinder.Path$DebugData#write(FriendlyByteBuf)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Path.java:197
  • Modifiers: public
  • Return: void

คืออะไร

เขียน write

ทำงานยังไง

เรียกต่อ: writeCollection(), writeToStream(), writeNodeArray().

Parameters

  • FriendlyByteBuf friendlyByteBuf

ตัวอย่างใช้งาน

Path.DebugData instance = ...;
FriendlyByteBuf friendlyByteBuf = ...;
instance.write(friendlyByteBuf);

PathFinder

  • Full name: net.minecraft.world.level.pathfinder.PathFinder
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/PathFinder.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.pathfinder.PathFinder#distance(Node,Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathFinder.java:121
  • Modifiers: protected
  • Return: float

คืออะไร

ดำเนินการ distance ตาม implementation ของ PathFinder

ทำงานยังไง

เรียกต่อ: distanceTo(). คืนค่า: node.distanceTo(node2).

Parameters

  • Node node
  • Node node2

ตัวอย่างใช้งาน

Node node = ...;
Node node2 = ...;
@Override
protected float distance(Node node, Node node2) {
    return super.distance(node, node2);
}

net.minecraft.world.level.pathfinder.PathFinder#findPath(PathNavigationRegion,Mob,Set<BlockPos>,float,int,float)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathFinder.java:38
  • Modifiers: public
  • Return: Path

คืออะไร

ค้นหา Path

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: clear(), prepare(), getStart(), stream(), collect(), toMap(), getTarget(), getX(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • PathNavigationRegion pathNavigationRegion
  • Mob mob
  • Set<BlockPos> set
  • float f
  • int i
  • float g

ตัวอย่างใช้งาน

PathFinder instance = ...;
PathNavigationRegion pathNavigationRegion = ...;
Mob mob = ...;
Set<BlockPos> set = ...;
Path result = instance.findPath(pathNavigationRegion, mob, set, 0.0F, 0, 0.0F);

net.minecraft.world.level.pathfinder.PathFinder#PathFinder(NodeEvaluator,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathFinder.java:29
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ PathFinder ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: nodeEvaluator, maxVisitedNodes.

Parameters

  • NodeEvaluator nodeEvaluator
  • int i

ตัวอย่างใช้งาน

NodeEvaluator nodeEvaluator = ...;
PathFinder instance = new PathFinder(nodeEvaluator, 0);

net.minecraft.world.level.pathfinder.PathFinder#setMaxVisitedNodes(int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathFinder.java:34
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Max Visited Nodes

ทำงานยังไง

แก้ state: maxVisitedNodes.

Parameters

  • int i

ตัวอย่างใช้งาน

PathFinder instance = ...;
instance.setMaxVisitedNodes(0);

PathfindingContext

  • Full name: net.minecraft.world.level.pathfinder.PathfindingContext
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/PathfindingContext.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.pathfinder.PathfindingContext#getBlockState(BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathfindingContext.java:33
  • Modifiers: public
  • Return: BlockState

คืออะไร

อ่านค่า Block State

ทำงานยังไง

คืนค่า: this.level.getBlockState(blockPos).

Parameters

  • BlockPos blockPos

ตัวอย่างใช้งาน

PathfindingContext instance = ...;
BlockPos blockPos = ...;
BlockState result = instance.getBlockState(blockPos);

net.minecraft.world.level.pathfinder.PathfindingContext#getPathTypeFromState(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathfindingContext.java:28
  • Modifiers: public
  • Return: PathType

คืออะไร

อ่านค่า Path Type From State

ทำงานยังไง

แก้ state: cache. เรียกต่อ: set(), getOrCompute(). คืนค่า: this.cache == null ? WalkNodeEvaluator.getPathTypeFromState(this.level, blockPos) : this.cache.getOrCompute(this.level, blockPos).

Parameters

  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

PathfindingContext instance = ...;
PathType result = instance.getPathTypeFromState(0, 0, 0);

net.minecraft.world.level.pathfinder.PathfindingContext#level()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathfindingContext.java:37
  • Modifiers: public
  • Return: CollisionGetter

คืออะไร

ดำเนินการ level ตาม implementation ของ PathfindingContext

ทำงานยังไง

คืนค่า: this.level.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

PathfindingContext instance = ...;
CollisionGetter result = instance.level();

net.minecraft.world.level.pathfinder.PathfindingContext#mobPosition()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathfindingContext.java:41
  • Modifiers: public
  • Return: BlockPos

คืออะไร

ดำเนินการ mobPosition ตาม implementation ของ PathfindingContext

ทำงานยังไง

คืนค่า: this.mobPosition.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

PathfindingContext instance = ...;
BlockPos result = instance.mobPosition();

net.minecraft.world.level.pathfinder.PathfindingContext#PathfindingContext(CollisionGetter,Mob)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathfindingContext.java:17
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ PathfindingContext ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: level, cache, mobPosition. เรียกต่อ: level(), getPathTypeCache(), blockPosition().

Parameters

  • CollisionGetter collisionGetter
  • Mob mob

ตัวอย่างใช้งาน

CollisionGetter collisionGetter = ...;
Mob mob = ...;
PathfindingContext instance = new PathfindingContext(collisionGetter, mob);

PathType

  • Full name: net.minecraft.world.level.pathfinder.PathType
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/PathType.java
  • Type: enum
  • Modifiers: public

net.minecraft.world.level.pathfinder.PathType#getMalus()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathType.java:37
  • Modifiers: public
  • Return: float

คืออะไร

อ่านค่า Malus

ทำงานยังไง

คืนค่า: this.malus.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

PathType instance = ...;
float result = instance.getMalus();

PathTypeCache

  • Full name: net.minecraft.world.level.pathfinder.PathTypeCache
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/PathTypeCache.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.pathfinder.PathTypeCache#getOrCompute(BlockGetter,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathTypeCache.java:14
  • Modifiers: public
  • Return: PathType

คืออะไร

อ่านค่า Or Compute

ทำงานยังไง

เรียกต่อ: asLong(), index(), get(), compute(). คืนค่า: pathType != null ? pathType : this.compute(blockGetter, blockPos, i, l).

Parameters

  • BlockGetter blockGetter
  • BlockPos blockPos

ตัวอย่างใช้งาน

PathTypeCache instance = ...;
BlockGetter blockGetter = ...;
BlockPos blockPos = ...;
PathType result = instance.getOrCompute(blockGetter, blockPos);

net.minecraft.world.level.pathfinder.PathTypeCache#invalidate(BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/PathTypeCache.java:33
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ invalidate ตาม implementation ของ PathTypeCache

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: asLong(), index().

Parameters

  • BlockPos blockPos

ตัวอย่างใช้งาน

PathTypeCache instance = ...;
BlockPos blockPos = ...;
instance.invalidate(blockPos);

SwimNodeEvaluator

  • Full name: net.minecraft.world.level.pathfinder.SwimNodeEvaluator
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/SwimNodeEvaluator.java
  • Type: class
  • Modifiers: public
  • Extends: NodeEvaluator

net.minecraft.world.level.pathfinder.SwimNodeEvaluator#done()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java:31
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ done ตาม implementation ของ SwimNodeEvaluator

ทำงานยังไง

เรียกต่อ: clear().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

SwimNodeEvaluator instance = ...;
instance.done();

net.minecraft.world.level.pathfinder.SwimNodeEvaluator#findAcceptedNode(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java:81
  • Modifiers: protected
  • Return: Node

คืออะไร

ค้นหา Accepted Node

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getCachedBlockType(), getPathfindingMalus(), getNode(), max(), level(), getFluidState(), isEmpty(). สร้างออบเจ็กต์: BlockPos. คืนค่า: node.

Parameters

  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

@Override
protected Node findAcceptedNode(int i, int j, int k) {
    return super.findAcceptedNode(i, j, k);
}

net.minecraft.world.level.pathfinder.SwimNodeEvaluator#getCachedBlockType(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java:100
  • Modifiers: protected
  • Return: PathType

คืออะไร

อ่านค่า Cached Block Type

ทำงานยังไง

เรียกต่อ: computeIfAbsent(), asLong(), getPathType(). คืนค่า: this.pathTypesByPosCache.computeIfAbsent(BlockPos.asLong(i, j, k), l -> this.getPathType(this.currentContext, i, j, k)).

Parameters

  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

@Override
protected PathType getCachedBlockType(int i, int j, int k) {
    return super.getCachedBlockType(i, j, k);
}

net.minecraft.world.level.pathfinder.SwimNodeEvaluator#getNeighbors(Node[],Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java:47
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Neighbors

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: newEnumMap(), values(), findAcceptedNode(), getStepX(), getStepY(), getStepZ(), put(), isNodeValid(). คืนค่า: i.

Parameters

  • Node[] nodes
  • Node node

ตัวอย่างใช้งาน

SwimNodeEvaluator instance = ...;
Node[] nodes = ...;
Node node = ...;
int result = instance.getNeighbors(nodes, node);

net.minecraft.world.level.pathfinder.SwimNodeEvaluator#getPathType(PathfindingContext,int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java:104
  • Modifiers: public
  • Return: PathType

คืออะไร

อ่านค่า Path Type

ทำงานยังไง

เรียกต่อ: getPathTypeOfMob(). คืนค่า: this.getPathTypeOfMob(pathfindingContext, i, j, k, this.mob).

Parameters

  • PathfindingContext pathfindingContext
  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

SwimNodeEvaluator instance = ...;
PathfindingContext pathfindingContext = ...;
PathType result = instance.getPathType(pathfindingContext, 0, 0, 0);

net.minecraft.world.level.pathfinder.SwimNodeEvaluator#getPathTypeOfMob(PathfindingContext,int,int,int,Mob)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java:109
  • Modifiers: public
  • Return: PathType

คืออะไร

อ่านค่า Path Type Of Mob

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: MutableBlockPos(), getBlockState(), set(), getFluidState(), isEmpty(), isPathfindable(), isAir(), is(). สร้างออบเจ็กต์: BlockPos.MutableBlockPos. มีจุด return อย่างน้อย 3 จุด.

Parameters

  • PathfindingContext pathfindingContext
  • int i
  • int j
  • int k
  • Mob mob

ตัวอย่างใช้งาน

SwimNodeEvaluator instance = ...;
PathfindingContext pathfindingContext = ...;
Mob mob = ...;
PathType result = instance.getPathTypeOfMob(pathfindingContext, 0, 0, 0, mob);

net.minecraft.world.level.pathfinder.SwimNodeEvaluator#getStart()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java:37
  • Modifiers: public
  • Return: Node

คืออะไร

อ่านค่า Start

ทำงานยังไง

เรียกต่อ: getNode(), floor(), getBoundingBox(). คืนค่า: this.getNode(Mth.floor(this.mob.getBoundingBox().minX), Mth.floor(this.mob.getBoundingBox().minY + 0.5), Mth.floor(this.mob.getBoundingBox().minZ)).

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

SwimNodeEvaluator instance = ...;
Node result = instance.getStart();

net.minecraft.world.level.pathfinder.SwimNodeEvaluator#getTarget(double,double,double)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java:42
  • Modifiers: public
  • Return: Target

คืออะไร

อ่านค่า Target

ทำงานยังไง

เรียกต่อ: getTargetNodeAt(). คืนค่า: this.getTargetNodeAt(d, e, f).

Parameters

  • double d
  • double e
  • double f

ตัวอย่างใช้งาน

SwimNodeEvaluator instance = ...;
Target result = instance.getTarget(0.0D, 0.0D, 0.0D);

net.minecraft.world.level.pathfinder.SwimNodeEvaluator#isNodeValid(Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java:73
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Node Valid

ทำงานยังไง

คืนค่า: node != null && !node.closed.

Parameters

  • Node node

ตัวอย่างใช้งาน

Node node = ...;
@Override
protected boolean isNodeValid(Node node) {
    return super.isNodeValid(node);
}

net.minecraft.world.level.pathfinder.SwimNodeEvaluator#prepare(PathNavigationRegion,Mob)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java:25
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ prepare ตาม implementation ของ SwimNodeEvaluator

ทำงานยังไง

เรียกต่อ: clear().

Parameters

  • PathNavigationRegion pathNavigationRegion
  • Mob mob

ตัวอย่างใช้งาน

SwimNodeEvaluator instance = ...;
PathNavigationRegion pathNavigationRegion = ...;
Mob mob = ...;
instance.prepare(pathNavigationRegion, mob);

net.minecraft.world.level.pathfinder.SwimNodeEvaluator#SwimNodeEvaluator(boolean)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java:21
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ SwimNodeEvaluator ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

แก้ state: allowBreaching.

Parameters

  • boolean bl

ตัวอย่างใช้งาน

SwimNodeEvaluator instance = new SwimNodeEvaluator(true);

Target

  • Full name: net.minecraft.world.level.pathfinder.Target
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/Target.java
  • Type: class
  • Modifiers: public
  • Extends: Node

net.minecraft.world.level.pathfinder.Target#createFromStream(FriendlyByteBuf)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Target.java:37
  • Modifiers: public static
  • Return: Target

คืออะไร

สร้าง From Stream

ทำงานยังไง

เรียกต่อ: readInt(), readContents(). สร้างออบเจ็กต์: Target. คืนค่า: target.

Parameters

  • FriendlyByteBuf friendlyByteBuf

ตัวอย่างใช้งาน

FriendlyByteBuf friendlyByteBuf = ...;
Target result = Target.createFromStream(friendlyByteBuf);

net.minecraft.world.level.pathfinder.Target#getBestNode()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Target.java:25
  • Modifiers: public
  • Return: Node

คืออะไร

อ่านค่า Best Node

ทำงานยังไง

คืนค่า: this.bestNode.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Target instance = ...;
Node result = instance.getBestNode();

net.minecraft.world.level.pathfinder.Target#isReached()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Target.java:33
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Reached

ทำงานยังไง

คืนค่า: this.reached.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Target instance = ...;
boolean result = instance.isReached();

net.minecraft.world.level.pathfinder.Target#setReached()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Target.java:29
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Reached

ทำงานยังไง

แก้ state: reached.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

Target instance = ...;
instance.setReached();

net.minecraft.world.level.pathfinder.Target#Target(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Target.java:14
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ Target ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

Target instance = new Target(0, 0, 0);

net.minecraft.world.level.pathfinder.Target#Target(Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Target.java:10
  • Modifiers: public
  • Kind: constructor

คืออะไร

สร้างออบเจ็กต์ Target ด้วยพารามิเตอร์ที่ระบุ

ทำงานยังไง

ทำงานตาม body โดยตรง (ประมาณ 1 statement).

Parameters

  • Node node

ตัวอย่างใช้งาน

Node node = ...;
Target instance = new Target(node);

net.minecraft.world.level.pathfinder.Target#updateBest(float,Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/Target.java:18
  • Modifiers: public
  • Return: void

คืออะไร

อัปเดต Best

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: bestHeuristic, bestNode.

Parameters

  • float f
  • Node node

ตัวอย่างใช้งาน

Target instance = ...;
Node node = ...;
instance.updateBest(0.0F, node);

WalkNodeEvaluator

  • Full name: net.minecraft.world.level.pathfinder.WalkNodeEvaluator
  • Package: net.minecraft.world.level.pathfinder
  • Source: commonnet/minecraft/world/level/pathfinder/WalkNodeEvaluator.java
  • Type: class
  • Modifiers: public
  • Extends: NodeEvaluator

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#canStartAt(BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:110
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Start At

ทำงานยังไง

เรียกต่อ: getCachedPathType(), getX(), getY(), getZ(), getPathfindingMalus(). คืนค่า: pathType != PathType.OPEN && this.mob.getPathfindingMalus(pathType) >= 0.0F.

Parameters

  • BlockPos blockPos

ตัวอย่างใช้งาน

BlockPos blockPos = ...;
@Override
protected boolean canStartAt(BlockPos blockPos) {
    return super.canStartAt(blockPos);
}

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#checkNeighbourBlocks(PathfindingContext,int,int,int,PathType)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:453
  • Modifiers: public static
  • Return: PathType

คืออะไร

ตรวจสอบ Neighbour Blocks

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getPathTypeFromState(). มีจุด return อย่างน้อย 5 จุด.

Parameters

  • PathfindingContext pathfindingContext
  • int i
  • int j
  • int k
  • PathType pathType

ตัวอย่างใช้งาน

PathfindingContext pathfindingContext = ...;
PathType pathType = ...;
PathType result = WalkNodeEvaluator.checkNeighbourBlocks(pathfindingContext, 0, 0, 0, pathType);

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#done()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:44
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ done ตาม implementation ของ WalkNodeEvaluator

ทำงานยังไง

เรียกต่อ: onPathfindingDone(), clear().

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

WalkNodeEvaluator instance = ...;
instance.done();

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#findAcceptedNode(int,int,int,int,double,Direction,PathType)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:217
  • Modifiers: protected
  • Return: Node

คืออะไร

ค้นหา Accepted Node

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: MutableBlockPos(), getFloorLevel(), set(), getMobJumpHeight(), getCachedPathType(), getPathfindingMalus(), getNodeAndUpdateCostToMax(), doesBlockHavePartialCollision(). สร้างออบเจ็กต์: BlockPos.MutableBlockPos. มีจุด return อย่างน้อย 3 จุด.

Parameters

  • int i
  • int j
  • int k
  • int l
  • double d
  • Direction direction
  • PathType pathType

ตัวอย่างใช้งาน

Direction direction = ...;
PathType pathType = ...;
@Override
protected Node findAcceptedNode(int i, int j, int k, int l, double d, Direction direction, PathType pathType) {
    return super.findAcceptedNode(i, j, k, l, d, direction, pathType);
}

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getCachedPathType(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:354
  • Modifiers: protected
  • Return: PathType

คืออะไร

อ่านค่า Cached Path Type

ทำงานยังไง

เรียกต่อ: computeIfAbsent(), asLong(), getPathTypeOfMob(). คืนค่า: this.pathTypesByPosCacheByMob.computeIfAbsent(BlockPos.asLong(i, j, k), l -> this.getPathTypeOfMob(this.currentContext, i, j, k, this.mob)).

Parameters

  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

@Override
protected PathType getCachedPathType(int i, int j, int k) {
    return super.getCachedPathType(i, j, k);
}

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getFloorLevel(BlockGetter,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:207
  • Modifiers: public static
  • Return: double

คืออะไร

อ่านค่า Floor Level

ทำงานยังไง

เรียกต่อ: below(), getBlockState(), getCollisionShape(), getY(), isEmpty(), max(). คืนค่า: blockPos2.getY() + (voxelShape.isEmpty() ? 0.0 : voxelShape.max(Direction.Axis.Y)).

Parameters

  • BlockGetter blockGetter
  • BlockPos blockPos

ตัวอย่างใช้งาน

BlockGetter blockGetter = ...;
BlockPos blockPos = ...;
double result = WalkNodeEvaluator.getFloorLevel(blockGetter, blockPos);

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getFloorLevel(BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:200
  • Modifiers: protected
  • Return: double

คืออะไร

อ่านค่า Floor Level

ทำงานยังไง

เรียกต่อ: level(), canFloat(), isAmphibious(), getFluidState(), is(), getY().

Parameters

  • BlockPos blockPos

ตัวอย่างใช้งาน

BlockPos blockPos = ...;
@Override
protected double getFloorLevel(BlockPos blockPos) {
    return super.getFloorLevel(blockPos);
}

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getNeighbors(Node[],Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:120
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Neighbors

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getCachedPathType(), getPathfindingMalus(), floor(), max(), maxUpStep(), getFloorLevel(), findAcceptedNode(), getStepX(). สร้างออบเจ็กต์: BlockPos. คืนค่า: i.

Parameters

  • Node[] nodes
  • Node node

ตัวอย่างใช้งาน

WalkNodeEvaluator instance = ...;
Node[] nodes = ...;
Node node = ...;
int result = instance.getNeighbors(nodes, node);

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getPathType(PathfindingContext,int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:423
  • Modifiers: public
  • Return: PathType

คืออะไร

อ่านค่า Path Type

ทำงานยังไง

เรียกต่อ: getPathTypeStatic(), MutableBlockPos(). สร้างออบเจ็กต์: BlockPos.MutableBlockPos. คืนค่า: getPathTypeStatic(pathfindingContext, new BlockPos.MutableBlockPos(i, j, k)).

Parameters

  • PathfindingContext pathfindingContext
  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

WalkNodeEvaluator instance = ...;
PathfindingContext pathfindingContext = ...;
PathType result = instance.getPathType(pathfindingContext, 0, 0, 0);

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getPathTypeFromState(BlockGetter,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:482
  • Modifiers: protected static
  • Return: PathType

คืออะไร

อ่านค่า Path Type From State

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBlockState(), getBlock(), isAir(), is(), getFluidState(), isBurningBlock(), getValue(), type(). มีจุด return อย่างน้อย 16 จุด.

Parameters

  • BlockGetter blockGetter
  • BlockPos blockPos

ตัวอย่างใช้งาน

BlockGetter blockGetter = ...;
BlockPos blockPos = ...;
@Override
protected PathType getPathTypeFromState(BlockGetter blockGetter, BlockPos blockPos) {
    return super.getPathTypeFromState(blockGetter, blockPos);
}

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getPathTypeOfMob(PathfindingContext,int,int,int,Mob)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:358
  • Modifiers: public
  • Return: PathType

คืออะไร

อ่านค่า Path Type Of Mob

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getPathTypeWithinMobBB(), contains(), getPathfindingMalus(), getPathType(). มีจุด return อย่างน้อย 3 จุด.

Parameters

  • PathfindingContext pathfindingContext
  • int i
  • int j
  • int k
  • Mob mob

ตัวอย่างใช้งาน

WalkNodeEvaluator instance = ...;
PathfindingContext pathfindingContext = ...;
Mob mob = ...;
PathType result = instance.getPathTypeOfMob(pathfindingContext, 0, 0, 0, mob);

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getPathTypeStatic(Mob,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:428
  • Modifiers: public static
  • Return: PathType

คืออะไร

อ่านค่า Path Type Static

ทำงานยังไง

เรียกต่อ: level(), mutable(). สร้างออบเจ็กต์: PathfindingContext. คืนค่า: getPathTypeStatic(new PathfindingContext(mob.level(), mob), blockPos.mutable()).

Parameters

  • Mob mob
  • BlockPos blockPos

ตัวอย่างใช้งาน

Mob mob = ...;
BlockPos blockPos = ...;
PathType result = WalkNodeEvaluator.getPathTypeStatic(mob, blockPos);

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getPathTypeStatic(PathfindingContext,BlockPos.MutableBlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:432
  • Modifiers: public static
  • Return: PathType

คืออะไร

อ่านค่า Path Type Static

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; แยกกรณีด้วย switch. เรียกต่อ: getX(), getY(), getZ(), getPathTypeFromState(), level(), getMinY(), checkNeighbourBlocks(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • PathfindingContext pathfindingContext
  • BlockPos.MutableBlockPos mutableBlockPos

ตัวอย่างใช้งาน

PathfindingContext pathfindingContext = ...;
BlockPos.MutableBlockPos mutableBlockPos = ...;
PathType result = WalkNodeEvaluator.getPathTypeStatic(pathfindingContext, mutableBlockPos);

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getPathTypeWithinMobBB(PathfindingContext,int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:389
  • Modifiers: public
  • Return: Set<PathType>

คืออะไร

อ่านค่า Path Type Within Mob BB

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: noneOf(), getPathType(), blockPosition(), canPassDoors(), canOpenDoors(), getX(), getY(), getZ(). คืนค่า: enumSet.

Parameters

  • PathfindingContext pathfindingContext
  • int i
  • int j
  • int k

ตัวอย่างใช้งาน

WalkNodeEvaluator instance = ...;
PathfindingContext pathfindingContext = ...;
Set<PathType> result = instance.getPathTypeWithinMobBB(pathfindingContext, 0, 0, 0);

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getStart()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:52
  • Modifiers: public
  • Return: Node

คืออะไร

อ่านค่า Start

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: MutableBlockPos(), getBlockY(), getBlockState(), set(), getX(), getZ(), canStandOnFluid(), getFluidState(). สร้างออบเจ็กต์: BlockPos.MutableBlockPos, BlockPos. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

WalkNodeEvaluator instance = ...;
Node result = instance.getStart();

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getStartNode(BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:103
  • Modifiers: protected
  • Return: Node

คืออะไร

อ่านค่า Start Node

ทำงานยังไง

เรียกต่อ: getNode(), getCachedPathType(), getPathfindingMalus(). คืนค่า: node.

Parameters

  • BlockPos blockPos

ตัวอย่างใช้งาน

BlockPos blockPos = ...;
@Override
protected Node getStartNode(BlockPos blockPos) {
    return super.getStartNode(blockPos);
}

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#getTarget(double,double,double)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:115
  • Modifiers: public
  • Return: Target

คืออะไร

อ่านค่า Target

ทำงานยังไง

เรียกต่อ: getTargetNodeAt(). คืนค่า: this.getTargetNodeAt(d, e, f).

Parameters

  • double d
  • double e
  • double f

ตัวอย่างใช้งาน

WalkNodeEvaluator instance = ...;
Target result = instance.getTarget(0.0D, 0.0D, 0.0D);

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#isAmphibious()

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:213
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Amphibious

ทำงานยังไง

คืนค่า: false.

Parameters

  • ไม่มี

ตัวอย่างใช้งาน

@Override
protected boolean isAmphibious() {
    return super.isAmphibious();
}

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#isDiagonalValid(Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:170
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Diagonal Valid

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • Node node

ตัวอย่างใช้งาน

Node node = ...;
@Override
protected boolean isDiagonalValid(Node node) {
    return super.isDiagonalValid(node);
}

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#isDiagonalValid(Node,Node,Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:159
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Diagonal Valid

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getBbWidth(). มีจุด return อย่างน้อย 3 จุด.

Parameters

  • Node node
  • Node node2
  • Node node3

ตัวอย่างใช้งาน

Node node = ...;
Node node2 = ...;
Node node3 = ...;
@Override
protected boolean isDiagonalValid(Node node, Node node2, Node node3) {
    return super.isDiagonalValid(node, node2, node3);
}

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#isNeighborValid(Node,Node)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:155
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Neighbor Valid

ทำงานยังไง

คืนค่า: node != null && !node.closed && (node.costMalus >= 0.0F || node2.costMalus < 0.0F).

Parameters

  • Node node
  • Node node2

ตัวอย่างใช้งาน

Node node = ...;
Node node2 = ...;
@Override
protected boolean isNeighborValid(Node node, Node node2) {
    return super.isNeighborValid(node, node2);
}

net.minecraft.world.level.pathfinder.WalkNodeEvaluator#prepare(PathNavigationRegion,Mob)

  • Origin: common
  • Source: net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java:38
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ prepare ตาม implementation ของ WalkNodeEvaluator

ทำงานยังไง

เรียกต่อ: onPathfindingStart().

Parameters

  • PathNavigationRegion pathNavigationRegion
  • Mob mob

ตัวอย่างใช้งาน

WalkNodeEvaluator instance = ...;
PathNavigationRegion pathNavigationRegion = ...;
Mob mob = ...;
instance.prepare(pathNavigationRegion, mob);