Skip to content

Package net.minecraft.commands.arguments.item

Part 1/1


ComponentPredicateParser

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

net.minecraft.commands.arguments.item.ComponentPredicateParser#createGrammar(ComponentPredicateParser.Context<T, C, P>)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:25
  • Modifiers: public static
  • Return: Grammar<List<T>>

คืออะไร

สร้าง Grammar

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการจัดการ exception. เรียกต่อ: of(), put(), alternative(), sequence(), named(), character(), cut(), optional(). สร้างออบเจ็กต์: Dictionary<>, ComponentPredicateParser.ElementLookupRule<>, ComponentPredicateParser.TagLookupRule<>, ComponentPredicateParser.ComponentLookupRule<>. มีจุด return อย่างน้อย 6 จุด.

Parameters

  • ComponentPredicateParser.Context<T, C, P> context

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

ComponentPredicateParser.Context<T, C, P> context = ...;
Grammar<List<T>> result = ComponentPredicateParser.createGrammar(context);

ComponentPredicateParser$Context

  • Full name: net.minecraft.commands.arguments.item.ComponentPredicateParser$Context
  • Package: net.minecraft.commands.arguments.item
  • Source: commonnet/minecraft/commands/arguments/item/ComponentPredicateParser.java
  • Type: interface
  • Modifiers: public

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#anyOf(List<T>)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:153
  • Modifiers: ``
  • Return: T

คืออะไร

ดำเนินการ anyOf ตาม implementation ของ ComponentPredicateParser$Context

ทำงานยังไง

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

Parameters

  • List<T> list

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

ComponentPredicateParser.Context instance = ...;
List<T> list = ...;
T result = instance.anyOf(list);

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#createComponentTest(ImmutableStringReader,C)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:143
  • Modifiers: ``
  • Return: T

คืออะไร

สร้าง Component Test

ทำงานยังไง

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

Parameters

  • ImmutableStringReader immutableStringReader
  • C object

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

ComponentPredicateParser.Context instance = ...;
ImmutableStringReader immutableStringReader = ...;
C object = ...;
T result = instance.createComponentTest(immutableStringReader, object);

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#createComponentTest(ImmutableStringReader,C,Tag)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:141
  • Modifiers: ``
  • Return: T

คืออะไร

สร้าง Component Test

ทำงานยังไง

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

Parameters

  • ImmutableStringReader immutableStringReader
  • C object
  • Tag tag

Throws

  • CommandSyntaxException

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

ComponentPredicateParser.Context instance = ...;
ImmutableStringReader immutableStringReader = ...;
C object = ...;
Tag tag = ...;
T result = instance.createComponentTest(immutableStringReader, object, tag);

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#createPredicateTest(ImmutableStringReader,P,Tag)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:149
  • Modifiers: ``
  • Return: T

คืออะไร

สร้าง Predicate Test

ทำงานยังไง

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

Parameters

  • ImmutableStringReader immutableStringReader
  • P object
  • Tag tag

Throws

  • CommandSyntaxException

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

ComponentPredicateParser.Context instance = ...;
ImmutableStringReader immutableStringReader = ...;
P object = ...;
Tag tag = ...;
T result = instance.createPredicateTest(immutableStringReader, object, tag);

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#forElementType(ImmutableStringReader,ResourceLocation)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:129
  • Modifiers: ``
  • Return: T

คืออะไร

ดำเนินการ forElementType ตาม implementation ของ ComponentPredicateParser$Context

ทำงานยังไง

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

Parameters

  • ImmutableStringReader immutableStringReader
  • ResourceLocation resourceLocation

Throws

  • CommandSyntaxException

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

ComponentPredicateParser.Context instance = ...;
ImmutableStringReader immutableStringReader = ...;
ResourceLocation resourceLocation = ...;
T result = instance.forElementType(immutableStringReader, resourceLocation);

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#forTagType(ImmutableStringReader,ResourceLocation)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:133
  • Modifiers: ``
  • Return: T

คืออะไร

ดำเนินการ forTagType ตาม implementation ของ ComponentPredicateParser$Context

ทำงานยังไง

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

Parameters

  • ImmutableStringReader immutableStringReader
  • ResourceLocation resourceLocation

Throws

  • CommandSyntaxException

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

