Skip to content

Package net.minecraft.commands.arguments.blocks

Part 1/1


BlockInput

  • Full name: net.minecraft.commands.arguments.blocks.BlockInput
  • Package: net.minecraft.commands.arguments.blocks
  • Source: commonnet/minecraft/commands/arguments/blocks/BlockInput.java
  • Type: class
  • Modifiers: public
  • Implements: Predicate<BlockInWorld>

net.minecraft.commands.arguments.blocks.BlockInput#BlockInput(BlockState,Set<Property<?>>,CompoundTag)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockInput.java:22
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: state, properties, tag.

Parameters

  • BlockState blockState
  • Set<Property<?>> set
  • CompoundTag compoundTag

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

BlockState blockState = ...;
Set<Property<?>> set = ...;
CompoundTag compoundTag = ...;
BlockInput instance = new BlockInput(blockState, set, compoundTag);

net.minecraft.commands.arguments.blocks.BlockInput#getDefinedProperties()

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockInput.java:32
  • Modifiers: public
  • Return: Set<Property<?>>

คืออะไร

อ่านค่า Defined Properties

ทำงานยังไง

คืนค่า: this.properties.

Parameters

  • ไม่มี

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

BlockInput instance = ...;
Set<Property<?>> result = instance.getDefinedProperties();

net.minecraft.commands.arguments.blocks.BlockInput#getState()

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockInput.java:28
  • Modifiers: public
  • Return: BlockState

คืออะไร

อ่านค่า State

ทำงานยังไง

คืนค่า: this.state.

Parameters

  • ไม่มี

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

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

net.minecraft.commands.arguments.blocks.BlockInput#place(ServerLevel,BlockPos,int)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockInput.java:60
  • Modifiers: public
  • Return: boolean

คืออะไร

ดำเนินการ place ตาม implementation ของ BlockInput

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: updateFromNeighbourShapes(), isAir(), overwriteWithDefinedProperties(), setBlock(), getBlockEntity(), loadWithComponents(), registryAccess(). มีจุด return อย่างน้อย 2 จุด.

Parameters

  • ServerLevel serverLevel
  • BlockPos blockPos
  • int i

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

BlockInput instance = ...;
ServerLevel serverLevel = ...;
BlockPos blockPos = ...;
boolean result = instance.place(serverLevel, blockPos, 0);

net.minecraft.commands.arguments.blocks.BlockInput#test(BlockInWorld)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockInput.java:36
  • Modifiers: public
  • Return: boolean

คืออะไร

ทดสอบเงื่อนไข test

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. แก้ state: tag. เรียกต่อ: getState(), is(), getBlock(), getValue(), getEntity(), compareNbt(), saveWithFullMetadata(), getLevel(). มีจุด return อย่างน้อย 4 จุด.

Parameters

  • BlockInWorld blockInWorld

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

BlockInput instance = ...;
BlockInWorld blockInWorld = ...;
boolean result = instance.test(blockInWorld);

net.minecraft.commands.arguments.blocks.BlockInput#test(ServerLevel,BlockPos)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockInput.java:56
  • Modifiers: public
  • Return: boolean

คืออะไร

ทดสอบเงื่อนไข test

ทำงานยังไง

สร้างออบเจ็กต์: BlockInWorld. คืนค่า: this.test(new BlockInWorld(serverLevel, blockPos, false)).

Parameters

  • ServerLevel serverLevel
  • BlockPos blockPos

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

BlockInput instance = ...;
ServerLevel serverLevel = ...;
BlockPos blockPos = ...;
boolean result = instance.test(serverLevel, blockPos);

BlockPredicateArgument

  • Full name: net.minecraft.commands.arguments.blocks.BlockPredicateArgument
  • Package: net.minecraft.commands.arguments.blocks
  • Source: commonnet/minecraft/commands/arguments/blocks/BlockPredicateArgument.java
  • Type: class
  • Modifiers: public
  • Implements: ArgumentType<BlockPredicateArgument.Result>

net.minecraft.commands.arguments.blocks.BlockPredicateArgument#blockPredicate(CommandBuildContext)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockPredicateArgument.java:38
  • Modifiers: public static
  • Return: BlockPredicateArgument

คืออะไร

ดำเนินการ blockPredicate ตาม implementation ของ BlockPredicateArgument

ทำงานยังไง

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

Parameters

  • CommandBuildContext commandBuildContext

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

CommandBuildContext commandBuildContext = ...;
BlockPredicateArgument result = BlockPredicateArgument.blockPredicate(commandBuildContext);

net.minecraft.commands.arguments.blocks.BlockPredicateArgument#BlockPredicateArgument(CommandBuildContext)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockPredicateArgument.java:34
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: blocks. เรียกต่อ: lookupOrThrow().

