Skip to content

Package net.minecraft.world.level.block.state.pattern

Part 1/1


BlockInWorld

  • Full name: net.minecraft.world.level.block.state.pattern.BlockInWorld
  • Package: net.minecraft.world.level.block.state.pattern
  • Source: commonnet/minecraft/world/level/block/state/pattern/BlockInWorld.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.block.state.pattern.BlockInWorld#BlockInWorld(LevelReader,BlockPos,boolean)

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockInWorld.java:20
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: level, pos, loadChunks. เรียกต่อ: immutable().

Parameters

  • LevelReader levelReader
  • BlockPos blockPos
  • boolean bl

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

LevelReader levelReader = ...;
BlockPos blockPos = ...;
BlockInWorld instance = new BlockInWorld(levelReader, blockPos, true);

net.minecraft.world.level.block.state.pattern.BlockInWorld#getEntity()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockInWorld.java:34
  • Modifiers: public
  • Return: BlockEntity

คืออะไร

อ่านค่า Entity

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: entity, cachedEntity. เรียกต่อ: getBlockEntity(). คืนค่า: this.entity.

Parameters

  • ไม่มี

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

BlockInWorld instance = ...;
BlockEntity result = instance.getEntity();

net.minecraft.world.level.block.state.pattern.BlockInWorld#getLevel()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockInWorld.java:44
  • Modifiers: public
  • Return: LevelReader

คืออะไร

อ่านค่า Level

ทำงานยังไง

คืนค่า: this.level.

Parameters

  • ไม่มี

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

BlockInWorld instance = ...;
LevelReader result = instance.getLevel();

net.minecraft.world.level.block.state.pattern.BlockInWorld#getPos()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockInWorld.java:48
  • Modifiers: public
  • Return: BlockPos

คืออะไร

อ่านค่า Pos

ทำงานยังไง

คืนค่า: this.pos.

Parameters

  • ไม่มี

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

BlockInWorld instance = ...;
BlockPos result = instance.getPos();

net.minecraft.world.level.block.state.pattern.BlockInWorld#getState()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockInWorld.java:26
  • Modifiers: public
  • Return: BlockState

คืออะไร

อ่านค่า State

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: state. เรียกต่อ: hasChunkAt(), getBlockState(). คืนค่า: this.state.

Parameters

  • ไม่มี

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

BlockInWorld instance = ...;
BlockState result = instance.getState();

net.minecraft.world.level.block.state.pattern.BlockInWorld#hasState(Predicate<BlockState>)

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockInWorld.java:52
  • Modifiers: public static
  • Return: Predicate<BlockInWorld>

คืออะไร

ตรวจสอบว่ามี State

ทำงานยังไง

เรียกต่อ: test(), getState(). คืนค่า: blockInWorld -> blockInWorld != null && predicate.test(blockInWorld.getState()).

Parameters

  • Predicate<BlockState> predicate

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

Predicate<BlockState> predicate = ...;
Predicate<BlockInWorld> result = BlockInWorld.hasState(predicate);

BlockPattern

  • Full name: net.minecraft.world.level.block.state.pattern.BlockPattern
  • Package: net.minecraft.world.level.block.state.pattern
  • Source: commonnet/minecraft/world/level/block/state/pattern/BlockPattern.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.block.state.pattern.BlockPattern#BlockPattern(Predicate<BlockInWorld>[][][])

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:21
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. แก้ state: pattern, depth, height, width.

Parameters

  • Predicate<BlockInWorld>[][][] predicates

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

Predicate<BlockInWorld>[][][] predicates = ...;
BlockPattern instance = new BlockPattern(predicates);

net.minecraft.world.level.block.state.pattern.BlockPattern#createLevelCache(LevelReader,boolean)

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:97
  • Modifiers: public static
  • Return: LoadingCache<BlockPos, BlockInWorld>

คืออะไร

สร้าง Level Cache

ทำงานยังไง

เรียกต่อ: newBuilder(), build(), BlockCacheLoader(). สร้างออบเจ็กต์: BlockPattern.BlockCacheLoader. คืนค่า: CacheBuilder.newBuilder().build(new BlockPattern.BlockCacheLoader(levelReader, bl)).

Parameters

  • LevelReader levelReader
  • boolean bl

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

LevelReader levelReader = ...;
LoadingCache<BlockPos, BlockInWorld> result = BlockPattern.createLevelCache(levelReader, true);

net.minecraft.world.level.block.state.pattern.BlockPattern#find(LevelReader,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:76
  • Modifiers: public
  • Return: BlockPattern.BlockPatternMatch

คืออะไร