ComponentPredicateParser.Context instance = ...;
ImmutableStringReader immutableStringReader = ...;
ResourceLocation resourceLocation = ...;
T result = instance.forTagType(immutableStringReader, resourceLocation);

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#listComponentTypes()

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:139
  • Modifiers: ``
  • Return: Stream<ResourceLocation>

คืออะไร

ดำเนินการ listComponentTypes ตาม implementation ของ ComponentPredicateParser$Context

ทำงานยังไง

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

Parameters

  • ไม่มี

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

ComponentPredicateParser.Context instance = ...;
Stream<ResourceLocation> result = instance.listComponentTypes();

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#listElementTypes()

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:131
  • Modifiers: ``
  • Return: Stream<ResourceLocation>

คืออะไร

ดำเนินการ listElementTypes ตาม implementation ของ ComponentPredicateParser$Context

ทำงานยังไง

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

Parameters

  • ไม่มี

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

ComponentPredicateParser.Context instance = ...;
Stream<ResourceLocation> result = instance.listElementTypes();

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#listPredicateTypes()

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:147
  • Modifiers: ``
  • Return: Stream<ResourceLocation>

คืออะไร

ดำเนินการ listPredicateTypes ตาม implementation ของ ComponentPredicateParser$Context

ทำงานยังไง

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

Parameters

  • ไม่มี

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

ComponentPredicateParser.Context instance = ...;
Stream<ResourceLocation> result = instance.listPredicateTypes();

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#listTagTypes()

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:135
  • Modifiers: ``
  • Return: Stream<ResourceLocation>

คืออะไร

ดำเนินการ listTagTypes ตาม implementation ของ ComponentPredicateParser$Context

ทำงานยังไง

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

Parameters

  • ไม่มี

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

ComponentPredicateParser.Context instance = ...;
Stream<ResourceLocation> result = instance.listTagTypes();

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#lookupComponentType(ImmutableStringReader,ResourceLocation)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:137
  • Modifiers: ``
  • Return: C

คืออะไร

ดำเนินการ lookupComponentType ตาม implementation ของ ComponentPredicateParser$Context

ทำงานยังไง

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

Parameters

  • ImmutableStringReader immutableStringReader
  • ResourceLocation resourceLocation

Throws

  • CommandSyntaxException

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

ComponentPredicateParser.Context instance = ...;
ImmutableStringReader immutableStringReader = ...;
ResourceLocation resourceLocation = ...;
C result = instance.lookupComponentType(immutableStringReader, resourceLocation);

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#lookupPredicateType(ImmutableStringReader,ResourceLocation)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:145
  • Modifiers: ``
  • Return: P

คืออะไร

ดำเนินการ lookupPredicateType ตาม implementation ของ ComponentPredicateParser$Context

ทำงานยังไง

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

Parameters

  • ImmutableStringReader immutableStringReader
  • ResourceLocation resourceLocation

Throws

  • CommandSyntaxException

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

ComponentPredicateParser.Context instance = ...;
ImmutableStringReader immutableStringReader = ...;
ResourceLocation resourceLocation = ...;
P result = instance.lookupPredicateType(immutableStringReader, resourceLocation);

net.minecraft.commands.arguments.item.ComponentPredicateParser$Context#negate(T)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ComponentPredicateParser.java:151
  • Modifiers: ``
  • Return: T

คืออะไร

ดำเนินการ negate ตาม implementation ของ ComponentPredicateParser$Context

ทำงานยังไง

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

Parameters

  • T object

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

ComponentPredicateParser.Context instance = ...;
T object = ...;
T result = instance.negate(object);

FunctionArgument

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

net.minecraft.commands.arguments.item.FunctionArgument#functions()

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/FunctionArgument.java:27
  • Modifiers: public static
  • Return: FunctionArgument

คืออะไร

ดำเนินการ functions ตาม implementation ของ FunctionArgument

ทำงานยังไง

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

Parameters

  • ไม่มี

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

FunctionArgument result = FunctionArgument.functions();

net.minecraft.commands.arguments.item.FunctionArgument#getExamples()

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/FunctionArgument.java:109
  • Modifiers: public
  • Return: Collection<String>

คืออะไร

อ่านค่า Examples

ทำงานยังไง

คืนค่า: EXAMPLES.

Parameters

  • ไม่มี

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

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