Parameters

  • CommandBuildContext commandBuildContext

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

CommandBuildContext commandBuildContext = ...;
BlockPredicateArgument instance = new BlockPredicateArgument(commandBuildContext);

net.minecraft.commands.arguments.blocks.BlockPredicateArgument#getBlockPredicate(CommandContext<CommandSourceStack>,String)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockPredicateArgument.java:54
  • Modifiers: public static
  • Return: Predicate<BlockInWorld>

คืออะไร

อ่านค่า Block Predicate

ทำงานยังไง

เรียกต่อ: getArgument(). คืนค่า: commandContext.getArgument(string, BlockPredicateArgument.Result.class).

Parameters

  • CommandContext<CommandSourceStack> commandContext
  • String string

Throws

  • CommandSyntaxException

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

CommandContext<CommandSourceStack> commandContext = ...;
Predicate<BlockInWorld> result = BlockPredicateArgument.getBlockPredicate(commandContext, "value");

net.minecraft.commands.arguments.blocks.BlockPredicateArgument#getExamples()

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockPredicateArgument.java:63
  • Modifiers: public
  • Return: Collection<String>

คืออะไร

อ่านค่า Examples

ทำงานยังไง

คืนค่า: EXAMPLES.

Parameters

  • ไม่มี

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

BlockPredicateArgument instance = ...;
Collection<String> result = instance.getExamples();

net.minecraft.commands.arguments.blocks.BlockPredicateArgument#listSuggestions(CommandContext<S>,SuggestionsBuilder)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockPredicateArgument.java:58
  • Modifiers: public
  • Return: CompletableFuture<Suggestions>

คืออะไร

ดำเนินการ listSuggestions ตาม implementation ของ BlockPredicateArgument

ทำงานยังไง

เรียกต่อ: fillSuggestions(). คืนค่า: BlockStateParser.fillSuggestions(this.blocks, suggestionsBuilder, true, true).

Parameters

  • CommandContext<S> commandContext
  • SuggestionsBuilder suggestionsBuilder

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

BlockPredicateArgument instance = ...;
CommandContext<S> commandContext = ...;
SuggestionsBuilder suggestionsBuilder = ...;
CompletableFuture<Suggestions> result = instance.listSuggestions(commandContext, suggestionsBuilder);

net.minecraft.commands.arguments.blocks.BlockPredicateArgument#parse(HolderLookup<Block>,StringReader)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockPredicateArgument.java:46
  • Modifiers: public static
  • Return: BlockPredicateArgument.Result

คืออะไร

แปลง/วิเคราะห์ข้อมูล parse

ทำงานยังไง

เรียกต่อ: parseForTesting(), map(), BlockPredicate(), blockState(), properties(), keySet(), nbt(), TagPredicate(). สร้างออบเจ็กต์: BlockPredicateArgument.BlockPredicate, BlockPredicateArgument.TagPredicate.

Parameters

  • HolderLookup<Block> holderLookup
  • StringReader stringReader

Throws

  • CommandSyntaxException

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

HolderLookup<Block> holderLookup = ...;
StringReader stringReader = ...;
BlockPredicateArgument.Result result = BlockPredicateArgument.parse(holderLookup, stringReader);

net.minecraft.commands.arguments.blocks.BlockPredicateArgument#parse(StringReader)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockPredicateArgument.java:42
  • Modifiers: public
  • Return: BlockPredicateArgument.Result

คืออะไร

แปลง/วิเคราะห์ข้อมูล parse

ทำงานยังไง

คืนค่า: parse(this.blocks, stringReader).

Parameters

  • StringReader stringReader

Throws

  • CommandSyntaxException

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

BlockPredicateArgument instance = ...;
StringReader stringReader = ...;
BlockPredicateArgument.Result result = instance.parse(stringReader);

BlockPredicateArgument$Result

  • Full name: net.minecraft.commands.arguments.blocks.BlockPredicateArgument$Result
  • Package: net.minecraft.commands.arguments.blocks
  • Source: commonnet/minecraft/commands/arguments/blocks/BlockPredicateArgument.java
  • Type: interface
  • Modifiers: public
  • Implements: Predicate<BlockInWorld>

net.minecraft.commands.arguments.blocks.BlockPredicateArgument$Result#requiresNbt()

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockPredicateArgument.java:107
  • Modifiers: ``
  • Return: boolean

คืออะไร

ดำเนินการ requiresNbt ตาม implementation ของ BlockPredicateArgument$Result

ทำงานยังไง

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

Parameters

  • ไม่มี

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

BlockPredicateArgument.Result instance = ...;
boolean result = instance.requiresNbt();