ค้นหา find

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: createLevelCache(), max(), betweenClosed(), offset(), values(), getOpposite(), matches(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • LevelReader levelReader
  • BlockPos blockPos

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

BlockPattern instance = ...;
LevelReader levelReader = ...;
BlockPos blockPos = ...;
BlockPattern.BlockPatternMatch result = instance.find(levelReader, blockPos);

net.minecraft.world.level.block.state.pattern.BlockPattern#getDepth()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:37
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Depth

ทำงานยังไง

คืนค่า: this.depth.

Parameters

  • ไม่มี

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

BlockPattern instance = ...;
int result = instance.getDepth();

net.minecraft.world.level.block.state.pattern.BlockPattern#getHeight()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:41
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Height

ทำงานยังไง

คืนค่า: this.height.

Parameters

  • ไม่มี

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

BlockPattern instance = ...;
int result = instance.getHeight();

net.minecraft.world.level.block.state.pattern.BlockPattern#getPattern()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:49
  • Modifiers: public
  • Return: Predicate<BlockInWorld>[][][]

คืออะไร

อ่านค่า Pattern

ทำงานยังไง

คืนค่า: this.pattern.

Parameters

  • ไม่มี

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

BlockPattern instance = ...;
Predicate<BlockInWorld>[][][] result = instance.getPattern();

net.minecraft.world.level.block.state.pattern.BlockPattern#getWidth()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:45
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Width

ทำงานยังไง

คืนค่า: this.width.

Parameters

  • ไม่มี

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

BlockPattern instance = ...;
int result = instance.getWidth();

net.minecraft.world.level.block.state.pattern.BlockPattern#matches(LevelReader,BlockPos,Direction,Direction)

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:54
  • Modifiers: public
  • Return: BlockPattern.BlockPatternMatch

คืออะไร

ดำเนินการ matches ตาม implementation ของ BlockPattern

ทำงานยังไง

เรียกต่อ: createLevelCache(). คืนค่า: this.matches(blockPos, direction, direction2, loadingCache).

Parameters

  • LevelReader levelReader
  • BlockPos blockPos
  • Direction direction
  • Direction direction2

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

BlockPattern instance = ...;
LevelReader levelReader = ...;
BlockPos blockPos = ...;
Direction direction = ...;
Direction direction2 = ...;
BlockPattern.BlockPatternMatch result = instance.matches(levelReader, blockPos, direction, direction2);

net.minecraft.world.level.block.state.pattern.BlockPattern#translateAndRotate(BlockPos,Direction,Direction,int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:101
  • Modifiers: protected static
  • Return: BlockPos

คืออะไร

ดำเนินการ translateAndRotate ตาม implementation ของ BlockPattern

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getOpposite(), getStepX(), getStepY(), getStepZ(), cross(), offset(), getX(), getY(). สร้างออบเจ็กต์: Vec3i, IllegalArgumentException.

Parameters

  • BlockPos blockPos
  • Direction direction
  • Direction direction2
  • int i
  • int j
  • int k

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

BlockPos blockPos = ...;
Direction direction = ...;
Direction direction2 = ...;
@Override
protected BlockPos translateAndRotate(BlockPos blockPos, Direction direction, Direction direction2, int i, int j, int k) {
    return super.translateAndRotate(blockPos, direction, direction2, i, j, k);
}

BlockPattern$BlockPatternMatch

  • Full name: net.minecraft.world.level.block.state.pattern.BlockPattern$BlockPatternMatch
  • Package: net.minecraft.world.level.block.state.pattern
  • Source: commonnet/minecraft/world/level/block/state/pattern/BlockPattern.java
  • Type: class
  • Modifiers: public static

net.minecraft.world.level.block.state.pattern.BlockPattern$BlockPatternMatch#BlockPatternMatch(BlockPos,Direction,Direction,LoadingCache<BlockPos, BlockInWorld>,int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:139
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: frontTopLeft, forwards, up, cache, width, height.

Parameters

  • BlockPos blockPos
  • Direction direction
  • Direction direction2
  • LoadingCache<BlockPos, BlockInWorld> loadingCache
  • int i
  • int j
  • int k

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

BlockPos blockPos = ...;
Direction direction = ...;
Direction direction2 = ...;
LoadingCache<BlockPos, BlockInWorld> loadingCache = ...;
BlockPattern.BlockPatternMatch instance = new BlockPattern.BlockPatternMatch(blockPos, direction, direction2, loadingCache, 0, 0, 0);

net.minecraft.world.level.block.state.pattern.BlockPattern$BlockPatternMatch#getBlock(int,int,int)

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:173
  • Modifiers: public
  • Return: BlockInWorld

คืออะไร

อ่านค่า Block

ทำงานยังไง

เรียกต่อ: getUnchecked(), translateAndRotate(), getForwards(), getUp(). คืนค่า: this.cache.getUnchecked(BlockPattern.translateAndRotate(this.frontTopLeft, this.getForwards(), this.getUp(), i, j, k)).

Parameters

  • int i
  • int j
  • int k

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

BlockPattern.BlockPatternMatch instance = ...;
BlockInWorld result = instance.getBlock(0, 0, 0);

net.minecraft.world.level.block.state.pattern.BlockPattern$BlockPatternMatch#getDepth()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:169
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Depth

ทำงานยังไง

คืนค่า: this.depth.

Parameters

  • ไม่มี

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

BlockPattern.BlockPatternMatch instance = ...;
int result = instance.getDepth();

net.minecraft.world.level.block.state.pattern.BlockPattern$BlockPatternMatch#getForwards()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:153
  • Modifiers: public
  • Return: Direction

คืออะไร

อ่านค่า Forwards

ทำงานยังไง

คืนค่า: this.forwards.

Parameters

  • ไม่มี

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

BlockPattern.BlockPatternMatch instance = ...;
Direction result = instance.getForwards();

net.minecraft.world.level.block.state.pattern.BlockPattern$BlockPatternMatch#getFrontTopLeft()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:149
  • Modifiers: public
  • Return: BlockPos

คืออะไร

อ่านค่า Front Top Left

ทำงานยังไง

คืนค่า: this.frontTopLeft.

Parameters

  • ไม่มี

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

BlockPattern.BlockPatternMatch instance = ...;
BlockPos result = instance.getFrontTopLeft();

net.minecraft.world.level.block.state.pattern.BlockPattern$BlockPatternMatch#getHeight()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:165
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Height

ทำงานยังไง

คืนค่า: this.height.

Parameters

  • ไม่มี

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

BlockPattern.BlockPatternMatch instance = ...;
int result = instance.getHeight();

net.minecraft.world.level.block.state.pattern.BlockPattern$BlockPatternMatch#getUp()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:157
  • Modifiers: public
  • Return: Direction

คืออะไร

อ่านค่า Up

ทำงานยังไง

คืนค่า: this.up.

Parameters

  • ไม่มี

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

BlockPattern.BlockPatternMatch instance = ...;
Direction result = instance.getUp();

net.minecraft.world.level.block.state.pattern.BlockPattern$BlockPatternMatch#getWidth()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:161
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Width

ทำงานยังไง

คืนค่า: this.width.

Parameters

  • ไม่มี

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

BlockPattern.BlockPatternMatch instance = ...;
int result = instance.getWidth();

net.minecraft.world.level.block.state.pattern.BlockPattern$BlockPatternMatch#toString()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPattern.java:177
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ toString ตาม implementation ของ BlockPattern$BlockPatternMatch

ทำงานยังไง

เรียกต่อ: toStringHelper(), add(). คืนค่า: MoreObjects.toStringHelper(this).add("up", this.up).add("forwards", this.forwards).add("frontTopLeft", this.frontTopLeft).toString().

Parameters

  • ไม่มี

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

BlockPattern.BlockPatternMatch instance = ...;
String result = instance.toString();

BlockPatternBuilder

  • Full name: net.minecraft.world.level.block.state.pattern.BlockPatternBuilder
  • Package: net.minecraft.world.level.block.state.pattern
  • Source: commonnet/minecraft/world/level/block/state/pattern/BlockPatternBuilder.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.block.state.pattern.BlockPatternBuilder#aisle(String[])

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPatternBuilder.java:25
  • Modifiers: public
  • Return: BlockPatternBuilder

คืออะไร

ดำเนินการ aisle ตาม implementation ของ BlockPatternBuilder

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. แก้ state: height, width. เรียกต่อ: isEmpty(), length(), width(), toCharArray(), containsKey(), put(), add(). สร้างออบเจ็กต์: IllegalArgumentException. คืนค่า: this.

Parameters

  • String[] strings

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

BlockPatternBuilder instance = ...;
String[] strings = ...;
BlockPatternBuilder result = instance.aisle(strings);

net.minecraft.world.level.block.state.pattern.BlockPatternBuilder#build()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPatternBuilder.java:66
  • Modifiers: public
  • Return: BlockPattern

คืออะไร

สร้าง build

ทำงานยังไง

เรียกต่อ: createPattern(). สร้างออบเจ็กต์: BlockPattern. คืนค่า: new BlockPattern(this.createPattern()).

Parameters

  • ไม่มี

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

BlockPatternBuilder instance = ...;
BlockPattern result = instance.build();

net.minecraft.world.level.block.state.pattern.BlockPatternBuilder#start()

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPatternBuilder.java:57
  • Modifiers: public static
  • Return: BlockPatternBuilder

คืออะไร

เริ่ม start

ทำงานยังไง

สร้างออบเจ็กต์: BlockPatternBuilder. คืนค่า: new BlockPatternBuilder().

Parameters

  • ไม่มี

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

BlockPatternBuilder result = BlockPatternBuilder.start();

net.minecraft.world.level.block.state.pattern.BlockPatternBuilder#where(char,Predicate<BlockInWorld>)

  • Origin: common
  • Source: net/minecraft/world/level/block/state/pattern/BlockPatternBuilder.java:61
  • Modifiers: public
  • Return: BlockPatternBuilder

คืออะไร

ดำเนินการ where ตาม implementation ของ BlockPatternBuilder

ทำงานยังไง

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

Parameters

  • char c
  • Predicate<BlockInWorld> predicate

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

BlockPatternBuilder instance = ...;
Predicate<BlockInWorld> predicate = ...;
BlockPatternBuilder result = instance.where('a', predicate);