net.minecraft.commands.arguments.item.FunctionArgument#getFunctionCollection(CommandContext<CommandSourceStack>,String)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/FunctionArgument.java:103
  • Modifiers: public static
  • Return: Pair<ResourceLocation, Collection<CommandFunction<CommandSourceStack>>>

คืออะไร

อ่านค่า Function Collection

ทำงานยังไง

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

Parameters

  • CommandContext<CommandSourceStack> commandContext
  • String string

Throws

  • CommandSyntaxException

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

CommandContext<CommandSourceStack> commandContext = ...;
Pair<ResourceLocation, Collection<CommandFunction<CommandSourceStack>>> result = FunctionArgument.getFunctionCollection(commandContext, "value");

net.minecraft.commands.arguments.item.FunctionArgument#getFunctionOrTag(CommandContext<CommandSourceStack>,String)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/FunctionArgument.java:97
  • Modifiers: public static
  • Return: Pair<ResourceLocation, Either<CommandFunction<CommandSourceStack>, Collection<CommandFunction<CommandSourceStack>>>>

คืออะไร

อ่านค่า Function Or Tag

ทำงานยังไง

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

Parameters

  • CommandContext<CommandSourceStack> commandContext
  • String string

Throws

  • CommandSyntaxException

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

CommandContext<CommandSourceStack> commandContext = ...;
Pair<ResourceLocation, Either<CommandFunction<CommandSourceStack>, Collection<CommandFunction<CommandSourceStack>>>> result = FunctionArgument.getFunctionOrTag(commandContext, "value");

net.minecraft.commands.arguments.item.FunctionArgument#getFunctions(CommandContext<CommandSourceStack>,String)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/FunctionArgument.java:93
  • Modifiers: public static
  • Return: Collection<CommandFunction<CommandSourceStack>>

คืออะไร

อ่านค่า Functions

ทำงานยังไง

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

Parameters

  • CommandContext<CommandSourceStack> commandContext
  • String string

Throws

  • CommandSyntaxException

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

CommandContext<CommandSourceStack> commandContext = ...;
Collection<CommandFunction<CommandSourceStack>> result = FunctionArgument.getFunctions(commandContext, "value");

net.minecraft.commands.arguments.item.FunctionArgument#parse(StringReader)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/FunctionArgument.java:31
  • Modifiers: public
  • Return: FunctionArgument.Result

คืออะไร

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

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: canRead(), peek(), skip(), read(), Result(), create(), getFunctionTag(), unwrap(). สร้างออบเจ็กต์: FunctionArgument.Result. มีจุด return อย่างน้อย 6 จุด.

Parameters

  • StringReader stringReader

Throws

  • CommandSyntaxException

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

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

FunctionArgument$Result

  • Full name: net.minecraft.commands.arguments.item.FunctionArgument$Result
  • Package: net.minecraft.commands.arguments.item
  • Source: commonnet/minecraft/commands/arguments/item/FunctionArgument.java
  • Type: interface
  • Modifiers: public

net.minecraft.commands.arguments.item.FunctionArgument$Result#create(CommandContext<CommandSourceStack>)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/FunctionArgument.java:115
  • Modifiers: ``
  • Return: Collection<CommandFunction<CommandSourceStack>>

คืออะไร

สร้าง create

ทำงานยังไง

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

Parameters

  • CommandContext<CommandSourceStack> commandContext

Throws

  • CommandSyntaxException

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

FunctionArgument.Result instance = ...;
CommandContext<CommandSourceStack> commandContext = ...;
Collection<CommandFunction<CommandSourceStack>> result = instance.create(commandContext);

net.minecraft.commands.arguments.item.FunctionArgument$Result#unwrap(CommandContext<CommandSourceStack>)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/FunctionArgument.java:117
  • Modifiers: ``
  • Return: Pair<ResourceLocation, Either<CommandFunction<CommandSourceStack>, Collection<CommandFunction<CommandSourceStack>>>>

คืออะไร

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

ทำงานยังไง

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

Parameters

  • CommandContext<CommandSourceStack> commandContext

Throws

  • CommandSyntaxException

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

FunctionArgument.Result instance = ...;
CommandContext<CommandSourceStack> commandContext = ...;
Pair<ResourceLocation, Either<CommandFunction<CommandSourceStack>, Collection<CommandFunction<CommandSourceStack>>>> result = instance.unwrap(commandContext);

