Skip to content

Package net.minecraft.commands.synchronization

Part 1/1


ArgumentTypeInfo

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

net.minecraft.commands.synchronization.ArgumentTypeInfo#deserializeFromNetwork(FriendlyByteBuf)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentTypeInfo.java:11
  • Modifiers: ``
  • Return: T

คืออะไร

สร้างออบเจ็กต์กลับจากข้อมูล From Network

ทำงานยังไง

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

Parameters

  • FriendlyByteBuf friendlyByteBuf

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

ArgumentTypeInfo instance = ...;
FriendlyByteBuf friendlyByteBuf = ...;
T result = instance.deserializeFromNetwork(friendlyByteBuf);

net.minecraft.commands.synchronization.ArgumentTypeInfo#serializeToJson(T,JsonObject)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentTypeInfo.java:13
  • Modifiers: ``
  • Return: void

คืออะไร

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

ทำงานยังไง

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

Parameters

  • T template
  • JsonObject jsonObject

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

ArgumentTypeInfo instance = ...;
T template = ...;
JsonObject jsonObject = ...;
instance.serializeToJson(template, jsonObject);

net.minecraft.commands.synchronization.ArgumentTypeInfo#serializeToNetwork(T,FriendlyByteBuf)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentTypeInfo.java:9
  • Modifiers: ``
  • Return: void

คืออะไร

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

ทำงานยังไง

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

Parameters

  • T template
  • FriendlyByteBuf friendlyByteBuf

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

ArgumentTypeInfo instance = ...;
T template = ...;
FriendlyByteBuf friendlyByteBuf = ...;
instance.serializeToNetwork(template, friendlyByteBuf);

net.minecraft.commands.synchronization.ArgumentTypeInfo#unpack(A)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentTypeInfo.java:15
  • Modifiers: ``
  • Return: T

คืออะไร

ดำเนินการ unpack ตาม implementation ของ ArgumentTypeInfo

ทำงานยังไง

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

Parameters

  • A argumentType

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

ArgumentTypeInfo instance = ...;
A argumentType = ...;
T result = instance.unpack(argumentType);

ArgumentTypeInfos

  • Full name: net.minecraft.commands.synchronization.ArgumentTypeInfos
  • Package: net.minecraft.commands.synchronization
  • Source: commonnet/minecraft/commands/synchronization/ArgumentTypeInfos.java
  • Type: class
  • Modifiers: public

net.minecraft.commands.synchronization.ArgumentTypeInfos#bootstrap(Registry<ArgumentTypeInfo<?, ?>>)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentTypeInfos.java:78
  • Modifiers: public static
  • Return: ArgumentTypeInfo<?, ?>

คืออะไร

ดำเนินการ bootstrap ตาม implementation ของ ArgumentTypeInfos

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: register(), contextFree(), Info(), contextAware(), fixClassType(). สร้างออบเจ็กต์: FloatArgumentInfo, DoubleArgumentInfo, IntegerArgumentInfo, LongArgumentInfo. คืนค่า: register(registry, "uuid", UuidArgument.class, SingletonArgumentInfo.contextFree(UuidArgument::uuid)).

Parameters

  • Registry<ArgumentTypeInfo<?, ?>> registry

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

Registry<ArgumentTypeInfo<?, ?>> registry = ...;
ArgumentTypeInfo<?, ?> result = ArgumentTypeInfos.bootstrap(registry);

net.minecraft.commands.synchronization.ArgumentTypeInfos#byClass(A)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentTypeInfos.java:150
  • Modifiers: public static
  • Return: ArgumentTypeInfo<A, ?>

คืออะไร

ดำเนินการ byClass ตาม implementation ของ ArgumentTypeInfos

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), getClass(), format(), s(). สร้างออบเจ็กต์: IllegalArgumentException. คืนค่า: (ArgumentTypeInfo<A, ?>)argumentTypeInfo.

