Skip to content

Package net.minecraft.stats

Part 1/1


RecipeBook

  • Full name: net.minecraft.stats.RecipeBook
  • Package: net.minecraft.stats
  • Source: commonnet/minecraft/stats/RecipeBook.java
  • Type: class
  • Modifiers: public

net.minecraft.stats.RecipeBook#getBookSettings()

  • Origin: common
  • Source: net/minecraft/stats/RecipeBook.java:28
  • Modifiers: public
  • Return: RecipeBookSettings

คืออะไร

อ่านค่า Book Settings

ทำงานยังไง

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

Parameters

  • ไม่มี

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

RecipeBook instance = ...;
RecipeBookSettings result = instance.getBookSettings();

net.minecraft.stats.RecipeBook#isFiltering(RecipeBookType)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBook.java:16
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Filtering

ทำงานยังไง

คืนค่า: this.bookSettings.isFiltering(recipeBookType).

Parameters

  • RecipeBookType recipeBookType

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

RecipeBook instance = ...;
RecipeBookType recipeBookType = ...;
boolean result = instance.isFiltering(recipeBookType);

net.minecraft.stats.RecipeBook#isOpen(RecipeBookType)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBook.java:8
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Open

ทำงานยังไง

คืนค่า: this.bookSettings.isOpen(recipeBookType).

Parameters

  • RecipeBookType recipeBookType

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

RecipeBook instance = ...;
RecipeBookType recipeBookType = ...;
boolean result = instance.isOpen(recipeBookType);

net.minecraft.stats.RecipeBook#setBookSetting(RecipeBookType,boolean,boolean)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBook.java:32
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Book Setting

ทำงานยังไง

เรียกต่อ: setOpen(), setFiltering().

Parameters

  • RecipeBookType recipeBookType
  • boolean bl
  • boolean bl2

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

RecipeBook instance = ...;
RecipeBookType recipeBookType = ...;
instance.setBookSetting(recipeBookType, true, true);

net.minecraft.stats.RecipeBook#setBookSettings(RecipeBookSettings)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBook.java:24
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Book Settings

ทำงานยังไง

เรียกต่อ: replaceFrom().

Parameters

  • RecipeBookSettings recipeBookSettings

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

RecipeBook instance = ...;
RecipeBookSettings recipeBookSettings = ...;
instance.setBookSettings(recipeBookSettings);

net.minecraft.stats.RecipeBook#setFiltering(RecipeBookType,boolean)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBook.java:20
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Filtering

ทำงานยังไง

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

Parameters

  • RecipeBookType recipeBookType
  • boolean bl

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

RecipeBook instance = ...;
RecipeBookType recipeBookType = ...;
instance.setFiltering(recipeBookType, true);

net.minecraft.stats.RecipeBook#setOpen(RecipeBookType,boolean)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBook.java:12
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Open

ทำงานยังไง

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

Parameters

  • RecipeBookType recipeBookType
  • boolean bl

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

RecipeBook instance = ...;
RecipeBookType recipeBookType = ...;
instance.setOpen(recipeBookType, true);

RecipeBookSettings

  • Full name: net.minecraft.stats.RecipeBookSettings
  • Package: net.minecraft.stats
  • Source: commonnet/minecraft/stats/RecipeBookSettings.java
  • Type: class
  • Modifiers: public final

net.minecraft.stats.RecipeBookSettings#copy()

  • Origin: common
  • Source: net/minecraft/stats/RecipeBookSettings.java:112
  • Modifiers: public
  • Return: RecipeBookSettings

คืออะไร

คัดลอก copy

ทำงานยังไง

สร้างออบเจ็กต์: RecipeBookSettings, EnumMap<>. คืนค่า: new RecipeBookSettings(new EnumMap<>(this.states)).

Parameters

  • ไม่มี

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

RecipeBookSettings instance = ...;
RecipeBookSettings result = instance.copy();

net.minecraft.stats.RecipeBookSettings#equals(Object)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBookSettings.java:121
  • Modifiers: public
  • Return: boolean