net.minecraft.commands.arguments.item.FunctionArgument$Result#unwrapToCollection(CommandContext<CommandSourceStack>)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/FunctionArgument.java:121
  • Modifiers: ``
  • Return: Pair<ResourceLocation, Collection<CommandFunction<CommandSourceStack>>>

คืออะไร

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

ทำงานยังไง

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

Parameters

  • CommandContext<CommandSourceStack> commandContext

Throws

  • CommandSyntaxException

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

FunctionArgument.Result instance = ...;
CommandContext<CommandSourceStack> commandContext = ...;
Pair<ResourceLocation, Collection<CommandFunction<CommandSourceStack>>> result = instance.unwrapToCollection(commandContext);

ItemArgument

  • Full name: net.minecraft.commands.arguments.item.ItemArgument
  • Package: net.minecraft.commands.arguments.item
  • Source: commonnet/minecraft/commands/arguments/item/ItemArgument.java
  • Type: class
  • Modifiers: public
  • Implements: ArgumentType<ItemInput>

net.minecraft.commands.arguments.item.ItemArgument#getExamples()

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemArgument.java:40
  • Modifiers: public
  • Return: Collection<String>

คืออะไร

อ่านค่า Examples

ทำงานยังไง

คืนค่า: EXAMPLES.

Parameters

  • ไม่มี

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

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

net.minecraft.commands.arguments.item.ItemArgument#getItem(CommandContext<S>,String)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemArgument.java:31
  • Modifiers: public static
  • Return: ItemInput

คืออะไร

อ่านค่า Item

ทำงานยังไง

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

Parameters

  • CommandContext<S> commandContext
  • String string

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

CommandContext<S> commandContext = ...;
ItemInput result = ItemArgument.getItem(commandContext, "value");

net.minecraft.commands.arguments.item.ItemArgument#item(CommandBuildContext)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemArgument.java:22
  • Modifiers: public static
  • Return: ItemArgument

คืออะไร

ดำเนินการ item ตาม implementation ของ ItemArgument

ทำงานยังไง

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

Parameters

  • CommandBuildContext commandBuildContext

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

CommandBuildContext commandBuildContext = ...;
ItemArgument result = ItemArgument.item(commandBuildContext);

net.minecraft.commands.arguments.item.ItemArgument#ItemArgument(CommandBuildContext)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemArgument.java:18
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: parser. สร้างออบเจ็กต์: ItemParser.

Parameters

  • CommandBuildContext commandBuildContext

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

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

net.minecraft.commands.arguments.item.ItemArgument#listSuggestions(CommandContext<S>,SuggestionsBuilder)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemArgument.java:35
  • Modifiers: public
  • Return: CompletableFuture<Suggestions>

คืออะไร

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

ทำงานยังไง

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

Parameters

  • CommandContext<S> commandContext
  • SuggestionsBuilder suggestionsBuilder

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

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

net.minecraft.commands.arguments.item.ItemArgument#parse(StringReader)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemArgument.java:26
  • Modifiers: public
  • Return: ItemInput

คืออะไร

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

ทำงานยังไง

เรียกต่อ: item(), components(). สร้างออบเจ็กต์: ItemInput. คืนค่า: new ItemInput(itemResult.item(), itemResult.components()).

Parameters

  • StringReader stringReader

Throws

  • CommandSyntaxException

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

ItemArgument instance = ...;
StringReader stringReader = ...;
ItemInput result = instance.parse(stringReader);

ItemInput

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

net.minecraft.commands.arguments.item.ItemInput#createItemStack(int,boolean)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemInput.java:39
  • Modifiers: public
  • Return: ItemStack

คืออะไร

สร้าง Item Stack

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: applyComponents(), getMaxStackSize(), create(), getItemName(). สร้างออบเจ็กต์: ItemStack. คืนค่า: itemStack.

Parameters

  • int i
  • boolean bl

Throws

  • CommandSyntaxException

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

ItemInput instance = ...;
ItemStack result = instance.createItemStack(0, true);

net.minecraft.commands.arguments.item.ItemInput#getItem()

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemInput.java:35
  • Modifiers: public
  • Return: Item

คืออะไร

อ่านค่า Item

ทำงานยังไง

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

Parameters

  • ไม่มี

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

ItemInput instance = ...;
Item result = instance.getItem();

