Package net.minecraft.util.context
Part 1/1
ContextKey
- Full name:
net.minecraft.util.context.ContextKey - Package:
net.minecraft.util.context - Source:
common—net/minecraft/util/context/ContextKey.java - Type:
class - Modifiers:
public
net.minecraft.util.context.ContextKey#ContextKey(ResourceLocation)
- Origin:
common - Source:
net/minecraft/util/context/ContextKey.java:8 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ContextKey ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: name.
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
net.minecraft.util.context.ContextKey#name()
- Origin:
common - Source:
net/minecraft/util/context/ContextKey.java:16 - Modifiers:
public - Return:
ResourceLocation
คืออะไร
ดำเนินการ name ตาม implementation ของ ContextKey
ทำงานยังไง
คืนค่า: this.name.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.util.context.ContextKey#toString()
- Origin:
common - Source:
net/minecraft/util/context/ContextKey.java:20 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ ContextKey
ทำงานยังไง
คืนค่า: "<parameter " + this.name + ">".
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.util.context.ContextKey#vanilla(String)
- Origin:
common - Source:
net/minecraft/util/context/ContextKey.java:12 - Modifiers:
public static - Return:
ContextKey<T>
คืออะไร
ดำเนินการ vanilla ตาม implementation ของ ContextKey
ทำงานยังไง
เรียกต่อ: withDefaultNamespace(). สร้างออบเจ็กต์: ContextKey<>. คืนค่า: new ContextKey<>(ResourceLocation.withDefaultNamespace(string)).
Parameters
String string
ตัวอย่างใช้งาน
ContextKeySet
- Full name:
net.minecraft.util.context.ContextKeySet - Package:
net.minecraft.util.context - Source:
common—net/minecraft/util/context/ContextKeySet.java - Type:
class - Modifiers:
public
net.minecraft.util.context.ContextKeySet#allowed()
- Origin:
common - Source:
net/minecraft/util/context/ContextKeySet.java:20 - Modifiers:
public - Return:
Set<ContextKey<?>>
คืออะไร
ดำเนินการ allowed ตาม implementation ของ ContextKeySet
ทำงานยังไง
คืนค่า: this.allowed.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.util.context.ContextKeySet#required()
- Origin:
common - Source:
net/minecraft/util/context/ContextKeySet.java:16 - Modifiers:
public - Return:
Set<ContextKey<?>>
คืออะไร
ดำเนินการ required ตาม implementation ของ ContextKeySet
ทำงานยังไง
คืนค่า: this.required.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.util.context.ContextKeySet#toString()
- Origin:
common - Source:
net/minecraft/util/context/ContextKeySet.java:24 - Modifiers:
public - Return:
String
คืออะไร
ดำเนินการ toString ตาม implementation ของ ContextKeySet
ทำงานยังไง
เรียกต่อ: on(), join(), stream(), map(), contains(), name(), iterator(). คืนค่า: "[" + Joiner.on(", ").join(this.allowed.stream().map(contextKey -> (this.required.contains(contextKey) ? "!" : "") + contextKey.name()).iterator()) + "]".
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ContextKeySet$Builder
- Full name:
net.minecraft.util.context.ContextKeySet$Builder - Package:
net.minecraft.util.context - Source:
common—net/minecraft/util/context/ContextKeySet.java - Type:
class - Modifiers:
public static
net.minecraft.util.context.ContextKeySet$Builder#build()
- Origin:
common - Source:
net/minecraft/util/context/ContextKeySet.java:53 - Modifiers:
public - Return:
ContextKeySet
คืออะไร
สร้าง build
ทำงานยังไง
สร้างออบเจ็กต์: ContextKeySet. คืนค่า: new ContextKeySet(this.required, this.optional).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.util.context.ContextKeySet$Builder#optional(ContextKey<?>)
- Origin:
common - Source:
net/minecraft/util/context/ContextKeySet.java:44 - Modifiers:
public - Return:
ContextKeySet.Builder
คืออะไร
ดำเนินการ optional ตาม implementation ของ ContextKeySet$Builder
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: contains(), name(), add(). สร้างออบเจ็กต์: IllegalArgumentException. คืนค่า: this.
Parameters
ContextKey<?> contextKey
ตัวอย่างใช้งาน
ContextKeySet.Builder instance = ...;
ContextKey<?> contextKey = ...;
ContextKeySet.Builder result = instance.optional(contextKey);
net.minecraft.util.context.ContextKeySet$Builder#required(ContextKey<?>)
- Origin:
common - Source:
net/minecraft/util/context/ContextKeySet.java:35 - Modifiers:
public - Return:
ContextKeySet.Builder
คืออะไร
ดำเนินการ required ตาม implementation ของ ContextKeySet$Builder
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: contains(), name(), add(). สร้างออบเจ็กต์: IllegalArgumentException. คืนค่า: this.
Parameters
ContextKey<?> contextKey
ตัวอย่างใช้งาน
ContextKeySet.Builder instance = ...;
ContextKey<?> contextKey = ...;
ContextKeySet.Builder result = instance.required(contextKey);
ContextMap
- Full name:
net.minecraft.util.context.ContextMap - Package:
net.minecraft.util.context - Source:
common—net/minecraft/util/context/ContextMap.java - Type:
class - Modifiers:
public
net.minecraft.util.context.ContextMap#getOptional(ContextKey<T>)
- Origin:
common - Source:
net/minecraft/util/context/ContextMap.java:31 - Modifiers:
public - Return:
T
คืออะไร
อ่านค่า Optional
ทำงานยังไง
เรียกต่อ: get(). คืนค่า: (T)this.params.get(contextKey).
Parameters
ContextKey<T> contextKey
ตัวอย่างใช้งาน
ContextMap instance = ...;
ContextKey<T> contextKey = ...;
T result = instance.getOptional(contextKey);
net.minecraft.util.context.ContextMap#getOrDefault(ContextKey<T>,T)
- Origin:
common - Source:
net/minecraft/util/context/ContextMap.java:36 - Modifiers:
public - Return:
T
คืออะไร
อ่านค่า Or Default
ทำงานยังไง
คืนค่า: (T)this.params.getOrDefault(contextKey, object).
Parameters
ContextKey<T> contextKeyT object
ตัวอย่างใช้งาน
ContextMap instance = ...;
ContextKey<T> contextKey = ...;
T object = ...;
T result = instance.getOrDefault(contextKey, object);
net.minecraft.util.context.ContextMap#getOrThrow(ContextKey<T>)
- Origin:
common - Source:
net/minecraft/util/context/ContextMap.java:22 - Modifiers:
public - Return:
T
คืออะไร
อ่านค่า Or Throw
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), name(), toString(). สร้างออบเจ็กต์: NoSuchElementException. คืนค่า: object.
Parameters
ContextKey<T> contextKey
ตัวอย่างใช้งาน
ContextMap instance = ...;
ContextKey<T> contextKey = ...;
T result = instance.getOrThrow(contextKey);
net.minecraft.util.context.ContextMap#has(ContextKey<?>)
- Origin:
common - Source:
net/minecraft/util/context/ContextMap.java:18 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี has
ทำงานยังไง
เรียกต่อ: containsKey(). คืนค่า: this.params.containsKey(contextKey).
Parameters
ContextKey<?> contextKey
ตัวอย่างใช้งาน
ContextMap instance = ...;
ContextKey<?> contextKey = ...;
boolean result = instance.has(contextKey);
ContextMap$Builder
- Full name:
net.minecraft.util.context.ContextMap$Builder - Package:
net.minecraft.util.context - Source:
common—net/minecraft/util/context/ContextMap.java - Type:
class - Modifiers:
public static
net.minecraft.util.context.ContextMap$Builder#create(ContextKeySet)
- Origin:
common - Source:
net/minecraft/util/context/ContextMap.java:74 - Modifiers:
public - Return:
ContextMap
คืออะไร
สร้าง create
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: difference(), keySet(), allowed(), isEmpty(), required(). สร้างออบเจ็กต์: IllegalArgumentException, ContextMap. คืนค่า: new ContextMap(this.params).
Parameters
ContextKeySet contextKeySet
ตัวอย่างใช้งาน
ContextMap.Builder instance = ...;
ContextKeySet contextKeySet = ...;
ContextMap result = instance.create(contextKeySet);
net.minecraft.util.context.ContextMap$Builder#getOptionalParameter(ContextKey<T>)
- Origin:
common - Source:
net/minecraft/util/context/ContextMap.java:69 - Modifiers:
public - Return:
T
คืออะไร
อ่านค่า Optional Parameter
ทำงานยังไง
เรียกต่อ: get(). คืนค่า: (T)this.params.get(contextKey).
Parameters
ContextKey<T> contextKey
ตัวอย่างใช้งาน
ContextMap.Builder instance = ...;
ContextKey<T> contextKey = ...;
T result = instance.getOptionalParameter(contextKey);
net.minecraft.util.context.ContextMap$Builder#getParameter(ContextKey<T>)
- Origin:
common - Source:
net/minecraft/util/context/ContextMap.java:60 - Modifiers:
public - Return:
T
คืออะไร
อ่านค่า Parameter
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), name(), toString(). สร้างออบเจ็กต์: NoSuchElementException. คืนค่า: object.
Parameters
ContextKey<T> contextKey
ตัวอย่างใช้งาน
ContextMap.Builder instance = ...;
ContextKey<T> contextKey = ...;
T result = instance.getParameter(contextKey);
net.minecraft.util.context.ContextMap$Builder#withOptionalParameter(ContextKey<T>,T)
- Origin:
common - Source:
net/minecraft/util/context/ContextMap.java:50 - Modifiers:
public - Return:
ContextMap.Builder
คืออะไร
ดำเนินการ withOptionalParameter ตาม implementation ของ ContextMap$Builder
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: remove(), put(). คืนค่า: this.
Parameters
ContextKey<T> contextKeyT object
ตัวอย่างใช้งาน
ContextMap.Builder instance = ...;
ContextKey<T> contextKey = ...;
T object = ...;
ContextMap.Builder result = instance.withOptionalParameter(contextKey, object);
net.minecraft.util.context.ContextMap$Builder#withParameter(ContextKey<T>,T)
- Origin:
common - Source:
net/minecraft/util/context/ContextMap.java:45 - Modifiers:
public - Return:
ContextMap.Builder
คืออะไร
ดำเนินการ withParameter ตาม implementation ของ ContextMap$Builder
ทำงานยังไง
เรียกต่อ: put(). คืนค่า: this.
Parameters
ContextKey<T> contextKeyT object
ตัวอย่างใช้งาน
ContextMap.Builder instance = ...;
ContextKey<T> contextKey = ...;
T object = ...;
ContextMap.Builder result = instance.withParameter(contextKey, object);