คืออะไร

เปรียบเทียบความเท่ากัน equals

ทำงานยังไง

คืนค่า: this == object || object instanceof RecipeBookSettings && this.states.equals(((RecipeBookSettings)object).states).

Parameters

  • Object object

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

RecipeBookSettings instance = ...;
Object object = ...;
boolean result = instance.equals(object);

net.minecraft.stats.RecipeBookSettings#hashCode()

  • Origin: common
  • Source: net/minecraft/stats/RecipeBookSettings.java:126
  • Modifiers: public
  • Return: int

คืออะไร

ดำเนินการ hashCode ตาม implementation ของ RecipeBookSettings

ทำงานยังไง

คืนค่า: this.states.hashCode().

Parameters

  • ไม่มี

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

RecipeBookSettings instance = ...;
int result = instance.hashCode();

net.minecraft.stats.RecipeBookSettings#isFiltering(RecipeBookType)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBookSettings.java:62
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Filtering

ทำงานยังไง

เรียกต่อ: getSettings(). คืนค่า: this.getSettings(recipeBookType).filtering.

Parameters

  • RecipeBookType recipeBookType

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

RecipeBookSettings instance = ...;
RecipeBookType recipeBookType = ...;
boolean result = instance.isFiltering(recipeBookType);

net.minecraft.stats.RecipeBookSettings#isOpen(RecipeBookType)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBookSettings.java:54
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบสถานะ Open

ทำงานยังไง

เรียกต่อ: getSettings(). คืนค่า: this.getSettings(recipeBookType).open.

Parameters

  • RecipeBookType recipeBookType

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

RecipeBookSettings instance = ...;
RecipeBookType recipeBookType = ...;
boolean result = instance.isOpen(recipeBookType);

net.minecraft.stats.RecipeBookSettings#read(CompoundTag)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBookSettings.java:92
  • Modifiers: public static
  • Return: RecipeBookSettings

คืออะไร

อ่าน read

ทำงานยังไง

ตรวจเงื่อนไขด้วย if. เรียกต่อ: forEach(), getBoolean(), getFirst(), getSecond(), put(), TypeSettings(). สร้างออบเจ็กต์: EnumMap<>, RecipeBookSettings.TypeSettings, RecipeBookSettings. คืนค่า: new RecipeBookSettings(map).

Parameters

  • CompoundTag compoundTag

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

CompoundTag compoundTag = ...;
RecipeBookSettings result = RecipeBookSettings.read(compoundTag);

net.minecraft.stats.RecipeBookSettings#RecipeBookSettings()

  • Origin: common
  • Source: net/minecraft/stats/RecipeBookSettings.java:31
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

สร้างออบเจ็กต์: EnumMap<>.

Parameters

  • ไม่มี

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

RecipeBookSettings instance = new RecipeBookSettings();

net.minecraft.stats.RecipeBookSettings#replaceFrom(RecipeBookSettings)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBookSettings.java:116
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ replaceFrom ตาม implementation ของ RecipeBookSettings

ทำงานยังไง

เรียกต่อ: clear(), putAll().

Parameters

  • RecipeBookSettings recipeBookSettings

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

RecipeBookSettings instance = ...;
RecipeBookSettings recipeBookSettings = ...;
instance.replaceFrom(recipeBookSettings);

net.minecraft.stats.RecipeBookSettings#setFiltering(RecipeBookType,boolean)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBookSettings.java:66
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Filtering

ทำงานยังไง

เรียกต่อ: updateSettings().

Parameters

  • RecipeBookType recipeBookType
  • boolean bl

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

RecipeBookSettings instance = ...;
RecipeBookType recipeBookType = ...;
instance.setFiltering(recipeBookType, true);

net.minecraft.stats.RecipeBookSettings#setOpen(RecipeBookType,boolean)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBookSettings.java:58
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Open

ทำงานยังไง

เรียกต่อ: updateSettings().

Parameters

  • RecipeBookType recipeBookType
  • boolean bl

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

