Skip to content

Package net.minecraft.commands.functions

Part 1/1


CommandFunction

  • Full name: net.minecraft.commands.functions.CommandFunction
  • Package: net.minecraft.commands.functions
  • Source: commonnet/minecraft/commands/functions/CommandFunction.java
  • Type: interface
  • Modifiers: public

net.minecraft.commands.functions.CommandFunction#checkCommandLineLength(CharSequence)

  • Origin: common
  • Source: net/minecraft/commands/functions/CommandFunction.java:87
  • Modifiers: static
  • Return: void

คืออะไร

ตรวจสอบ Command Line Length

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: length(), subSequence(), min(). สร้างออบเจ็กต์: IllegalStateException.

Parameters

  • CharSequence charSequence

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

CharSequence charSequence = ...;
CommandFunction.checkCommandLineLength(charSequence);

net.minecraft.commands.functions.CommandFunction#fromLines(ResourceLocation,CommandDispatcher<T>,T,List<String>)

  • Origin: common
  • Source: net/minecraft/commands/functions/CommandFunction.java:29
  • Modifiers: static
  • Return: CommandFunction<T>

คืออะไร

ดำเนินการ fromLines ตาม implementation ของ CommandFunction

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป ; มีการจัดการ exception. เรียกต่อ: size(), get(), trim(), shouldConcatenateNextLine(), deleteCharAt(), length(), append(), checkCommandLineLength(). สร้างออบเจ็กต์: FunctionBuilder<>, StringBuilder, IllegalArgumentException, StringReader. คืนค่า: functionBuilder.build(resourceLocation).

Parameters

  • ResourceLocation resourceLocation
  • CommandDispatcher<T> commandDispatcher
  • T executionCommandSource
  • List<String> list

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

ResourceLocation resourceLocation = ...;
CommandDispatcher<T> commandDispatcher = ...;
T executionCommandSource = ...;
List<String> list = ...;
CommandFunction<T> result = CommandFunction.fromLines(resourceLocation, commandDispatcher, executionCommandSource, list);

net.minecraft.commands.functions.CommandFunction#id()

  • Origin: common
  • Source: net/minecraft/commands/functions/CommandFunction.java:20
  • Modifiers: ``
  • Return: ResourceLocation

คืออะไร

ดำเนินการ id ตาม implementation ของ CommandFunction

ทำงานยังไง

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

Parameters

  • ไม่มี

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

CommandFunction instance = ...;
ResourceLocation result = instance.id();

net.minecraft.commands.functions.CommandFunction#instantiate(CompoundTag,CommandDispatcher<T>)

  • Origin: common
  • Source: net/minecraft/commands/functions/CommandFunction.java:22
  • Modifiers: ``
  • Return: InstantiatedFunction<T>

คืออะไร

ดำเนินการ instantiate ตาม implementation ของ CommandFunction

ทำงานยังไง

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

Parameters

  • CompoundTag compoundTag
  • CommandDispatcher<T> commandDispatcher

Throws

  • FunctionInstantiationException

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

CommandFunction instance = ...;
CompoundTag compoundTag = ...;
CommandDispatcher<T> commandDispatcher = ...;
InstantiatedFunction<T> result = instance.instantiate(compoundTag, commandDispatcher);

net.minecraft.commands.functions.CommandFunction#parseCommand(CommandDispatcher<T>,T,StringReader)

  • Origin: common
  • Source: net/minecraft/commands/functions/CommandFunction.java:94
  • Modifiers: static
  • Return: UnboundEntryAction<T>

คืออะไร

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

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: parse(), validateParseResults(), tryFlatten(), getContext(), build(), getString(), isEmpty(), dispatcherUnknownCommand(). สร้างออบเจ็กต์: BuildContexts.Unbound<>. คืนค่า: new BuildContexts.Unbound<>(stringReader.getString(), optional.get()).

Parameters

  • CommandDispatcher<T> commandDispatcher
  • T executionCommandSource
  • StringReader stringReader

Throws

  • CommandSyntaxException

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

CommandDispatcher<T> commandDispatcher = ...;
T executionCommandSource = ...;
StringReader stringReader = ...;
UnboundEntryAction<T> result = CommandFunction.parseCommand(commandDispatcher, executionCommandSource, stringReader);

InstantiatedFunction

  • Full name: net.minecraft.commands.functions.InstantiatedFunction
  • Package: net.minecraft.commands.functions
  • Source: commonnet/minecraft/commands/functions/InstantiatedFunction.java
  • Type: interface
  • Modifiers: public

net.minecraft.commands.functions.InstantiatedFunction#entries()

  • Origin: common
  • Source: net/minecraft/commands/functions/InstantiatedFunction.java:10
  • Modifiers: ``
  • Return: List<UnboundEntryAction<T>>

คืออะไร

ดำเนินการ entries ตาม implementation ของ InstantiatedFunction

ทำงานยังไง

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

Parameters

  • ไม่มี

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

InstantiatedFunction instance = ...;
List<UnboundEntryAction<T>> result = instance.entries();

net.minecraft.commands.functions.InstantiatedFunction#id()

  • Origin: common
  • Source: net/minecraft/commands/functions/InstantiatedFunction.java:8
  • Modifiers: ``
  • Return: ResourceLocation

