Skip to content

Package net.minecraft.world.level.portal

Part 1/1


PortalForcer

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

net.minecraft.world.level.portal.PortalForcer#createPortal(BlockPos,Direction.Axis)

  • Origin: common
  • Source: net/minecraft/world/level/portal/PortalForcer.java:52
  • Modifiers: public
  • Return: Optional<BlockUtil.FoundRectangle>

คืออะไร

สร้าง Portal

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: get(), getWorldBorder(), min(), getMaxY(), getMinY(), getLogicalHeight(), mutable(), spiralAround(). สร้างออบเจ็กต์: BlockPos, BlockUtil.FoundRectangle. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • BlockPos blockPos
  • Direction.Axis axis

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

PortalForcer instance = ...;
BlockPos blockPos = ...;
Direction.Axis axis = ...;
Optional<BlockUtil.FoundRectangle> result = instance.createPortal(blockPos, axis);

net.minecraft.world.level.portal.PortalForcer#findClosestPortalPosition(BlockPos,boolean,WorldBorder)

  • Origin: common
  • Source: net/minecraft/world/level/portal/PortalForcer.java:41
  • Modifiers: public
  • Return: Optional<BlockPos>

คืออะไร

ค้นหา Closest Portal Position

ทำงานยังไง

เรียกต่อ: getPoiManager(), ensureLoadedAndValid(), getInSquare(), is(), map(), filter(), getBlockState(), hasProperty().

Parameters

  • BlockPos blockPos
  • boolean bl
  • WorldBorder worldBorder

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

PortalForcer instance = ...;
BlockPos blockPos = ...;
WorldBorder worldBorder = ...;
Optional<BlockPos> result = instance.findClosestPortalPosition(blockPos, true, worldBorder);

net.minecraft.world.level.portal.PortalForcer#PortalForcer(ServerLevel)

  • Origin: common
  • Source: net/minecraft/world/level/portal/PortalForcer.java:37
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: level.

Parameters

  • ServerLevel serverLevel

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

ServerLevel serverLevel = ...;
PortalForcer instance = new PortalForcer(serverLevel);

PortalShape

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

net.minecraft.world.level.portal.PortalShape#createPortalBlocks(LevelAccessor)

  • Origin: common
  • Source: net/minecraft/world/level/portal/PortalShape.java:176
  • Modifiers: public
  • Return: void

คืออะไร

สร้าง Portal Blocks

ทำงานยังไง

เรียกต่อ: defaultBlockState(), setValue(), betweenClosed(), relative(), forEach(), setBlock().

Parameters

  • LevelAccessor levelAccessor

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

PortalShape instance = ...;
LevelAccessor levelAccessor = ...;
instance.createPortalBlocks(levelAccessor);

net.minecraft.world.level.portal.PortalShape#findAnyShape(BlockGetter,BlockPos,Direction.Axis)

  • Origin: common
  • Source: net/minecraft/world/level/portal/PortalShape.java:64
  • Modifiers: public static
  • Return: PortalShape

คืออะไร

ค้นหา Any Shape

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: calculateBottomLeft(), calculateWidth(), calculateHeight(), getValue(). สร้างออบเจ็กต์: PortalShape, MutableInt. มีจุด return อย่างน้อย 3 จุด.

Parameters

  • BlockGetter blockGetter
  • BlockPos blockPos
  • Direction.Axis axis

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

BlockGetter blockGetter = ...;
BlockPos blockPos = ...;
Direction.Axis axis = ...;
PortalShape result = PortalShape.findAnyShape(blockGetter, blockPos, axis);

net.minecraft.world.level.portal.PortalShape#findCollisionFreePosition(Vec3,ServerLevel,Entity,EntityDimensions)

  • Origin: common
  • Source: net/minecraft/world/level/portal/PortalShape.java:211
  • Modifiers: public static
  • Return: Vec3

คืออะไร