RecipeBookSettings instance = ...;
RecipeBookType recipeBookType = ...;
instance.setOpen(recipeBookType, true);

net.minecraft.stats.RecipeBookSettings#write(CompoundTag)

  • Origin: common
  • Source: net/minecraft/stats/RecipeBookSettings.java:104
  • Modifiers: public
  • Return: void

คืออะไร

เขียน write

ทำงานยังไง

เรียกต่อ: forEach(), getOrDefault(), putBoolean(), getFirst(), getSecond().

Parameters

  • CompoundTag compoundTag

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

RecipeBookSettings instance = ...;
CompoundTag compoundTag = ...;
instance.write(compoundTag);

ServerRecipeBook

  • Full name: net.minecraft.stats.ServerRecipeBook
  • Package: net.minecraft.stats
  • Source: commonnet/minecraft/stats/ServerRecipeBook.java
  • Type: class
  • Modifiers: public
  • Extends: RecipeBook

net.minecraft.stats.ServerRecipeBook#add(ResourceKey<Recipe<?>>)

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:44
  • Modifiers: public
  • Return: void

คืออะไร

เพิ่ม add

ทำงานยังไง

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

Parameters

  • ResourceKey<Recipe<?>> resourceKey

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

ServerRecipeBook instance = ...;
ResourceKey<Recipe<?>> resourceKey = ...;
instance.add(resourceKey);

net.minecraft.stats.ServerRecipeBook#addRecipes(Collection<RecipeHolder<?>>,ServerPlayer)

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:65
  • Modifiers: public
  • Return: int

คืออะไร

เพิ่ม Recipes

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: id(), contains(), value(), isSpecial(), add(), addHighlight(), displaysForRecipe(), Entry(). สร้างออบเจ็กต์: ArrayList<>, ClientboundRecipeBookAddPacket.Entry, ClientboundRecipeBookAddPacket. คืนค่า: list.size().

Parameters

  • Collection<RecipeHolder<?>> collection
  • ServerPlayer serverPlayer

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

ServerRecipeBook instance = ...;
Collection<RecipeHolder<?>> collection = ...;
ServerPlayer serverPlayer = ...;
int result = instance.addRecipes(collection, serverPlayer);

net.minecraft.stats.ServerRecipeBook#contains(ResourceKey<Recipe<?>>)

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:48
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่ามี contains

ทำงานยังไง

คืนค่า: this.known.contains(resourceKey).

Parameters

  • ResourceKey<Recipe<?>> resourceKey

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

ServerRecipeBook instance = ...;
ResourceKey<Recipe<?>> resourceKey = ...;
boolean result = instance.contains(resourceKey);

net.minecraft.stats.ServerRecipeBook#copyOverData(ServerRecipeBook)

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:165
  • Modifiers: public
  • Return: void

คืออะไร

คัดลอก Over Data

ทำงานยังไง

เรียกต่อ: clear(), replaceFrom(), addAll().

Parameters

  • ServerRecipeBook serverRecipeBook

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

ServerRecipeBook instance = ...;
ServerRecipeBook serverRecipeBook = ...;
instance.copyOverData(serverRecipeBook);

net.minecraft.stats.ServerRecipeBook#fromNbt(CompoundTag,Predicate<ResourceKey<Recipe<?>>>)

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:126
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ fromNbt ตาม implementation ของ ServerRecipeBook

ทำงานยังไง

เรียกต่อ: setBookSettings(), read(), getList(), loadRecipes().

Parameters

  • CompoundTag compoundTag
  • Predicate<ResourceKey<Recipe<?>>> predicate

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

ServerRecipeBook instance = ...;
CompoundTag compoundTag = ...;
Predicate<ResourceKey<Recipe<?>>> predicate = ...;
instance.fromNbt(compoundTag, predicate);

net.minecraft.stats.ServerRecipeBook#remove(ResourceKey<Recipe<?>>)

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:52
  • Modifiers: public
  • Return: void

คืออะไร

ลบ remove