BlockStateArgument

  • Full name: net.minecraft.commands.arguments.blocks.BlockStateArgument
  • Package: net.minecraft.commands.arguments.blocks
  • Source: commonnet/minecraft/commands/arguments/blocks/BlockStateArgument.java
  • Type: class
  • Modifiers: public
  • Implements: ArgumentType<BlockInput>

net.minecraft.commands.arguments.blocks.BlockStateArgument#block(CommandBuildContext)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateArgument.java:26
  • Modifiers: public static
  • Return: BlockStateArgument

คืออะไร

ดำเนินการ block ตาม implementation ของ BlockStateArgument

ทำงานยังไง

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

Parameters

  • CommandBuildContext commandBuildContext

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

CommandBuildContext commandBuildContext = ...;
BlockStateArgument result = BlockStateArgument.block(commandBuildContext);

net.minecraft.commands.arguments.blocks.BlockStateArgument#BlockStateArgument(CommandBuildContext)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateArgument.java:22
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: blocks. เรียกต่อ: lookupOrThrow().

Parameters

  • CommandBuildContext commandBuildContext

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

CommandBuildContext commandBuildContext = ...;
BlockStateArgument instance = new BlockStateArgument(commandBuildContext);

net.minecraft.commands.arguments.blocks.BlockStateArgument#getBlock(CommandContext<CommandSourceStack>,String)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateArgument.java:35
  • Modifiers: public static
  • Return: BlockInput

คืออะไร

อ่านค่า Block

ทำงานยังไง

เรียกต่อ: getArgument(). คืนค่า: commandContext.getArgument(string, BlockInput.class).

Parameters

  • CommandContext<CommandSourceStack> commandContext
  • String string

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

CommandContext<CommandSourceStack> commandContext = ...;
BlockInput result = BlockStateArgument.getBlock(commandContext, "value");

net.minecraft.commands.arguments.blocks.BlockStateArgument#getExamples()

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateArgument.java:44
  • Modifiers: public
  • Return: Collection<String>

คืออะไร

อ่านค่า Examples

ทำงานยังไง

คืนค่า: EXAMPLES.

Parameters

  • ไม่มี

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

BlockStateArgument instance = ...;
Collection<String> result = instance.getExamples();

net.minecraft.commands.arguments.blocks.BlockStateArgument#listSuggestions(CommandContext<S>,SuggestionsBuilder)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateArgument.java:39
  • Modifiers: public
  • Return: CompletableFuture<Suggestions>

คืออะไร

ดำเนินการ listSuggestions ตาม implementation ของ BlockStateArgument

ทำงานยังไง

เรียกต่อ: fillSuggestions(). คืนค่า: BlockStateParser.fillSuggestions(this.blocks, suggestionsBuilder, false, true).

Parameters

  • CommandContext<S> commandContext
  • SuggestionsBuilder suggestionsBuilder

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

BlockStateArgument instance = ...;
CommandContext<S> commandContext = ...;
SuggestionsBuilder suggestionsBuilder = ...;
CompletableFuture<Suggestions> result = instance.listSuggestions(commandContext, suggestionsBuilder);

net.minecraft.commands.arguments.blocks.BlockStateArgument#parse(StringReader)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateArgument.java:30
  • Modifiers: public
  • Return: BlockInput

คืออะไร

แปลง/วิเคราะห์ข้อมูล parse

ทำงานยังไง

เรียกต่อ: parseForBlock(), blockState(), properties(), keySet(), nbt(). สร้างออบเจ็กต์: BlockInput. คืนค่า: new BlockInput(blockResult.blockState(), blockResult.properties().keySet(), blockResult.nbt()).

Parameters

  • StringReader stringReader

Throws

  • CommandSyntaxException

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

BlockStateArgument instance = ...;
StringReader stringReader = ...;
BlockInput result = instance.parse(stringReader);

BlockStateParser

  • Full name: net.minecraft.commands.arguments.blocks.BlockStateParser
  • Package: net.minecraft.commands.arguments.blocks
  • Source: commonnet/minecraft/commands/arguments/blocks/BlockStateParser.java
  • Type: class
  • Modifiers: public

net.minecraft.commands.arguments.blocks.BlockStateParser#fillSuggestions(HolderLookup<Block>,SuggestionsBuilder,boolean,boolean)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateParser.java:128
  • Modifiers: public static
  • Return: CompletableFuture<Suggestions>

คืออะไร

ดำเนินการ fillSuggestions ตาม implementation ของ BlockStateParser

ทำงานยังไง

มีการจัดการ exception. เรียกต่อ: getInput(), setCursor(), getStart(), parse(), apply(), createOffset(), getCursor(). สร้างออบเจ็กต์: StringReader, BlockStateParser. คืนค่า: blockStateParser.suggestions.apply(suggestionsBuilder.createOffset(stringReader.getCursor())).

