Skip to content

Package net.minecraft.world.level.levelgen.feature.rootplacers

Part 1/1


MangroveRootPlacer

  • Full name: net.minecraft.world.level.levelgen.feature.rootplacers.MangroveRootPlacer
  • Package: net.minecraft.world.level.levelgen.feature.rootplacers
  • Source: commonnet/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer.java
  • Type: class
  • Modifiers: public
  • Extends: RootPlacer

net.minecraft.world.level.levelgen.feature.rootplacers.MangroveRootPlacer#canPlaceRoot(LevelSimulatedReader,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer.java:112
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Place Root

ทำงานยังไง

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

Parameters

  • LevelSimulatedReader levelSimulatedReader
  • BlockPos blockPos

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

LevelSimulatedReader levelSimulatedReader = ...;
BlockPos blockPos = ...;
@Override
protected boolean canPlaceRoot(LevelSimulatedReader levelSimulatedReader, BlockPos blockPos) {
    return super.canPlaceRoot(levelSimulatedReader, blockPos);
}

net.minecraft.world.level.levelgen.feature.rootplacers.MangroveRootPlacer#MangroveRootPlacer(IntProvider,BlockStateProvider,Optional<AboveRootPlacement>,MangroveRootPlacement)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer.java:28
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: mangroveRootPlacement.

Parameters

  • IntProvider intProvider
  • BlockStateProvider blockStateProvider
  • Optional<AboveRootPlacement> optional
  • MangroveRootPlacement mangroveRootPlacement

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

IntProvider intProvider = ...;
BlockStateProvider blockStateProvider = ...;
Optional<AboveRootPlacement> optional = ...;
MangroveRootPlacement mangroveRootPlacement = ...;
MangroveRootPlacer instance = new MangroveRootPlacer(intProvider, blockStateProvider, optional, mangroveRootPlacement);

net.minecraft.world.level.levelgen.feature.rootplacers.MangroveRootPlacer#placeRoot(LevelSimulatedReader,BiConsumer<BlockPos, BlockState>,RandomSource,BlockPos,TreeConfiguration)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer.java:118
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ placeRoot ตาม implementation ของ MangroveRootPlacer

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: isStateAtPosition(), is(), muddyRootsIn(), muddyRootsProvider(), getState(), accept(), getPotentiallyWaterloggedState().

Parameters

  • LevelSimulatedReader levelSimulatedReader
  • BiConsumer<BlockPos, BlockState> biConsumer
  • RandomSource randomSource
  • BlockPos blockPos
  • TreeConfiguration treeConfiguration

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

LevelSimulatedReader levelSimulatedReader = ...;
BiConsumer<BlockPos, BlockState> biConsumer = ...;
RandomSource randomSource = ...;
BlockPos blockPos = ...;
TreeConfiguration treeConfiguration = ...;
@Override
protected void placeRoot(LevelSimulatedReader levelSimulatedReader, BiConsumer<BlockPos, BlockState> biConsumer, RandomSource randomSource, BlockPos blockPos, TreeConfiguration treeConfiguration) {
    super.placeRoot(levelSimulatedReader, biConsumer, randomSource, blockPos, treeConfiguration);
}

net.minecraft.world.level.levelgen.feature.rootplacers.MangroveRootPlacer#placeRoots(LevelSimulatedReader,BiConsumer<BlockPos, BlockState>,RandomSource,BlockPos,BlockPos,TreeConfiguration)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer.java:35
  • Modifiers: public
  • Return: boolean

คืออะไร

ดำเนินการ placeRoots ตาม implementation ของ MangroveRootPlacer

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: newArrayList(), mutable(), getY(), canPlaceRoot(), move(), add(), below(), relative(). มีจุด return อย่างน้อย 3 จุด.

Parameters

  • LevelSimulatedReader levelSimulatedReader
  • BiConsumer<BlockPos, BlockState> biConsumer
  • RandomSource randomSource
  • BlockPos blockPos
  • BlockPos blockPos2
  • TreeConfiguration treeConfiguration

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

MangroveRootPlacer instance = ...;
LevelSimulatedReader levelSimulatedReader = ...;
BiConsumer<BlockPos, BlockState> biConsumer = ...;
RandomSource randomSource = ...;
BlockPos blockPos = ...;
BlockPos blockPos2 = ...;
TreeConfiguration treeConfiguration = ...;
boolean result = instance.placeRoots(levelSimulatedReader, biConsumer, randomSource, blockPos, blockPos2, treeConfiguration);