Parameters

  • A argumentType

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

A argumentType = ...;
ArgumentTypeInfo<A, ?> result = ArgumentTypeInfos.byClass(argumentType);

net.minecraft.commands.synchronization.ArgumentTypeInfos#isClassRecognized(Class<?>)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentTypeInfos.java:146
  • Modifiers: public static
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Class Recognized

ทำงานยังไง

เรียกต่อ: containsKey(). คืนค่า: BY_CLASS.containsKey(class_).

Parameters

  • Class<?> class_

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

Class<?> class_ = ...;
boolean result = ArgumentTypeInfos.isClassRecognized(class_);

net.minecraft.commands.synchronization.ArgumentTypeInfos#unpack(A)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentTypeInfos.java:159
  • Modifiers: public static
  • Return: ArgumentTypeInfo.Template<A>

คืออะไร

ดำเนินการ unpack ตาม implementation ของ ArgumentTypeInfos

ทำงานยังไง

เรียกต่อ: byClass(). คืนค่า: byClass(argumentType).unpack(argumentType).

Parameters

  • A argumentType

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

A argumentType = ...;
ArgumentTypeInfo.Template<A> result = ArgumentTypeInfos.unpack(argumentType);

ArgumentUtils

  • Full name: net.minecraft.commands.synchronization.ArgumentUtils
  • Package: net.minecraft.commands.synchronization
  • Source: commonnet/minecraft/commands/synchronization/ArgumentUtils.java
  • Type: class
  • Modifiers: public

net.minecraft.commands.synchronization.ArgumentUtils#createNumberFlags(boolean,boolean)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentUtils.java:23
  • Modifiers: public static
  • Return: int

คืออะไร

สร้าง Number Flags

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. คืนค่า: i.

Parameters

  • boolean bl
  • boolean bl2

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

int result = ArgumentUtils.createNumberFlags(true, true);

net.minecraft.commands.synchronization.ArgumentUtils#findUsedArgumentTypes(CommandNode<T>)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentUtils.java:108
  • Modifiers: public static
  • Return: Set<ArgumentType<?>>

คืออะไร

ค้นหา Used Argument Types

ทำงานยังไง

เรียกต่อ: newIdentityHashSet(), newHashSet(). คืนค่า: set2.

Parameters

  • CommandNode<T> commandNode

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

CommandNode<T> commandNode = ...;
Set<ArgumentType<?>> result = ArgumentUtils.findUsedArgumentTypes(commandNode);

net.minecraft.commands.synchronization.ArgumentUtils#numberHasMax(byte)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentUtils.java:40
  • Modifiers: public static
  • Return: boolean

คืออะไร

ดำเนินการ numberHasMax ตาม implementation ของ ArgumentUtils

ทำงานยังไง

คืนค่า: (b & 2) != 0.

Parameters

  • byte b

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

boolean result = ArgumentUtils.numberHasMax(0);

net.minecraft.commands.synchronization.ArgumentUtils#numberHasMin(byte)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentUtils.java:36
  • Modifiers: public static
  • Return: boolean

คืออะไร

ดำเนินการ numberHasMin ตาม implementation ของ ArgumentUtils

ทำงานยังไง

คืนค่า: (b & 1) != 0.

Parameters

  • byte b

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

boolean result = ArgumentUtils.numberHasMin(0);

net.minecraft.commands.synchronization.ArgumentUtils#serializeNodeToJson(CommandDispatcher<S>,CommandNode<S>)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/ArgumentUtils.java:65
  • Modifiers: public static
  • Return: JsonObject

คืออะไร

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

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: addProperty(), serializeArgumentToJson(), getType(), error(), getClass(), getChildren(), add(), getName(). สร้างออบเจ็กต์: JsonObject, JsonArray. คืนค่า: jsonObject.

Parameters

  • CommandDispatcher<S> commandDispatcher
  • CommandNode<S> commandNode

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