net.minecraft.commands.arguments.item.ItemInput#ItemInput(Holder<Item>,DataComponentPatch)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemInput.java:30
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: item, components.

Parameters

  • Holder<Item> holder
  • DataComponentPatch dataComponentPatch

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

Holder<Item> holder = ...;
DataComponentPatch dataComponentPatch = ...;
ItemInput instance = new ItemInput(holder, dataComponentPatch);

net.minecraft.commands.arguments.item.ItemInput#serialize(HolderLookup.Provider)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemInput.java:49
  • Modifiers: public
  • Return: String

คืออะไร

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

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: getItemName(), serializeComponents(), isEmpty(), append(), toString(). สร้างออบเจ็กต์: StringBuilder. คืนค่า: stringBuilder.toString().

Parameters

  • HolderLookup.Provider provider

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

ItemInput instance = ...;
HolderLookup.Provider provider = ...;
String result = instance.serialize(provider);

ItemParser

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

net.minecraft.commands.arguments.item.ItemParser#fillSuggestions(SuggestionsBuilder)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemParser.java:111
  • Modifiers: public
  • Return: CompletableFuture<Suggestions>

คืออะไร

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

ทำงานยังไง

มีการจัดการ exception. เรียกต่อ: getInput(), setCursor(), getStart(), SuggestionsVisitor(), State(), parse(), resolveSuggestions(). สร้างออบเจ็กต์: StringReader, ItemParser.SuggestionsVisitor, ItemParser.State. คืนค่า: suggestionsVisitor.resolveSuggestions(suggestionsBuilder, stringReader).

Parameters

  • SuggestionsBuilder suggestionsBuilder

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

ItemParser instance = ...;
SuggestionsBuilder suggestionsBuilder = ...;
CompletableFuture<Suggestions> result = instance.fillSuggestions(suggestionsBuilder);

net.minecraft.commands.arguments.item.ItemParser#ItemParser(HolderLookup.Provider)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemParser.java:64
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: items, registryOps. เรียกต่อ: lookupOrThrow(), createSerializationContext().

Parameters

  • HolderLookup.Provider provider

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

HolderLookup.Provider provider = ...;
ItemParser instance = new ItemParser(provider);

net.minecraft.commands.arguments.item.ItemParser#parse(StringReader)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemParser.java:69
  • Modifiers: public
  • Return: ItemParser.ItemResult

คืออะไร

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

ทำงานยังไง

เรียกต่อ: builder(), Visitor(), visitItem(), setValue(), visitComponent(), set(), visitRemovedComponent(), remove(). สร้างออบเจ็กต์: MutableObject<>, ItemParser.Visitor, ItemParser.ItemResult. คืนค่า: new ItemParser.ItemResult(holder, dataComponentPatch).

Parameters

  • StringReader stringReader

Throws

  • CommandSyntaxException

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

ItemParser instance = ...;
StringReader stringReader = ...;
ItemParser.ItemResult result = instance.parse(stringReader);

net.minecraft.commands.arguments.item.ItemParser#parse(StringReader,ItemParser.Visitor)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemParser.java:100
  • Modifiers: public
  • Return: void

คืออะไร

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

ทำงานยังไง

มีการจัดการ exception. เรียกต่อ: getCursor(), State(), setCursor(). สร้างออบเจ็กต์: ItemParser.State.

Parameters

  • StringReader stringReader
  • ItemParser.Visitor visitor

Throws

  • CommandSyntaxException

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

ItemParser instance = ...;
StringReader stringReader = ...;
ItemParser.Visitor visitor = ...;
instance.parse(stringReader, visitor);

ItemParser$Visitor

  • Full name: net.minecraft.commands.arguments.item.ItemParser$Visitor
  • Package: net.minecraft.commands.arguments.item
  • Source: commonnet/minecraft/commands/arguments/item/ItemParser.java
  • Type: interface
  • Modifiers: public

net.minecraft.commands.arguments.item.ItemParser$Visitor#visitComponent(DataComponentType<T>,T)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemParser.java:300
  • Modifiers: default
  • Return: void

คืออะไร

เยี่ยมชม node Component

ทำงานยังไง

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

Parameters

  • DataComponentType<T> dataComponentType
  • T object

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

ItemParser.Visitor instance = ...;
DataComponentType<T> dataComponentType = ...;
T object = ...;
instance.visitComponent(dataComponentType, object);