net.minecraft.world.level.levelgen.feature.rootplacers.MangroveRootPlacer#potentialRootPositions(BlockPos,Direction,RandomSource,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer.java:95
  • Modifiers: protected
  • Return: List<BlockPos>

คืออะไร

ดำเนินการ potentialRootPositions ตาม implementation ของ MangroveRootPlacer

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: below(), relative(), distManhattan(), maxRootWidth(), randomSkewChance(), nextFloat(), of(), nextBoolean(). มีจุด return อย่างน้อย 4 จุด.

Parameters

  • BlockPos blockPos
  • Direction direction
  • RandomSource randomSource
  • BlockPos blockPos2

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

BlockPos blockPos = ...;
Direction direction = ...;
RandomSource randomSource = ...;
BlockPos blockPos2 = ...;
@Override
protected List<BlockPos> potentialRootPositions(BlockPos blockPos, Direction direction, RandomSource randomSource, BlockPos blockPos2) {
    return super.potentialRootPositions(blockPos, direction, randomSource, blockPos2);
}

net.minecraft.world.level.levelgen.feature.rootplacers.MangroveRootPlacer#type()

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer.java:134
  • Modifiers: protected
  • Return: RootPlacerType<?>

คืออะไร

ดำเนินการ type ตาม implementation ของ MangroveRootPlacer

ทำงานยังไง

คืนค่า: RootPlacerType.MANGROVE_ROOT_PLACER.

Parameters

  • ไม่มี

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

@Override
protected RootPlacerType<?> type() {
    return super.type();
}

RootPlacer

  • Full name: net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacer
  • Package: net.minecraft.world.level.levelgen.feature.rootplacers
  • Source: commonnet/minecraft/world/level/levelgen/feature/rootplacers/RootPlacer.java
  • Type: class
  • Modifiers: public abstract

net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacer#canPlaceRoot(LevelSimulatedReader,BlockPos)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacer.java:53
  • Modifiers: protected
  • Return: boolean

คืออะไร

ตรวจสอบว่าสามารถ Place Root

ทำงานยังไง

เรียกต่อ: validTreePos(). คืนค่า: TreeFeature.validTreePos(levelSimulatedReader, blockPos).

Parameters

  • LevelSimulatedReader levelSimulatedReader
  • BlockPos blockPos

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

LevelSimulatedReader levelSimulatedReader = ...;
BlockPos blockPos = ...;
@Override
protected boolean canPlaceRoot(LevelSimulatedReader levelSimulatedReader, BlockPos blockPos) {
    return super.canPlaceRoot(levelSimulatedReader, blockPos);
}

net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacer#getPotentiallyWaterloggedState(LevelSimulatedReader,BlockPos,BlockState)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacer.java:79
  • Modifiers: protected
  • Return: BlockState

คืออะไร