คืออะไร

ดำเนินการ id ตาม implementation ของ InstantiatedFunction

ทำงานยังไง

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

Parameters

  • ไม่มี

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

InstantiatedFunction instance = ...;
ResourceLocation result = instance.id();

MacroFunction

  • Full name: net.minecraft.commands.functions.MacroFunction
  • Package: net.minecraft.commands.functions
  • Source: commonnet/minecraft/commands/functions/MacroFunction.java
  • Type: class
  • Modifiers: public
  • Implements: CommandFunction<T>

net.minecraft.commands.functions.MacroFunction#id()

  • Origin: common
  • Source: net/minecraft/commands/functions/MacroFunction.java:46
  • Modifiers: public
  • Return: ResourceLocation

คืออะไร

ดำเนินการ id ตาม implementation ของ MacroFunction

ทำงานยังไง

คืนค่า: this.id.

Parameters

  • ไม่มี

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

MacroFunction instance = ...;
ResourceLocation result = instance.id();

net.minecraft.commands.functions.MacroFunction#instantiate(CompoundTag,CommandDispatcher<T>)

  • Origin: common
  • Source: net/minecraft/commands/functions/MacroFunction.java:51
  • Modifiers: public
  • Return: InstantiatedFunction<T>

คืออะไร

ดำเนินการ instantiate ตาม implementation ของ MacroFunction

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: translatable(), translationArg(), id(), size(), get(), add(), stringify(), getAndMoveToLast(). สร้างออบเจ็กต์: FunctionInstantiationException, ArrayList<>. มีจุด return อย่างน้อย 2 จุด.

Parameters

  • CompoundTag compoundTag
  • CommandDispatcher<T> commandDispatcher

Throws

  • FunctionInstantiationException

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

MacroFunction instance = ...;
CompoundTag compoundTag = ...;
CommandDispatcher<T> commandDispatcher = ...;
InstantiatedFunction<T> result = instance.instantiate(compoundTag, commandDispatcher);

net.minecraft.commands.functions.MacroFunction#MacroFunction(ResourceLocation,List<MacroFunction.Entry<T>>,List<String>)

  • Origin: common
  • Source: net/minecraft/commands/functions/MacroFunction.java:40
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: id, entries, parameters.

Parameters

  • ResourceLocation resourceLocation
  • List<MacroFunction.Entry<T>> list
  • List<String> list2

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

ResourceLocation resourceLocation = ...;
List<MacroFunction.Entry<T>> list = ...;
List<String> list2 = ...;
MacroFunction instance = new MacroFunction(resourceLocation, list, list2);

PlainTextFunction

  • Full name: net.minecraft.commands.functions.PlainTextFunction
  • Package: net.minecraft.commands.functions
  • Source: commonnet/minecraft/commands/functions/PlainTextFunction.java
  • Type: record
  • Modifiers: public
  • Implements: CommandFunction<T>,InstantiatedFunction<T>

net.minecraft.commands.functions.PlainTextFunction#instantiate(CompoundTag,CommandDispatcher<T>)

  • Origin: common
  • Source: net/minecraft/commands/functions/PlainTextFunction.java:12
  • Modifiers: public
  • Return: InstantiatedFunction<T>

คืออะไร

ดำเนินการ instantiate ตาม implementation ของ PlainTextFunction

ทำงานยังไง

คืนค่า: this.

Parameters

  • CompoundTag compoundTag
  • CommandDispatcher<T> commandDispatcher

Throws

  • FunctionInstantiationException

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

PlainTextFunction instance = ...;
CompoundTag compoundTag = ...;
CommandDispatcher<T> commandDispatcher = ...;
InstantiatedFunction<T> result = instance.instantiate(compoundTag, commandDispatcher);

StringTemplate

  • Full name: net.minecraft.commands.functions.StringTemplate
  • Package: net.minecraft.commands.functions
  • Source: commonnet/minecraft/commands/functions/StringTemplate.java
  • Type: record
  • Modifiers: public

net.minecraft.commands.functions.StringTemplate#fromString(String,int)

  • Origin: common
  • Source: net/minecraft/commands/functions/StringTemplate.java:8
  • Modifiers: public static
  • Return: StringTemplate

คืออะไร

ดำเนินการ fromString ตาม implementation ของ StringTemplate

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: builder(), length(), indexOf(), charAt(), add(), substring(), isValidVariableName(), build(). สร้างออบเจ็กต์: IllegalArgumentException, StringTemplate. คืนค่า: new StringTemplate(builder.build(), builder2.build()).

Parameters

  • String string
  • int i

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

StringTemplate result = StringTemplate.fromString("value", 0);

net.minecraft.commands.functions.StringTemplate#substitute(List<String>)

  • Origin: common
  • Source: net/minecraft/commands/functions/StringTemplate.java:58
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ substitute ตาม implementation ของ StringTemplate

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: size(), append(), get(), checkCommandLineLength(), toString(). สร้างออบเจ็กต์: StringBuilder. คืนค่า: stringBuilder.toString().

Parameters

  • List<String> list

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

StringTemplate instance = ...;
List<String> list = ...;
String result = instance.substitute(list);