CommandDispatcher<S> commandDispatcher = ...;
CommandNode<S> commandNode = ...;
JsonObject result = ArgumentUtils.serializeNodeToJson(commandDispatcher, commandNode);

SingletonArgumentInfo

  • Full name: net.minecraft.commands.synchronization.SingletonArgumentInfo
  • Package: net.minecraft.commands.synchronization
  • Source: commonnet/minecraft/commands/synchronization/SingletonArgumentInfo.java
  • Type: class
  • Modifiers: public
  • Implements: ArgumentTypeInfo<A, SingletonArgumentInfo<A>.Template>

net.minecraft.commands.synchronization.SingletonArgumentInfo#contextAware(Function<CommandBuildContext, T>)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SingletonArgumentInfo.java:21
  • Modifiers: public static
  • Return: SingletonArgumentInfo<T>

คืออะไร

ดำเนินการ contextAware ตาม implementation ของ SingletonArgumentInfo

ทำงานยังไง

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

Parameters

  • Function<CommandBuildContext, T> function

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

Function<CommandBuildContext, T> function = ...;
SingletonArgumentInfo<T> result = SingletonArgumentInfo.contextAware(function);

net.minecraft.commands.synchronization.SingletonArgumentInfo#contextFree(Supplier<T>)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SingletonArgumentInfo.java:17
  • Modifiers: public static
  • Return: SingletonArgumentInfo<T>

คืออะไร

ดำเนินการ contextFree ตาม implementation ของ SingletonArgumentInfo

ทำงานยังไง

เรียกต่อ: get(). สร้างออบเจ็กต์: SingletonArgumentInfo<>. คืนค่า: new SingletonArgumentInfo<>(commandBuildContext -> supplier.get()).

Parameters

  • Supplier<T> supplier

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

Supplier<T> supplier = ...;
SingletonArgumentInfo<T> result = SingletonArgumentInfo.contextFree(supplier);

net.minecraft.commands.synchronization.SingletonArgumentInfo#deserializeFromNetwork(FriendlyByteBuf)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SingletonArgumentInfo.java:31
  • Modifiers: public
  • Return: SingletonArgumentInfo<A>.Template

คืออะไร

สร้างออบเจ็กต์กลับจากข้อมูล From Network

ทำงานยังไง

คืนค่า: this.template.

Parameters

  • FriendlyByteBuf friendlyByteBuf

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

SingletonArgumentInfo instance = ...;
FriendlyByteBuf friendlyByteBuf = ...;
SingletonArgumentInfo<A>.Template result = instance.deserializeFromNetwork(friendlyByteBuf);

net.minecraft.commands.synchronization.SingletonArgumentInfo#serializeToJson(SingletonArgumentInfo<A>.Template,JsonObject)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SingletonArgumentInfo.java:28
  • Modifiers: public
  • Return: void

คืออะไร

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

ทำงานยังไง

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

Parameters

  • SingletonArgumentInfo<A>.Template template
  • JsonObject jsonObject

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

SingletonArgumentInfo instance = ...;
SingletonArgumentInfo<A>.Template template = ...;
JsonObject jsonObject = ...;
instance.serializeToJson(template, jsonObject);

net.minecraft.commands.synchronization.SingletonArgumentInfo#serializeToNetwork(SingletonArgumentInfo<A>.Template,FriendlyByteBuf)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SingletonArgumentInfo.java:25
  • Modifiers: public
  • Return: void

คืออะไร

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

ทำงานยังไง

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

Parameters

  • SingletonArgumentInfo<A>.Template template
  • FriendlyByteBuf friendlyByteBuf

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

SingletonArgumentInfo instance = ...;
SingletonArgumentInfo<A>.Template template = ...;
FriendlyByteBuf friendlyByteBuf = ...;
instance.serializeToNetwork(template, friendlyByteBuf);