อ่านค่า Potentially Waterlogged State

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: hasProperty(), isFluidAtPosition(), is(), setValue(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • LevelSimulatedReader levelSimulatedReader
  • BlockPos blockPos
  • BlockState blockState

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

LevelSimulatedReader levelSimulatedReader = ...;
BlockPos blockPos = ...;
BlockState blockState = ...;
@Override
protected BlockState getPotentiallyWaterloggedState(LevelSimulatedReader levelSimulatedReader, BlockPos blockPos, BlockState blockState) {
    return super.getPotentiallyWaterloggedState(levelSimulatedReader, blockPos, blockState);
}

net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacer#getTrunkOrigin(BlockPos,RandomSource)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacer.java:88
  • Modifiers: public
  • Return: BlockPos

คืออะไร

อ่านค่า Trunk Origin

ทำงานยังไง

เรียกต่อ: above(), sample(). คืนค่า: blockPos.above(this.trunkOffsetY.sample(randomSource)).

Parameters

  • BlockPos blockPos
  • RandomSource randomSource

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

RootPlacer instance = ...;
BlockPos blockPos = ...;
RandomSource randomSource = ...;
BlockPos result = instance.getTrunkOrigin(blockPos, randomSource);

net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacer#placeRoot(LevelSimulatedReader,BiConsumer<BlockPos, BlockState>,RandomSource,BlockPos,TreeConfiguration)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacer.java:57
  • Modifiers: protected
  • Return: void

คืออะไร

ดำเนินการ placeRoot ตาม implementation ของ RootPlacer

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: canPlaceRoot(), accept(), getPotentiallyWaterloggedState(), getState(), isPresent(), get(), above(), nextFloat().

Parameters

  • LevelSimulatedReader levelSimulatedReader
  • BiConsumer<BlockPos, BlockState> biConsumer
  • RandomSource randomSource
  • BlockPos blockPos
  • TreeConfiguration treeConfiguration

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

LevelSimulatedReader levelSimulatedReader = ...;
BiConsumer<BlockPos, BlockState> biConsumer = ...;
RandomSource randomSource = ...;
BlockPos blockPos = ...;
TreeConfiguration treeConfiguration = ...;
@Override
protected void placeRoot(LevelSimulatedReader levelSimulatedReader, BiConsumer<BlockPos, BlockState> biConsumer, RandomSource randomSource, BlockPos blockPos, TreeConfiguration treeConfiguration) {
    super.placeRoot(levelSimulatedReader, biConsumer, randomSource, blockPos, treeConfiguration);
}

net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacer#placeRoots(LevelSimulatedReader,BiConsumer<BlockPos, BlockState>,RandomSource,BlockPos,BlockPos,TreeConfiguration)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacer.java:44
  • Modifiers: public abstract
  • Return: boolean

คืออะไร

ดำเนินการ placeRoots ตาม implementation ของ RootPlacer

ทำงานยังไง

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

Parameters

  • LevelSimulatedReader levelSimulatedReader
  • BiConsumer<BlockPos, BlockState> biConsumer
  • RandomSource randomSource
  • BlockPos blockPos
  • BlockPos blockPos2
  • TreeConfiguration treeConfiguration

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

RootPlacer instance = ...;
LevelSimulatedReader levelSimulatedReader = ...;
BiConsumer<BlockPos, BlockState> biConsumer = ...;
RandomSource randomSource = ...;
BlockPos blockPos = ...;
BlockPos blockPos2 = ...;
TreeConfiguration treeConfiguration = ...;
boolean result = instance.placeRoots(levelSimulatedReader, biConsumer, randomSource, blockPos, blockPos2, treeConfiguration);

net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacer#RootPlacer(IntProvider,BlockStateProvider,Optional<AboveRootPlacement>)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacer.java:36
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: trunkOffsetY, rootProvider, aboveRootPlacement.

Parameters

  • IntProvider intProvider
  • BlockStateProvider blockStateProvider
  • Optional<AboveRootPlacement> optional

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

IntProvider intProvider = ...;
BlockStateProvider blockStateProvider = ...;
Optional<AboveRootPlacement> optional = ...;
RootPlacer instance = new RootPlacer(intProvider, blockStateProvider, optional);

net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacer#rootPlacerParts(Instance<P>)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacer.java:28
  • Modifiers: protected static
  • Return: P3<Mu<P>, IntProvider, BlockStateProvider, Optional<AboveRootPlacement>>

คืออะไร

ดำเนินการ rootPlacerParts ตาม implementation ของ RootPlacer

ทำงานยังไง

เรียกต่อ: group(), fieldOf(), forGetter(), optionalFieldOf().

Parameters

  • Instance<P> instance

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

Instance<P> instance = ...;
@Override
protected P3<Mu<P>, IntProvider, BlockStateProvider, Optional<AboveRootPlacement>> rootPlacerParts(Instance<P> instance) {
    return super.rootPlacerParts(instance);
}

net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacer#type()

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacer.java:42
  • Modifiers: protected abstract
  • Return: RootPlacerType<?>

คืออะไร

ดำเนินการ type ตาม implementation ของ RootPlacer

ทำงานยังไง

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

Parameters

  • ไม่มี

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

@Override
protected RootPlacerType<?> type() {
    return super.type();
}

RootPlacerType

  • Full name: net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacerType
  • Package: net.minecraft.world.level.levelgen.feature.rootplacers
  • Source: commonnet/minecraft/world/level/levelgen/feature/rootplacers/RootPlacerType.java
  • Type: class
  • Modifiers: public

net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacerType#codec()

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacerType.java:19
  • Modifiers: public
  • Return: MapCodec<P>

คืออะไร

ดำเนินการ codec ตาม implementation ของ RootPlacerType

ทำงานยังไง

คืนค่า: this.codec.

Parameters

  • ไม่มี

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

RootPlacerType instance = ...;
MapCodec<P> result = instance.codec();

net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacerType#RootPlacerType(MapCodec<P>)

  • Origin: common
  • Source: net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacerType.java:15
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: codec.

Parameters

  • MapCodec<P> mapCodec

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

MapCodec<P> mapCodec = ...;
RootPlacerType instance = new RootPlacerType(mapCodec);