ทำงานยังไง

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

Parameters

  • ResourceKey<Recipe<?>> resourceKey

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

ServerRecipeBook instance = ...;
ResourceKey<Recipe<?>> resourceKey = ...;
instance.remove(resourceKey);

net.minecraft.stats.ServerRecipeBook#removeHighlight(ResourceKey<Recipe<?>>)

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:57
  • Modifiers: public
  • Return: void

คืออะไร

ลบ Highlight

ทำงานยังไง

เรียกต่อ: remove().

Parameters

  • ResourceKey<Recipe<?>> resourceKey

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

ServerRecipeBook instance = ...;
ResourceKey<Recipe<?>> resourceKey = ...;
instance.removeHighlight(resourceKey);

net.minecraft.stats.ServerRecipeBook#removeRecipes(Collection<RecipeHolder<?>>,ServerPlayer)

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:88
  • Modifiers: public
  • Return: int

คืออะไร

ลบ Recipes

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: newArrayList(), id(), contains(), remove(), displaysForRecipe(), add(), isEmpty(), send(). สร้างออบเจ็กต์: ClientboundRecipeBookRemovePacket. คืนค่า: list.size().

Parameters

  • Collection<RecipeHolder<?>> collection
  • ServerPlayer serverPlayer

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

ServerRecipeBook instance = ...;
Collection<RecipeHolder<?>> collection = ...;
ServerPlayer serverPlayer = ...;
int result = instance.removeRecipes(collection, serverPlayer);

net.minecraft.stats.ServerRecipeBook#sendInitialRecipeBook(ServerPlayer)

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:151
  • Modifiers: public
  • Return: void

คืออะไร

ส่ง Initial Recipe Book

ทำงานยังไง

มีการวนลูป. เรียกต่อ: send(), getBookSettings(), size(), displaysForRecipe(), add(), Entry(), contains(). สร้างออบเจ็กต์: ClientboundRecipeBookSettingsPacket, ArrayList<>, ClientboundRecipeBookAddPacket.Entry, ClientboundRecipeBookAddPacket.

Parameters

  • ServerPlayer serverPlayer

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

ServerRecipeBook instance = ...;
ServerPlayer serverPlayer = ...;
instance.sendInitialRecipeBook(serverPlayer);

net.minecraft.stats.ServerRecipeBook#ServerRecipeBook(ServerRecipeBook.DisplayResolver)

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:40
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: displayResolver.

Parameters

  • ServerRecipeBook.DisplayResolver displayResolver

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

ServerRecipeBook.DisplayResolver displayResolver = ...;
ServerRecipeBook instance = new ServerRecipeBook(displayResolver);

net.minecraft.stats.ServerRecipeBook#toNbt()

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:106
  • Modifiers: public
  • Return: CompoundTag

คืออะไร

ดำเนินการ toNbt ตาม implementation ของ ServerRecipeBook

ทำงานยังไง

มีการวนลูป. เรียกต่อ: getBookSettings(), write(), add(), valueOf(), location(), toString(), put(). สร้างออบเจ็กต์: CompoundTag, ListTag. คืนค่า: compoundTag.

Parameters

  • ไม่มี

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

ServerRecipeBook instance = ...;
CompoundTag result = instance.toNbt();

ServerRecipeBook$DisplayResolver

  • Full name: net.minecraft.stats.ServerRecipeBook$DisplayResolver
  • Package: net.minecraft.stats
  • Source: commonnet/minecraft/stats/ServerRecipeBook.java
  • Type: interface
  • Modifiers: public

net.minecraft.stats.ServerRecipeBook$DisplayResolver#displaysForRecipe(ResourceKey<Recipe<?>>,Consumer<RecipeDisplayEntry>)

  • Origin: common
  • Source: net/minecraft/stats/ServerRecipeBook.java:175
  • Modifiers: ``
  • Return: void

คืออะไร

ดำเนินการ displaysForRecipe ตาม implementation ของ ServerRecipeBook$DisplayResolver

ทำงานยังไง

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