net.minecraft.commands.synchronization.SingletonArgumentInfo#unpack(A)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SingletonArgumentInfo.java:35
  • Modifiers: public
  • Return: SingletonArgumentInfo<A>.Template

คืออะไร

ดำเนินการ unpack ตาม implementation ของ SingletonArgumentInfo

ทำงานยังไง

คืนค่า: this.template.

Parameters

  • A argumentType

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

SingletonArgumentInfo instance = ...;
A argumentType = ...;
SingletonArgumentInfo<A>.Template result = instance.unpack(argumentType);

SingletonArgumentInfo$Template

  • Full name: net.minecraft.commands.synchronization.SingletonArgumentInfo$Template
  • Package: net.minecraft.commands.synchronization
  • Source: commonnet/minecraft/commands/synchronization/SingletonArgumentInfo.java
  • Type: class
  • Modifiers: public final
  • Implements: ArgumentTypeInfo.Template<A>

net.minecraft.commands.synchronization.SingletonArgumentInfo$Template#instantiate(CommandBuildContext)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SingletonArgumentInfo.java:46
  • Modifiers: public
  • Return: A

คืออะไร

ดำเนินการ instantiate ตาม implementation ของ SingletonArgumentInfo$Template

ทำงานยังไง

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

Parameters

  • CommandBuildContext commandBuildContext

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

SingletonArgumentInfo.Template instance = ...;
CommandBuildContext commandBuildContext = ...;
A result = instance.instantiate(commandBuildContext);

net.minecraft.commands.synchronization.SingletonArgumentInfo$Template#Template(Function<CommandBuildContext, A>)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SingletonArgumentInfo.java:42
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: constructor.

Parameters

  • Function<CommandBuildContext, A> function

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

Function<CommandBuildContext, A> function = ...;
SingletonArgumentInfo.Template instance = new SingletonArgumentInfo.Template(function);

net.minecraft.commands.synchronization.SingletonArgumentInfo$Template#type()

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SingletonArgumentInfo.java:51
  • Modifiers: public
  • Return: ArgumentTypeInfo<A, ?>

คืออะไร

ดำเนินการ type ตาม implementation ของ SingletonArgumentInfo$Template

ทำงานยังไง

คืนค่า: SingletonArgumentInfo.this.

Parameters

  • ไม่มี

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

SingletonArgumentInfo.Template instance = ...;
ArgumentTypeInfo<A, ?> result = instance.type();

SuggestionProviders

  • Full name: net.minecraft.commands.synchronization.SuggestionProviders
  • Package: net.minecraft.commands.synchronization
  • Source: commonnet/minecraft/commands/synchronization/SuggestionProviders.java
  • Type: class
  • Modifiers: public

net.minecraft.commands.synchronization.SuggestionProviders#getName(SuggestionProvider<SharedSuggestionProvider>)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SuggestionProviders.java:54
  • Modifiers: public static
  • Return: ResourceLocation

คืออะไร

อ่านค่า Name

ทำงานยังไง

คืนค่า: suggestionProvider instanceof SuggestionProviders.Wrapper ? ((SuggestionProviders.Wrapper)suggestionProvider).name : DEFAULT_NAME.

Parameters

  • SuggestionProvider<SharedSuggestionProvider> suggestionProvider

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

SuggestionProvider<SharedSuggestionProvider> suggestionProvider = ...;
ResourceLocation result = SuggestionProviders.getName(suggestionProvider);

net.minecraft.commands.synchronization.SuggestionProviders#getProvider(ResourceLocation)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SuggestionProviders.java:50
  • Modifiers: public static
  • Return: SuggestionProvider<SharedSuggestionProvider>

คืออะไร

อ่านค่า Provider

ทำงานยังไง

เรียกต่อ: getOrDefault(). คืนค่า: PROVIDERS_BY_NAME.getOrDefault(resourceLocation, ASK_SERVER).

Parameters

  • ResourceLocation resourceLocation

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