net.minecraft.commands.arguments.item.ItemParser$Visitor#visitItem(Holder<Item>)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemParser.java:297
  • Modifiers: default
  • Return: void

คืออะไร

เยี่ยมชม node Item

ทำงานยังไง

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

Parameters

  • Holder<Item> holder

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

ItemParser.Visitor instance = ...;
Holder<Item> holder = ...;
instance.visitItem(holder);

net.minecraft.commands.arguments.item.ItemParser$Visitor#visitRemovedComponent(DataComponentType<T>)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemParser.java:303
  • Modifiers: default
  • Return: void

คืออะไร

เยี่ยมชม node Removed Component

ทำงานยังไง

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

Parameters

  • DataComponentType<T> dataComponentType

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

ItemParser.Visitor instance = ...;
DataComponentType<T> dataComponentType = ...;
instance.visitRemovedComponent(dataComponentType);

net.minecraft.commands.arguments.item.ItemParser$Visitor#visitSuggestions(Function<SuggestionsBuilder, CompletableFuture<Suggestions>>)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemParser.java:306
  • Modifiers: default
  • Return: void

คืออะไร

เยี่ยมชม node Suggestions

ทำงานยังไง

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

Parameters

  • Function<SuggestionsBuilder, CompletableFuture<Suggestions>> function

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

ItemParser.Visitor instance = ...;
Function<SuggestionsBuilder, CompletableFuture<Suggestions>> function = ...;
instance.visitSuggestions(function);

ItemPredicateArgument

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

net.minecraft.commands.arguments.item.ItemPredicateArgument#getExamples()

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemPredicateArgument.java:102
  • Modifiers: public
  • Return: Collection<String>

คืออะไร

อ่านค่า Examples

ทำงานยังไง

คืนค่า: EXAMPLES.

Parameters

  • ไม่มี

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

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

net.minecraft.commands.arguments.item.ItemPredicateArgument#getItemPredicate(CommandContext<CommandSourceStack>,String)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemPredicateArgument.java:93
  • Modifiers: public static
  • Return: ItemPredicateArgument.Result

คืออะไร

อ่านค่า Item Predicate

ทำงานยังไง

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

Parameters

  • CommandContext<CommandSourceStack> commandContext
  • String string

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

CommandContext<CommandSourceStack> commandContext = ...;
ItemPredicateArgument.Result result = ItemPredicateArgument.getItemPredicate(commandContext, "value");

net.minecraft.commands.arguments.item.ItemPredicateArgument#itemPredicate(CommandBuildContext)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemPredicateArgument.java:85
  • Modifiers: public static
  • Return: ItemPredicateArgument

คืออะไร

ดำเนินการ itemPredicate ตาม implementation ของ ItemPredicateArgument

ทำงานยังไง

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

Parameters

  • CommandBuildContext commandBuildContext

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

CommandBuildContext commandBuildContext = ...;
ItemPredicateArgument result = ItemPredicateArgument.itemPredicate(commandBuildContext);

net.minecraft.commands.arguments.item.ItemPredicateArgument#ItemPredicateArgument(CommandBuildContext)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemPredicateArgument.java:80
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: grammarWithContext. เรียกต่อ: Context(), createGrammar(). สร้างออบเจ็กต์: ItemPredicateArgument.Context.

Parameters

  • CommandBuildContext commandBuildContext

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

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

net.minecraft.commands.arguments.item.ItemPredicateArgument#listSuggestions(CommandContext<S>,SuggestionsBuilder)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemPredicateArgument.java:97
  • Modifiers: public
  • Return: CompletableFuture<Suggestions>

คืออะไร

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

ทำงานยังไง

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

Parameters

  • CommandContext<S> commandContext
  • SuggestionsBuilder suggestionsBuilder

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

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

net.minecraft.commands.arguments.item.ItemPredicateArgument#parse(StringReader)

  • Origin: common
  • Source: net/minecraft/commands/arguments/item/ItemPredicateArgument.java:89
  • Modifiers: public
  • Return: ItemPredicateArgument.Result

คืออะไร

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

ทำงานยังไง

เรียกต่อ: allOf(), parseForCommands(). คืนค่า: Util.allOf(this.grammarWithContext.parseForCommands(stringReader))::test.

Parameters

  • StringReader stringReader

Throws

  • CommandSyntaxException

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

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