Parameters

  • ResourceKey<Recipe<?>> resourceKey
  • Consumer<RecipeDisplayEntry> consumer

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

ServerRecipeBook.DisplayResolver instance = ...;
ResourceKey<Recipe<?>> resourceKey = ...;
Consumer<RecipeDisplayEntry> consumer = ...;
instance.displaysForRecipe(resourceKey, consumer);

ServerStatsCounter

  • Full name: net.minecraft.stats.ServerStatsCounter
  • Package: net.minecraft.stats
  • Source: commonnet/minecraft/stats/ServerStatsCounter.java
  • Type: class
  • Modifiers: public
  • Extends: StatsCounter

net.minecraft.stats.ServerStatsCounter#markAllDirty()

  • Origin: common
  • Source: net/minecraft/stats/ServerStatsCounter.java:164
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ markAllDirty ตาม implementation ของ ServerStatsCounter

ทำงานยังไง

เรียกต่อ: addAll(), keySet().

Parameters

  • ไม่มี

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

ServerStatsCounter instance = ...;
instance.markAllDirty();

net.minecraft.stats.ServerStatsCounter#parseLocal(DataFixer,String)

  • Origin: common
  • Source: net/minecraft/stats/ServerStatsCounter.java:76
  • Modifiers: public
  • Return: void

คืออะไร

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

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการวนลูป ; มีการจัดการ exception. เรียกต่อ: setLenient(), parse(), isJsonNull(), fromJson(), getAsJsonObject(), updateToCurrentVersion(), getDataVersion(), contains(). สร้างออบเจ็กต์: JsonReader, StringReader.

Parameters

  • DataFixer dataFixer
  • String string

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

ServerStatsCounter instance = ...;
DataFixer dataFixer = ...;
instance.parseLocal(dataFixer, "value");

net.minecraft.stats.ServerStatsCounter#save()

  • Origin: common
  • Source: net/minecraft/stats/ServerStatsCounter.java:56
  • Modifiers: public
  • Return: void

คืออะไร

บันทึก save

ทำงานยังไง

มีการจัดการ exception. เรียกต่อ: writeStringToFile(), toJson(), error().

Parameters

  • ไม่มี

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

ServerStatsCounter instance = ...;
instance.save();

net.minecraft.stats.ServerStatsCounter#sendStats(ServerPlayer)

  • Origin: common
  • Source: net/minecraft/stats/ServerStatsCounter.java:168
  • Modifiers: public
  • Return: void

คืออะไร

ส่ง Stats

ทำงานยังไง

มีการวนลูป. เรียกต่อ: getDirty(), put(), getValue(), send(). สร้างออบเจ็กต์: Object2IntOpenHashMap<>, ClientboundAwardStatsPacket.

Parameters

  • ServerPlayer serverPlayer

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

ServerStatsCounter instance = ...;
ServerPlayer serverPlayer = ...;
instance.sendStats(serverPlayer);

net.minecraft.stats.ServerStatsCounter#ServerStatsCounter(MinecraftServer,File)

  • Origin: common
  • Source: net/minecraft/stats/ServerStatsCounter.java:42
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

ตรวจเงื่อนไขด้วย if ; มีการจัดการ exception. แก้ state: server, file. เรียกต่อ: isFile(), parseLocal(), getFixerUpper(), readFileToString(), error().

Parameters

  • MinecraftServer minecraftServer
  • File file

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

MinecraftServer minecraftServer = ...;
File file = ...;
ServerStatsCounter instance = new ServerStatsCounter(minecraftServer, file);

net.minecraft.stats.ServerStatsCounter#setValue(Player,Stat<?>,int)

  • Origin: common
  • Source: net/minecraft/stats/ServerStatsCounter.java:64
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Value

ทำงานยังไง

เรียกต่อ: add().

Parameters

  • Player player
  • Stat<?> stat
  • int i

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

ServerStatsCounter instance = ...;
Player player = ...;
Stat<?> stat = ...;
instance.setValue(player, stat, 0);