ResourceLocation resourceLocation = ...;
SuggestionProvider<SharedSuggestionProvider> result = SuggestionProviders.getProvider(resourceLocation);

net.minecraft.commands.synchronization.SuggestionProviders#register(ResourceLocation,SuggestionProvider<SharedSuggestionProvider>)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SuggestionProviders.java:39
  • Modifiers: public static
  • Return: SuggestionProvider<S>

คืออะไร

ลงทะเบียน register

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: containsKey(), put(), Wrapper(). สร้างออบเจ็กต์: IllegalArgumentException, SuggestionProviders.Wrapper. คืนค่า: new SuggestionProviders.Wrapper(resourceLocation, suggestionProvider).

Parameters

  • ResourceLocation resourceLocation
  • SuggestionProvider<SharedSuggestionProvider> suggestionProvider

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

ResourceLocation resourceLocation = ...;
SuggestionProvider<SharedSuggestionProvider> suggestionProvider = ...;
SuggestionProvider<S> result = SuggestionProviders.register(resourceLocation, suggestionProvider);

net.minecraft.commands.synchronization.SuggestionProviders#safelySwap(SuggestionProvider<SharedSuggestionProvider>)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SuggestionProviders.java:58
  • Modifiers: public static
  • Return: SuggestionProvider<SharedSuggestionProvider>

คืออะไร

ดำเนินการ safelySwap ตาม implementation ของ SuggestionProviders

ทำงานยังไง

คืนค่า: suggestionProvider instanceof SuggestionProviders.Wrapper ? suggestionProvider : ASK_SERVER.

Parameters

  • SuggestionProvider<SharedSuggestionProvider> suggestionProvider

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

SuggestionProvider<SharedSuggestionProvider> suggestionProvider = ...;
SuggestionProvider<SharedSuggestionProvider> result = SuggestionProviders.safelySwap(suggestionProvider);

SuggestionProviders$Wrapper

  • Full name: net.minecraft.commands.synchronization.SuggestionProviders$Wrapper
  • Package: net.minecraft.commands.synchronization
  • Source: commonnet/minecraft/commands/synchronization/SuggestionProviders.java
  • Type: class
  • Modifiers: protected static
  • Implements: SuggestionProvider<SharedSuggestionProvider>

net.minecraft.commands.synchronization.SuggestionProviders$Wrapper#getSuggestions(CommandContext<SharedSuggestionProvider>,SuggestionsBuilder)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SuggestionProviders.java:71
  • Modifiers: public
  • Return: CompletableFuture<Suggestions>

คืออะไร

อ่านค่า Suggestions

ทำงานยังไง

คืนค่า: this.delegate.getSuggestions(commandContext, suggestionsBuilder).

Parameters

  • CommandContext<SharedSuggestionProvider> commandContext
  • SuggestionsBuilder suggestionsBuilder

Throws

  • CommandSyntaxException

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

SuggestionProviders.Wrapper instance = ...;
CommandContext<SharedSuggestionProvider> commandContext = ...;
SuggestionsBuilder suggestionsBuilder = ...;
CompletableFuture<Suggestions> result = instance.getSuggestions(commandContext, suggestionsBuilder);

net.minecraft.commands.synchronization.SuggestionProviders$Wrapper#Wrapper(ResourceLocation,SuggestionProvider<SharedSuggestionProvider>)

  • Origin: common
  • Source: net/minecraft/commands/synchronization/SuggestionProviders.java:66
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: delegate, name.

Parameters

  • ResourceLocation resourceLocation
  • SuggestionProvider<SharedSuggestionProvider> suggestionProvider

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

ResourceLocation resourceLocation = ...;
SuggestionProvider<SharedSuggestionProvider> suggestionProvider = ...;
SuggestionProviders.Wrapper instance = new SuggestionProviders.Wrapper(resourceLocation, suggestionProvider);