ค้นหา Collision Free Position

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: width(), height(), add(), create(), ofSize(), expandTowards(), inflate(), findFreePosition(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • Vec3 vec3
  • ServerLevel serverLevel
  • Entity entity
  • EntityDimensions entityDimensions

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

Vec3 vec3 = ...;
ServerLevel serverLevel = ...;
Entity entity = ...;
EntityDimensions entityDimensions = ...;
Vec3 result = PortalShape.findCollisionFreePosition(vec3, serverLevel, entity, entityDimensions);

net.minecraft.world.level.portal.PortalShape#findEmptyPortalShape(LevelAccessor,BlockPos,Direction.Axis)

  • Origin: common
  • Source: net/minecraft/world/level/portal/PortalShape.java:50
  • Modifiers: public static
  • Return: Optional<PortalShape>

คืออะไร

ค้นหา Empty Portal Shape

ทำงานยังไง

เรียกต่อ: findPortalShape(), isValid(). คืนค่า: findPortalShape(levelAccessor, blockPos, portalShape -> portalShape.isValid() && portalShape.numPortalBlocks == 0, axis).

Parameters

  • LevelAccessor levelAccessor
  • BlockPos blockPos
  • Direction.Axis axis

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

LevelAccessor levelAccessor = ...;
BlockPos blockPos = ...;
Direction.Axis axis = ...;
Optional<PortalShape> result = PortalShape.findEmptyPortalShape(levelAccessor, blockPos, axis);

net.minecraft.world.level.portal.PortalShape#findPortalShape(LevelAccessor,BlockPos,Predicate<PortalShape>,Direction.Axis)

  • Origin: common
  • Source: net/minecraft/world/level/portal/PortalShape.java:54
  • Modifiers: public static
  • Return: Optional<PortalShape>

คืออะไร

ค้นหา Portal Shape

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: of(), findAnyShape(), filter(), isPresent(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • LevelAccessor levelAccessor
  • BlockPos blockPos
  • Predicate<PortalShape> predicate
  • Direction.Axis axis

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

LevelAccessor levelAccessor = ...;
BlockPos blockPos = ...;
Predicate<PortalShape> predicate = ...;
Direction.Axis axis = ...;
Optional<PortalShape> result = PortalShape.findPortalShape(levelAccessor, blockPos, predicate, axis);

net.minecraft.world.level.portal.PortalShape#getRelativePosition(BlockUtil.FoundRectangle,Direction.Axis,Vec3,EntityDimensions)

  • Origin: common
  • Source: net/minecraft/world/level/portal/PortalShape.java:186
  • Modifiers: public static
  • Return: Vec3

คืออะไร

อ่านค่า Relative Position

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: width(), height(), get(), clamp(), inverseLerp(). สร้างออบเจ็กต์: Vec3. คืนค่า: new Vec3(g, f, h).

Parameters

  • BlockUtil.FoundRectangle foundRectangle
  • Direction.Axis axis
  • Vec3 vec3
  • EntityDimensions entityDimensions

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

BlockUtil.FoundRectangle foundRectangle = ...;
Direction.Axis axis = ...;
Vec3 vec3 = ...;
EntityDimensions entityDimensions = ...;
Vec3 result = PortalShape.getRelativePosition(foundRectangle, axis, vec3, entityDimensions);

net.minecraft.world.level.portal.PortalShape#isComplete()

  • Origin: common
  • Source: net/minecraft/world/level/portal/PortalShape.java:182
  • Modifiers: public
  • Return: boolean

คืออะไร

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

ทำงานยังไง

แก้ state: numPortalBlocks. เรียกต่อ: isValid(). คืนค่า: this.isValid() && this.numPortalBlocks == this.width * this.height.

Parameters

  • ไม่มี

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

PortalShape instance = ...;
boolean result = instance.isComplete();

net.minecraft.world.level.portal.PortalShape#isValid()

  • Origin: common
  • Source: net/minecraft/world/level/portal/PortalShape.java:172
  • Modifiers: public
  • Return: boolean

คืออะไร

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

ทำงานยังไง

คืนค่า: this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21.

Parameters

  • ไม่มี

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

PortalShape instance = ...;
boolean result = instance.isValid();

TeleportTransition

  • Full name: net.minecraft.world.level.portal.TeleportTransition
  • Package: net.minecraft.world.level.portal
  • Source: commonnet/minecraft/world/level/portal/TeleportTransition.java
  • Type: record
  • Modifiers: public

net.minecraft.world.level.portal.TeleportTransition#missingRespawnBlock(ServerLevel,Entity,TeleportTransition.PostTeleportTransition)

  • Origin: common
  • Source: net/minecraft/world/level/portal/TeleportTransition.java:51
  • Modifiers: public static
  • Return: TeleportTransition

คืออะไร

ดำเนินการ missingRespawnBlock ตาม implementation ของ TeleportTransition

ทำงานยังไง

เรียกต่อ: findAdjustedSharedSpawnPos(), of(). สร้างออบเจ็กต์: TeleportTransition.

Parameters

  • ServerLevel serverLevel
  • Entity entity
  • TeleportTransition.PostTeleportTransition postTeleportTransition

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

ServerLevel serverLevel = ...;
Entity entity = ...;
TeleportTransition.PostTeleportTransition postTeleportTransition = ...;
TeleportTransition result = TeleportTransition.missingRespawnBlock(serverLevel, entity, postTeleportTransition);

net.minecraft.world.level.portal.TeleportTransition#TeleportTransition(ServerLevel,Entity,TeleportTransition.PostTeleportTransition)

  • Origin: common
  • Source: net/minecraft/world/level/portal/TeleportTransition.java:37
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

เรียกต่อ: findAdjustedSharedSpawnPos(), of().

Parameters

  • ServerLevel serverLevel
  • Entity entity
  • TeleportTransition.PostTeleportTransition postTeleportTransition

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

ServerLevel serverLevel = ...;
Entity entity = ...;
TeleportTransition.PostTeleportTransition postTeleportTransition = ...;
TeleportTransition instance = new TeleportTransition(serverLevel, entity, postTeleportTransition);

net.minecraft.world.level.portal.TeleportTransition#TeleportTransition(ServerLevel,Vec3,Vec3,float,float,Set<Relative>,TeleportTransition.PostTeleportTransition)

  • Origin: common
  • Source: net/minecraft/world/level/portal/TeleportTransition.java:31
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

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

Parameters

  • ServerLevel serverLevel
  • Vec3 vec3
  • Vec3 vec32
  • float f
  • float g
  • Set<Relative> set
  • TeleportTransition.PostTeleportTransition postTeleportTransition

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

ServerLevel serverLevel = ...;
Vec3 vec3 = ...;
Vec3 vec32 = ...;
Set<Relative> set = ...;
TeleportTransition.PostTeleportTransition postTeleportTransition = ...;
TeleportTransition instance = new TeleportTransition(serverLevel, vec3, vec32, 0.0F, 0.0F, set, postTeleportTransition);

net.minecraft.world.level.portal.TeleportTransition#TeleportTransition(ServerLevel,Vec3,Vec3,float,float,TeleportTransition.PostTeleportTransition)

  • Origin: common
  • Source: net/minecraft/world/level/portal/TeleportTransition.java:27
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

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

Parameters

  • ServerLevel serverLevel
  • Vec3 vec3
  • Vec3 vec32
  • float f
  • float g
  • TeleportTransition.PostTeleportTransition postTeleportTransition

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

ServerLevel serverLevel = ...;
Vec3 vec3 = ...;
Vec3 vec32 = ...;
TeleportTransition.PostTeleportTransition postTeleportTransition = ...;
TeleportTransition instance = new TeleportTransition(serverLevel, vec3, vec32, 0.0F, 0.0F, postTeleportTransition);

net.minecraft.world.level.portal.TeleportTransition#transitionAsPassenger()

  • Origin: common
  • Source: net/minecraft/world/level/portal/TeleportTransition.java:89
  • Modifiers: public
  • Return: TeleportTransition

คืออะไร

ดำเนินการ transitionAsPassenger ตาม implementation ของ TeleportTransition

ทำงานยังไง

เรียกต่อ: newLevel(), position(), deltaMovement(), yRot(), xRot(), missingRespawnBlock(), relatives(), postTeleportTransition(). สร้างออบเจ็กต์: TeleportTransition.

Parameters

  • ไม่มี

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

TeleportTransition instance = ...;
TeleportTransition result = instance.transitionAsPassenger();

net.minecraft.world.level.portal.TeleportTransition#withPosition(Vec3)

  • Origin: common
  • Source: net/minecraft/world/level/portal/TeleportTransition.java:75
  • Modifiers: public
  • Return: TeleportTransition

คืออะไร

ดำเนินการ withPosition ตาม implementation ของ TeleportTransition

ทำงานยังไง

เรียกต่อ: newLevel(), deltaMovement(), yRot(), xRot(), missingRespawnBlock(), asPassenger(), relatives(), postTeleportTransition(). สร้างออบเจ็กต์: TeleportTransition.

Parameters

  • Vec3 vec3

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

TeleportTransition instance = ...;
Vec3 vec3 = ...;
TeleportTransition result = instance.withPosition(vec3);

net.minecraft.world.level.portal.TeleportTransition#withRotation(float,float)

  • Origin: common
  • Source: net/minecraft/world/level/portal/TeleportTransition.java:61
  • Modifiers: public
  • Return: TeleportTransition

คืออะไร

ดำเนินการ withRotation ตาม implementation ของ TeleportTransition

ทำงานยังไง

เรียกต่อ: newLevel(), position(), deltaMovement(), missingRespawnBlock(), asPassenger(), relatives(), postTeleportTransition(). สร้างออบเจ็กต์: TeleportTransition.

Parameters

  • float f
  • float g

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

TeleportTransition instance = ...;
TeleportTransition result = instance.withRotation(0.0F, 0.0F);

TeleportTransition$PostTeleportTransition

  • Full name: net.minecraft.world.level.portal.TeleportTransition$PostTeleportTransition
  • Package: net.minecraft.world.level.portal
  • Source: commonnet/minecraft/world/level/portal/TeleportTransition.java
  • Type: interface
  • Modifiers: public

net.minecraft.world.level.portal.TeleportTransition$PostTeleportTransition#onTransition(Entity)

  • Origin: common
  • Source: net/minecraft/world/level/portal/TeleportTransition.java:105
  • Modifiers: ``
  • Return: void

คืออะไร

จัดการเหตุการณ์ Transition

ทำงานยังไง

ไม่มี body ใน source declaration นี้

Parameters

  • Entity entity

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

TeleportTransition.PostTeleportTransition instance = ...;
Entity entity = ...;
instance.onTransition(entity);

net.minecraft.world.level.portal.TeleportTransition$PostTeleportTransition#then(TeleportTransition.PostTeleportTransition)

  • Origin: common
  • Source: net/minecraft/world/level/portal/TeleportTransition.java:107
  • Modifiers: default
  • Return: TeleportTransition.PostTeleportTransition

คืออะไร

ดำเนินการ then ตาม implementation ของ TeleportTransition$PostTeleportTransition

ทำงานยังไง

เรียกต่อ: onTransition(). คืนค่า: entity -> { this.onTransition(entity).

Parameters

  • TeleportTransition.PostTeleportTransition postTeleportTransition

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

TeleportTransition.PostTeleportTransition instance = ...;
TeleportTransition.PostTeleportTransition postTeleportTransition = ...;
TeleportTransition.PostTeleportTransition result = instance.then(postTeleportTransition);