net.minecraft.stats.ServerStatsCounter#toJson()

  • Origin: common
  • Source: net/minecraft/stats/ServerStatsCounter.java:140
  • Modifiers: protected
  • Return: String

คืออะไร

ดำเนินการ toJson ตาม implementation ของ ServerStatsCounter

ทำงานยังไง

มีการวนลูป. เรียกต่อ: newHashMap(), object2IntEntrySet(), getKey(), computeIfAbsent(), getType(), addProperty(), toString(), getIntValue(). สร้างออบเจ็กต์: JsonObject. คืนค่า: jsonObject2.toString().

Parameters

  • ไม่มี

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

@Override
protected String toJson() {
    return super.toJson();
}

Stat

  • Full name: net.minecraft.stats.Stat
  • Package: net.minecraft.stats
  • Source: commonnet/minecraft/stats/Stat.java
  • Type: class
  • Modifiers: public
  • Extends: ObjectiveCriteria

net.minecraft.stats.Stat#buildName(StatType<T>,T)

  • Origin: common
  • Source: net/minecraft/stats/Stat.java:27
  • Modifiers: public static
  • Return: String

คืออะไร

สร้าง Name

ทำงานยังไง

เรียกต่อ: locationToKey(), getKey(), getRegistry(). คืนค่า: locationToKey(BuiltInRegistries.STAT_TYPE.getKey(statType)) + ":" + locationToKey(statType.getRegistry().getKey(object)).

Parameters

  • StatType<T> statType
  • T object

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

StatType<T> statType = ...;
T object = ...;
String result = Stat.buildName(statType, object);

net.minecraft.stats.Stat#equals(Object)

  • Origin: common
  • Source: net/minecraft/stats/Stat.java:47
  • Modifiers: public
  • Return: boolean

คืออะไร

เปรียบเทียบความเท่ากัน equals

ทำงานยังไง

เรียกต่อ: getName(). คืนค่า: this == object || object instanceof Stat && Objects.equals(this.getName(), ((Stat)object).getName()).

Parameters

  • Object object

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

Stat instance = ...;
Object object = ...;
boolean result = instance.equals(object);

net.minecraft.stats.Stat#format(int)

  • Origin: common
  • Source: net/minecraft/stats/Stat.java:43
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ format ตาม implementation ของ Stat

ทำงานยังไง

คืนค่า: this.formatter.format(i).

Parameters

  • int i

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

Stat instance = ...;
String result = instance.format(0);

net.minecraft.stats.Stat#getType()

  • Origin: common
  • Source: net/minecraft/stats/Stat.java:35
  • Modifiers: public
  • Return: StatType<T>

คืออะไร

อ่านค่า Type

ทำงานยังไง

คืนค่า: this.type.

Parameters

  • ไม่มี

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

Stat instance = ...;
StatType<T> result = instance.getType();

net.minecraft.stats.Stat#getValue()

  • Origin: common
  • Source: net/minecraft/stats/Stat.java:39
  • Modifiers: public
  • Return: T

คืออะไร

อ่านค่า Value

ทำงานยังไง

คืนค่า: this.value.

Parameters

  • ไม่มี

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

Stat instance = ...;
T result = instance.getValue();

net.minecraft.stats.Stat#hashCode()

  • Origin: common
  • Source: net/minecraft/stats/Stat.java:52
  • Modifiers: public
  • Return: int

คืออะไร

ดำเนินการ hashCode ตาม implementation ของ Stat

ทำงานยังไง

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

Parameters

  • ไม่มี

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

Stat instance = ...;
int result = instance.hashCode();

net.minecraft.stats.Stat#Stat(StatType<T>,T,StatFormatter)

  • Origin: common
  • Source: net/minecraft/stats/Stat.java:20
  • Modifiers: protected
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: type, formatter, value. เรียกต่อ: buildName().

Parameters

  • StatType<T> statType
  • T object
  • StatFormatter statFormatter

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