Parameters

  • HolderLookup<Block> holderLookup
  • SuggestionsBuilder suggestionsBuilder
  • boolean bl
  • boolean bl2

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

HolderLookup<Block> holderLookup = ...;
SuggestionsBuilder suggestionsBuilder = ...;
CompletableFuture<Suggestions> result = BlockStateParser.fillSuggestions(holderLookup, suggestionsBuilder, true, true);

net.minecraft.commands.arguments.blocks.BlockStateParser#parseForBlock(HolderLookup<Block>,String,boolean)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateParser.java:90
  • Modifiers: public static
  • Return: BlockStateParser.BlockResult

คืออะไร

แปลง/วิเคราะห์ข้อมูล For Block

ทำงานยังไง

สร้างออบเจ็กต์: StringReader. คืนค่า: parseForBlock(holderLookup, new StringReader(string), bl).

Parameters

  • HolderLookup<Block> holderLookup
  • String string
  • boolean bl

Throws

  • CommandSyntaxException

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

HolderLookup<Block> holderLookup = ...;
BlockStateParser.BlockResult result = BlockStateParser.parseForBlock(holderLookup, "value", true);

net.minecraft.commands.arguments.blocks.BlockStateParser#parseForBlock(HolderLookup<Block>,StringReader,boolean)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateParser.java:94
  • Modifiers: public static
  • Return: BlockStateParser.BlockResult

คืออะไร

แปลง/วิเคราะห์ข้อมูล For Block

ทำงานยังไง

มีการจัดการ exception. เรียกต่อ: getCursor(), parse(), BlockResult(), setCursor(). สร้างออบเจ็กต์: BlockStateParser, BlockStateParser.BlockResult. คืนค่า: new BlockStateParser.BlockResult(blockStateParser.state, blockStateParser.properties, blockStateParser.nbt).

Parameters

  • HolderLookup<Block> holderLookup
  • StringReader stringReader
  • boolean bl

Throws

  • CommandSyntaxException

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

HolderLookup<Block> holderLookup = ...;
StringReader stringReader = ...;
BlockStateParser.BlockResult result = BlockStateParser.parseForBlock(holderLookup, stringReader, true);

net.minecraft.commands.arguments.blocks.BlockStateParser#parseForTesting(HolderLookup<Block>,String,boolean)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateParser.java:107
  • Modifiers: public static
  • Return: Either<BlockStateParser.BlockResult, BlockStateParser.TagResult>

คืออะไร

แปลง/วิเคราะห์ข้อมูล For Testing

ทำงานยังไง

สร้างออบเจ็กต์: StringReader. คืนค่า: parseForTesting(holderLookup, new StringReader(string), bl).

Parameters

  • HolderLookup<Block> holderLookup
  • String string
  • boolean bl

Throws

  • CommandSyntaxException

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

HolderLookup<Block> holderLookup = ...;
Either<BlockStateParser.BlockResult, BlockStateParser.TagResult> result = BlockStateParser.parseForTesting(holderLookup, "value", true);

net.minecraft.commands.arguments.blocks.BlockStateParser#parseForTesting(HolderLookup<Block>,StringReader,boolean)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateParser.java:111
  • Modifiers: public static
  • Return: Either<BlockStateParser.BlockResult, BlockStateParser.TagResult>

คืออะไร

แปลง/วิเคราะห์ข้อมูล For Testing

ทำงานยังไง

มีการจัดการ exception. เรียกต่อ: getCursor(), parse(), right(), TagResult(), left(), BlockResult(), setCursor(). สร้างออบเจ็กต์: BlockStateParser, BlockStateParser.TagResult, BlockStateParser.BlockResult.

Parameters

  • HolderLookup<Block> holderLookup
  • StringReader stringReader
  • boolean bl

Throws

  • CommandSyntaxException

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

HolderLookup<Block> holderLookup = ...;
StringReader stringReader = ...;
Either<BlockStateParser.BlockResult, BlockStateParser.TagResult> result = BlockStateParser.parseForTesting(holderLookup, stringReader, true);

net.minecraft.commands.arguments.blocks.BlockStateParser#serialize(BlockState)

  • Origin: common
  • Source: net/minecraft/commands/arguments/blocks/BlockStateParser.java:499
  • Modifiers: public static
  • Return: String

คืออะไร

แปลงเป็นข้อมูลสำหรับบันทึก/ส่ง serialize

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: getBlockHolder(), unwrapKey(), map(), location(), toString(), orElse(), getProperties(), isEmpty(). สร้างออบเจ็กต์: StringBuilder. คืนค่า: stringBuilder.toString().

Parameters

  • BlockState blockState

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

BlockState blockState = ...;
String result = BlockStateParser.serialize(blockState);