StatType<T> statType = ...;
T object = ...;
StatFormatter statFormatter = ...;
Stat instance = new Stat(statType, object, statFormatter);

net.minecraft.stats.Stat#toString()

  • Origin: common
  • Source: net/minecraft/stats/Stat.java:57
  • Modifiers: public
  • Return: String

คืออะไร

ดำเนินการ toString ตาม implementation ของ Stat

ทำงานยังไง

เรียกต่อ: getName(). คืนค่า: "Stat{name=" + this.getName() + ", formatter=" + this.formatter + "}".

Parameters

  • ไม่มี

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

Stat instance = ...;
String result = instance.toString();

StatFormatter

  • Full name: net.minecraft.stats.StatFormatter
  • Package: net.minecraft.stats
  • Source: commonnet/minecraft/stats/StatFormatter.java
  • Type: interface
  • Modifiers: public

net.minecraft.stats.StatFormatter#format(int)

  • Origin: common
  • Source: net/minecraft/stats/StatFormatter.java:41
  • Modifiers: ``
  • Return: String

คืออะไร

ดำเนินการ format ตาม implementation ของ StatFormatter

ทำงานยังไง

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

Parameters

  • int i

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

StatFormatter instance = ...;
String result = instance.format(0);

StatsCounter

  • Full name: net.minecraft.stats.StatsCounter
  • Package: net.minecraft.stats
  • Source: commonnet/minecraft/stats/StatsCounter.java
  • Type: class
  • Modifiers: public

net.minecraft.stats.StatsCounter#getValue(Stat<?>)

  • Origin: common
  • Source: net/minecraft/stats/StatsCounter.java:28
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Value

ทำงานยังไง

เรียกต่อ: getInt(). คืนค่า: this.stats.getInt(stat).

Parameters

  • Stat<?> stat

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

StatsCounter instance = ...;
Stat<?> stat = ...;
int result = instance.getValue(stat);

net.minecraft.stats.StatsCounter#getValue(StatType<T>,T)

  • Origin: common
  • Source: net/minecraft/stats/StatsCounter.java:24
  • Modifiers: public
  • Return: int

คืออะไร

อ่านค่า Value

ทำงานยังไง

เรียกต่อ: contains(), get(). คืนค่า: statType.contains(object) ? this.getValue(statType.get(object)) : 0.

Parameters

  • StatType<T> statType
  • T object

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

StatsCounter instance = ...;
StatType<T> statType = ...;
T object = ...;
int result = instance.getValue(statType, object);

net.minecraft.stats.StatsCounter#increment(Player,Stat<?>,int)

  • Origin: common
  • Source: net/minecraft/stats/StatsCounter.java:15
  • Modifiers: public
  • Return: void

คืออะไร

ดำเนินการ increment ตาม implementation ของ StatsCounter

ทำงานยังไง

เรียกต่อ: min(), getValue(), setValue().

Parameters

  • Player player
  • Stat<?> stat
  • int i

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

StatsCounter instance = ...;
Player player = ...;
Stat<?> stat = ...;
instance.increment(player, stat, 0);

net.minecraft.stats.StatsCounter#setValue(Player,Stat<?>,int)

  • Origin: common
  • Source: net/minecraft/stats/StatsCounter.java:20
  • Modifiers: public
  • Return: void

คืออะไร

กำหนดค่า Value

ทำงานยังไง

เรียกต่อ: put().

Parameters

  • Player player
  • Stat<?> stat
  • int i

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

StatsCounter instance = ...;
Player player = ...;
Stat<?> stat = ...;
instance.setValue(player, stat, 0);

net.minecraft.stats.StatsCounter#StatsCounter()

  • Origin: common
  • Source: net/minecraft/stats/StatsCounter.java:11
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

เรียกต่อ: defaultReturnValue().

Parameters

  • ไม่มี

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

StatsCounter instance = new StatsCounter();

StatType

  • Full name: net.minecraft.stats.StatType
  • Package: net.minecraft.stats
  • Source: commonnet/minecraft/stats/StatType.java
  • Type: class
  • Modifiers: public
  • Implements: Iterable<Stat<T>>

net.minecraft.stats.StatType#contains(T)

  • Origin: common
  • Source: net/minecraft/stats/StatType.java:28
  • Modifiers: public
  • Return: boolean

คืออะไร

ตรวจสอบว่ามี contains

ทำงานยังไง

เรียกต่อ: containsKey(). คืนค่า: this.map.containsKey(object).

Parameters

  • T object

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

StatType instance = ...;
T object = ...;
boolean result = instance.contains(object);

net.minecraft.stats.StatType#get(T)

  • Origin: common
  • Source: net/minecraft/stats/StatType.java:45
  • Modifiers: public
  • Return: Stat<T>

คืออะไร

อ่านค่า get

ทำงานยังไง

คืนค่า: this.get(object, StatFormatter.DEFAULT).

Parameters

  • T object

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

StatType instance = ...;
T object = ...;
Stat<T> result = instance.get(object);

net.minecraft.stats.StatType#get(T,StatFormatter)

  • Origin: common
  • Source: net/minecraft/stats/StatType.java:32
  • Modifiers: public
  • Return: Stat<T>

คืออะไร

อ่านค่า get

ทำงานยังไง

เรียกต่อ: computeIfAbsent(). สร้างออบเจ็กต์: Stat<>. คืนค่า: this.map.computeIfAbsent(object, objectx -> new Stat<>(this, (T)objectx, statFormatter)).

Parameters

  • T object
  • StatFormatter statFormatter

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

StatType instance = ...;
T object = ...;
StatFormatter statFormatter = ...;
Stat<T> result = instance.get(object, statFormatter);

net.minecraft.stats.StatType#getDisplayName()

  • Origin: common
  • Source: net/minecraft/stats/StatType.java:49
  • Modifiers: public
  • Return: Component

คืออะไร

อ่านค่า Display Name

ทำงานยังไง

คืนค่า: this.displayName.

Parameters

  • ไม่มี

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

StatType instance = ...;
Component result = instance.getDisplayName();

net.minecraft.stats.StatType#getRegistry()

  • Origin: common
  • Source: net/minecraft/stats/StatType.java:36
  • Modifiers: public
  • Return: Registry<T>

คืออะไร

อ่านค่า Registry

ทำงานยังไง

คืนค่า: this.registry.

Parameters

  • ไม่มี

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

StatType instance = ...;
Registry<T> result = instance.getRegistry();

net.minecraft.stats.StatType#iterator()

  • Origin: common
  • Source: net/minecraft/stats/StatType.java:40
  • Modifiers: public
  • Return: Iterator<Stat<T>>

คืออะไร

ดำเนินการ iterator ตาม implementation ของ StatType

ทำงานยังไง

เรียกต่อ: values(). คืนค่า: this.map.values().iterator().

Parameters

  • ไม่มี

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

StatType instance = ...;
Iterator<Stat<T>> result = instance.iterator();

net.minecraft.stats.StatType#StatType(Registry<T>,Component)

  • Origin: common
  • Source: net/minecraft/stats/StatType.java:18
  • Modifiers: public
  • Kind: constructor

คืออะไร

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

ทำงานยังไง

แก้ state: registry, displayName, streamCodec. เรียกต่อ: registry(), key(), map().

Parameters

  • Registry<T> registry
  • Component component

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

Registry<T> registry = ...;
Component component = ...;
StatType instance = new StatType(registry, component);

net.minecraft.stats.StatType#streamCodec()

  • Origin: common
  • Source: net/minecraft/stats/StatType.java:24
  • Modifiers: public
  • Return: StreamCodec<RegistryFriendlyByteBuf, Stat<T>>

คืออะไร

ดำเนินการ streamCodec ตาม implementation ของ StatType

ทำงานยังไง

คืนค่า: this.streamCodec.

Parameters

  • ไม่มี

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

StatType instance = ...;
StreamCodec<RegistryFriendlyByteBuf, Stat<T>> result = instance.streamCodec();