Package net.minecraft.world.level.storage.loot
Part 1/1
BuiltInLootTables
- Full name:
net.minecraft.world.level.storage.loot.BuiltInLootTables - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/BuiltInLootTables.java - Type:
class - Modifiers:
public
net.minecraft.world.level.storage.loot.BuiltInLootTables#all()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/BuiltInLootTables.java:147 - Modifiers:
public static - Return:
Set<ResourceKey<LootTable>>
คืออะไร
ดำเนินการ all ตาม implementation ของ BuiltInLootTables
ทำงานยังไง
คืนค่า: IMMUTABLE_LOCATIONS.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
ContainerComponentManipulator
- Full name:
net.minecraft.world.level.storage.loot.ContainerComponentManipulator - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/ContainerComponentManipulator.java - Type:
interface - Modifiers:
public
net.minecraft.world.level.storage.loot.ContainerComponentManipulator#empty()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ContainerComponentManipulator.java:11 - Modifiers: ``
- Return:
T
คืออะไร
ดำเนินการ empty ตาม implementation ของ ContainerComponentManipulator
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.ContainerComponentManipulator#getContents(T)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ContainerComponentManipulator.java:15 - Modifiers: ``
- Return:
Stream<ItemStack>
คืออะไร
อ่านค่า Contents
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
T object
ตัวอย่างใช้งาน
ContainerComponentManipulator instance = ...;
T object = ...;
Stream<ItemStack> result = instance.getContents(object);
net.minecraft.world.level.storage.loot.ContainerComponentManipulator#modifyItems(ItemStack,UnaryOperator<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ContainerComponentManipulator.java:27 - Modifiers:
default - Return:
void
คืออะไร
ดำเนินการ modifyItems ตาม implementation ของ ContainerComponentManipulator
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), type(), isEmpty(), apply(), limitSize(), getMaxStackSize(), setContents(), getContents(). มีจุด return อย่างน้อย 2 จุด.
Parameters
ItemStack itemStackUnaryOperator<ItemStack> unaryOperator
ตัวอย่างใช้งาน
ContainerComponentManipulator instance = ...;
ItemStack itemStack = ...;
UnaryOperator<ItemStack> unaryOperator = ...;
instance.modifyItems(itemStack, unaryOperator);
net.minecraft.world.level.storage.loot.ContainerComponentManipulator#setContents(ItemStack,Stream<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ContainerComponentManipulator.java:23 - Modifiers:
default - Return:
void
คืออะไร
กำหนดค่า Contents
ทำงานยังไง
เรียกต่อ: empty().
Parameters
ItemStack itemStackStream<ItemStack> stream
ตัวอย่างใช้งาน
ContainerComponentManipulator instance = ...;
ItemStack itemStack = ...;
Stream<ItemStack> stream = ...;
instance.setContents(itemStack, stream);
net.minecraft.world.level.storage.loot.ContainerComponentManipulator#setContents(ItemStack,T,Stream<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ContainerComponentManipulator.java:17 - Modifiers:
default - Return:
void
คืออะไร
กำหนดค่า Contents
ทำงานยังไง
เรียกต่อ: getOrDefault(), type(), set().
Parameters
ItemStack itemStackT objectStream<ItemStack> stream
ตัวอย่างใช้งาน
ContainerComponentManipulator instance = ...;
ItemStack itemStack = ...;
T object = ...;
Stream<ItemStack> stream = ...;
instance.setContents(itemStack, object, stream);
net.minecraft.world.level.storage.loot.ContainerComponentManipulator#setContents(T,Stream<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ContainerComponentManipulator.java:13 - Modifiers: ``
- Return:
T
คืออะไร
กำหนดค่า Contents
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
T objectStream<ItemStack> stream
ตัวอย่างใช้งาน
ContainerComponentManipulator instance = ...;
T object = ...;
Stream<ItemStack> stream = ...;
T result = instance.setContents(object, stream);
net.minecraft.world.level.storage.loot.ContainerComponentManipulator#type()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ContainerComponentManipulator.java:9 - Modifiers: ``
- Return:
DataComponentType<T>
คืออะไร
ดำเนินการ type ตาม implementation ของ ContainerComponentManipulator
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
- ไม่มี
ตัวอย่างใช้งาน
IntRange
- Full name:
net.minecraft.world.level.storage.loot.IntRange - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/IntRange.java - Type:
class - Modifiers:
public
net.minecraft.world.level.storage.loot.IntRange#clamp(LootContext,int)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/IntRange.java:94 - Modifiers:
public - Return:
int
คืออะไร
ดำเนินการ clamp ตาม implementation ของ IntRange
ทำงานยังไง
เรียกต่อ: apply(). คืนค่า: this.limiter.apply(lootContext, i).
Parameters
LootContext lootContextint i
ตัวอย่างใช้งาน
IntRange instance = ...;
LootContext lootContext = ...;
int result = instance.clamp(lootContext, 0);
net.minecraft.world.level.storage.loot.IntRange#exact(int)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/IntRange.java:77 - Modifiers:
public static - Return:
IntRange
คืออะไร
ดำเนินการ exact ตาม implementation ของ IntRange
ทำงานยังไง
เรียกต่อ: exactly(), of(). สร้างออบเจ็กต์: IntRange. คืนค่า: new IntRange(Optional.of(constantValue), Optional.of(constantValue)).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.IntRange#getReferencedContextParams()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/IntRange.java:40 - Modifiers:
public - Return:
Set<ContextKey<?>>
คืออะไร
อ่านค่า Referenced Context Params
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: builder(), addAll(), build(). คืนค่า: builder.build().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.IntRange#lowerBound(int)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/IntRange.java:86 - Modifiers:
public static - Return:
IntRange
คืออะไร
ดำเนินการ lowerBound ตาม implementation ของ IntRange
ทำงานยังไง
เรียกต่อ: of(), exactly(), empty(). สร้างออบเจ็กต์: IntRange. คืนค่า: new IntRange(Optional.of(ConstantValue.exactly(i)), Optional.empty()).
Parameters
int i
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.IntRange#range(int,int)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/IntRange.java:82 - Modifiers:
public static - Return:
IntRange
คืออะไร
ดำเนินการ range ตาม implementation ของ IntRange
ทำงานยังไง
เรียกต่อ: of(), exactly(). สร้างออบเจ็กต์: IntRange. คืนค่า: new IntRange(Optional.of(ConstantValue.exactly(i)), Optional.of(ConstantValue.exactly(j))).
Parameters
int iint j
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.IntRange#test(LootContext,int)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/IntRange.java:98 - Modifiers:
public - Return:
boolean
คืออะไร
ทดสอบเงื่อนไข test
ทำงานยังไง
คืนค่า: this.predicate.test(lootContext, i).
Parameters
LootContext lootContextint i
ตัวอย่างใช้งาน
IntRange instance = ...;
LootContext lootContext = ...;
boolean result = instance.test(lootContext, 0);
net.minecraft.world.level.storage.loot.IntRange#upperBound(int)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/IntRange.java:90 - Modifiers:
public static - Return:
IntRange
คืออะไร
ดำเนินการ upperBound ตาม implementation ของ IntRange
ทำงานยังไง
เรียกต่อ: empty(), of(), exactly(). สร้างออบเจ็กต์: IntRange. คืนค่า: new IntRange(Optional.empty(), Optional.of(ConstantValue.exactly(i))).
Parameters
int i
ตัวอย่างใช้งาน
LootContext
- Full name:
net.minecraft.world.level.storage.loot.LootContext - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootContext.java - Type:
class - Modifiers:
public
net.minecraft.world.level.storage.loot.LootContext#addDynamicDrops(ResourceLocation,Consumer<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:46 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม Dynamic Drops
ทำงานยังไง
ทำงานตาม body โดยตรง (ประมาณ 1 statement).
Parameters
ResourceLocation resourceLocationConsumer<ItemStack> consumer
ตัวอย่างใช้งาน
LootContext instance = ...;
ResourceLocation resourceLocation = ...;
Consumer<ItemStack> consumer = ...;
instance.addDynamicDrops(resourceLocation, consumer);
net.minecraft.world.level.storage.loot.LootContext#createVisitedEntry(LootItemCondition)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:82 - Modifiers:
public static - Return:
LootContext.VisitedEntry<LootItemCondition>
คืออะไร
สร้าง Visited Entry
ทำงานยังไง
สร้างออบเจ็กต์: LootContext.VisitedEntry<>. คืนค่า: new LootContext.VisitedEntry<>(LootDataType.PREDICATE, lootItemCondition).
Parameters
LootItemCondition lootItemCondition
ตัวอย่างใช้งาน
LootItemCondition lootItemCondition = ...;
LootContext.VisitedEntry<LootItemCondition> result = LootContext.createVisitedEntry(lootItemCondition);
net.minecraft.world.level.storage.loot.LootContext#createVisitedEntry(LootItemFunction)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:86 - Modifiers:
public static - Return:
LootContext.VisitedEntry<LootItemFunction>
คืออะไร
สร้าง Visited Entry
ทำงานยังไง
สร้างออบเจ็กต์: LootContext.VisitedEntry<>. คืนค่า: new LootContext.VisitedEntry<>(LootDataType.MODIFIER, lootItemFunction).
Parameters
LootItemFunction lootItemFunction
ตัวอย่างใช้งาน
LootItemFunction lootItemFunction = ...;
LootContext.VisitedEntry<LootItemFunction> result = LootContext.createVisitedEntry(lootItemFunction);
net.minecraft.world.level.storage.loot.LootContext#createVisitedEntry(LootTable)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:78 - Modifiers:
public static - Return:
LootContext.VisitedEntry<LootTable>
คืออะไร
สร้าง Visited Entry
ทำงานยังไง
สร้างออบเจ็กต์: LootContext.VisitedEntry<>. คืนค่า: new LootContext.VisitedEntry<>(LootDataType.TABLE, lootTable).
Parameters
LootTable lootTable
ตัวอย่างใช้งาน
LootTable lootTable = ...;
LootContext.VisitedEntry<LootTable> result = LootContext.createVisitedEntry(lootTable);
net.minecraft.world.level.storage.loot.LootContext#getLevel()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:74 - Modifiers:
public - Return:
ServerLevel
คืออะไร
อ่านค่า Level
ทำงานยังไง
คืนค่า: this.params.getLevel().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootContext#getLuck()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:70 - Modifiers:
public - Return:
float
คืออะไร
อ่านค่า Luck
ทำงานยังไง
คืนค่า: this.params.getLuck().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootContext#getOptionalParameter(ContextKey<T>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:41 - Modifiers:
public - Return:
T
คืออะไร
อ่านค่า Optional Parameter
ทำงานยังไง
เรียกต่อ: contextMap(), getOptional(). คืนค่า: this.params.contextMap().getOptional(contextKey).
Parameters
ContextKey<T> contextKey
ตัวอย่างใช้งาน
LootContext instance = ...;
ContextKey<T> contextKey = ...;
T result = instance.getOptionalParameter(contextKey);
net.minecraft.world.level.storage.loot.LootContext#getParameter(ContextKey<T>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:37 - Modifiers:
public - Return:
T
คืออะไร
อ่านค่า Parameter
ทำงานยังไง
เรียกต่อ: contextMap(), getOrThrow(). คืนค่า: this.params.contextMap().getOrThrow(contextKey).
Parameters
ContextKey<T> contextKey
ตัวอย่างใช้งาน
LootContext instance = ...;
ContextKey<T> contextKey = ...;
T result = instance.getParameter(contextKey);
net.minecraft.world.level.storage.loot.LootContext#getRandom()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:66 - Modifiers:
public - Return:
RandomSource
คืออะไร
อ่านค่า Random
ทำงานยังไง
คืนค่า: this.random.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootContext#getResolver()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:62 - Modifiers:
public - Return:
HolderGetter.Provider
คืออะไร
อ่านค่า Resolver
ทำงานยังไง
คืนค่า: this.lootDataResolver.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootContext#hasParameter(ContextKey<?>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:33 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี Parameter
ทำงานยังไง
เรียกต่อ: contextMap(), has(). คืนค่า: this.params.contextMap().has(contextKey).
Parameters
ContextKey<?> contextKey
ตัวอย่างใช้งาน
LootContext instance = ...;
ContextKey<?> contextKey = ...;
boolean result = instance.hasParameter(contextKey);
net.minecraft.world.level.storage.loot.LootContext#hasVisitedElement(LootContext.VisitedEntry<?>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:50 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี Visited Element
ทำงานยังไง
เรียกต่อ: contains(). คืนค่า: this.visitedElements.contains(visitedEntry).
Parameters
LootContext.VisitedEntry<?> visitedEntry
ตัวอย่างใช้งาน
LootContext instance = ...;
LootContext.VisitedEntry<?> visitedEntry = ...;
boolean result = instance.hasVisitedElement(visitedEntry);
net.minecraft.world.level.storage.loot.LootContext#popVisitedElement(LootContext.VisitedEntry<?>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:58 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ popVisitedElement ตาม implementation ของ LootContext
ทำงานยังไง
เรียกต่อ: remove().
Parameters
LootContext.VisitedEntry<?> visitedEntry
ตัวอย่างใช้งาน
LootContext instance = ...;
LootContext.VisitedEntry<?> visitedEntry = ...;
instance.popVisitedElement(visitedEntry);
net.minecraft.world.level.storage.loot.LootContext#pushVisitedElement(LootContext.VisitedEntry<?>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:54 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ pushVisitedElement ตาม implementation ของ LootContext
ทำงานยังไง
เรียกต่อ: add(). คืนค่า: this.visitedElements.add(visitedEntry).
Parameters
LootContext.VisitedEntry<?> visitedEntry
ตัวอย่างใช้งาน
LootContext instance = ...;
LootContext.VisitedEntry<?> visitedEntry = ...;
boolean result = instance.pushVisitedElement(visitedEntry);
LootContext$Builder
- Full name:
net.minecraft.world.level.storage.loot.LootContext$Builder - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootContext.java - Type:
class - Modifiers:
public static
net.minecraft.world.level.storage.loot.LootContext$Builder#Builder(LootParams)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:95 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ LootContext.Builder ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: params.
Parameters
LootParams lootParams
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootContext$Builder#create(Optional<ResourceLocation>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:116 - Modifiers:
public - Return:
LootContext
คืออะไร
สร้าง create
ทำงานยังไง
เรียกต่อ: getLevel(), getServer(), ofNullable(), or(), map(), orElseGet(), reloadableRegistries(), lookup(). สร้างออบเจ็กต์: LootContext. คืนค่า: new LootContext(this.params, randomSource, minecraftServer.reloadableRegistries().lookup()).
Parameters
Optional<ResourceLocation> optional
ตัวอย่างใช้งาน
LootContext.Builder instance = ...;
Optional<ResourceLocation> optional = ...;
LootContext result = instance.create(optional);
net.minecraft.world.level.storage.loot.LootContext$Builder#getLevel()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:112 - Modifiers:
public - Return:
ServerLevel
คืออะไร
อ่านค่า Level
ทำงานยังไง
คืนค่า: this.params.getLevel().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootContext$Builder#withOptionalRandomSeed(long)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:99 - Modifiers:
public - Return:
LootContext.Builder
คืออะไร
ดำเนินการ withOptionalRandomSeed ตาม implementation ของ LootContext$Builder
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. แก้ state: random. เรียกต่อ: create(). คืนค่า: this.
Parameters
long l
ตัวอย่างใช้งาน
LootContext.Builder instance = ...;
LootContext.Builder result = instance.withOptionalRandomSeed(0L);
net.minecraft.world.level.storage.loot.LootContext$Builder#withOptionalRandomSource(RandomSource)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:107 - Modifiers:
public - Return:
LootContext.Builder
คืออะไร
ดำเนินการ withOptionalRandomSource ตาม implementation ของ LootContext$Builder
ทำงานยังไง
แก้ state: random. คืนค่า: this.
Parameters
RandomSource randomSource
ตัวอย่างใช้งาน
LootContext.Builder instance = ...;
RandomSource randomSource = ...;
LootContext.Builder result = instance.withOptionalRandomSource(randomSource);
LootContext$EntityTarget
- Full name:
net.minecraft.world.level.storage.loot.LootContext$EntityTarget - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootContext.java - Type:
enum - Modifiers:
public - Implements:
StringRepresentable
net.minecraft.world.level.storage.loot.LootContext$EntityTarget#getByName(String)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:143 - Modifiers:
public static - Return:
LootContext.EntityTarget
คืออะไร
อ่านค่า By Name
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: byName(). สร้างออบเจ็กต์: IllegalArgumentException. คืนค่า: entityTarget.
Parameters
String string
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootContext$EntityTarget#getParam()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:139 - Modifiers:
public - Return:
ContextKey<? extends Entity>
คืออะไร
อ่านค่า Param
ทำงานยังไง
คืนค่า: this.param.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootContext$EntityTarget#getSerializedName()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContext.java:152 - Modifiers:
public - Return:
String
คืออะไร
อ่านค่า Serialized Name
ทำงานยังไง
คืนค่า: this.name.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
LootContextUser
- Full name:
net.minecraft.world.level.storage.loot.LootContextUser - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootContextUser.java - Type:
interface - Modifiers:
public
net.minecraft.world.level.storage.loot.LootContextUser#getReferencedContextParams()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContextUser.java:7 - Modifiers:
default - Return:
Set<ContextKey<?>>
คืออะไร
อ่านค่า Referenced Context Params
ทำงานยังไง
เรียกต่อ: of(). คืนค่า: Set.of().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootContextUser#validate(ValidationContext)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootContextUser.java:11 - Modifiers:
default - Return:
void
คืออะไร
ตรวจสอบความถูกต้อง validate
ทำงานยังไง
เรียกต่อ: validateContextUsage().
Parameters
ValidationContext validationContext
ตัวอย่างใช้งาน
LootContextUser instance = ...;
ValidationContext validationContext = ...;
instance.validate(validationContext);
LootDataType
- Full name:
net.minecraft.world.level.storage.loot.LootDataType - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootDataType.java - Type:
record - Modifiers:
public
net.minecraft.world.level.storage.loot.LootDataType#runValidation(ValidationContext,ResourceKey<T>,T)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootDataType.java:21 - Modifiers:
public - Return:
void
คืออะไร
สั่งทำงาน Validation
ทำงานยังไง
เรียกต่อ: run().
Parameters
ValidationContext validationContextResourceKey<T> resourceKeyT object
ตัวอย่างใช้งาน
LootDataType instance = ...;
ValidationContext validationContext = ...;
ResourceKey<T> resourceKey = ...;
T object = ...;
instance.runValidation(validationContext, resourceKey, object);
net.minecraft.world.level.storage.loot.LootDataType#values()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootDataType.java:25 - Modifiers:
public static - Return:
Stream<LootDataType<?>>
คืออะไร
ดำเนินการ values ตาม implementation ของ LootDataType
ทำงานยังไง
เรียกต่อ: of(). คืนค่า: Stream.of(PREDICATE, MODIFIER, TABLE).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
LootDataType$Validator
- Full name:
net.minecraft.world.level.storage.loot.LootDataType$Validator - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootDataType.java - Type:
interface - Modifiers:
public
net.minecraft.world.level.storage.loot.LootDataType$Validator#run(ValidationContext,ResourceKey<T>,T)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootDataType.java:43 - Modifiers: ``
- Return:
void
คืออะไร
สั่งทำงาน run
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
ValidationContext validationContextResourceKey<T> resourceKeyT object
ตัวอย่างใช้งาน
LootDataType.Validator instance = ...;
ValidationContext validationContext = ...;
ResourceKey<T> resourceKey = ...;
T object = ...;
instance.run(validationContext, resourceKey, object);
LootParams
- Full name:
net.minecraft.world.level.storage.loot.LootParams - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootParams.java - Type:
class - Modifiers:
public
net.minecraft.world.level.storage.loot.LootParams#addDynamicDrops(ResourceLocation,Consumer<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:35 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม Dynamic Drops
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: get(), add().
Parameters
ResourceLocation resourceLocationConsumer<ItemStack> consumer
ตัวอย่างใช้งาน
LootParams instance = ...;
ResourceLocation resourceLocation = ...;
Consumer<ItemStack> consumer = ...;
instance.addDynamicDrops(resourceLocation, consumer);
net.minecraft.world.level.storage.loot.LootParams#contextMap()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:31 - Modifiers:
public - Return:
ContextMap
คืออะไร
ดำเนินการ contextMap ตาม implementation ของ LootParams
ทำงานยังไง
คืนค่า: this.params.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootParams#getLevel()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:27 - Modifiers:
public - Return:
ServerLevel
คืออะไร
อ่านค่า Level
ทำงานยังไง
คืนค่า: this.level.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootParams#getLuck()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:42 - Modifiers:
public - Return:
float
คืออะไร
อ่านค่า Luck
ทำงานยังไง
คืนค่า: this.luck.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootParams#LootParams(ServerLevel,ContextMap,Map<ResourceLocation, LootParams.DynamicDrop>,float)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:20 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ LootParams ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: level, params, dynamicDrops, luck.
Parameters
ServerLevel serverLevelContextMap contextMapMap<ResourceLocation, LootParams.DynamicDrop> mapfloat f
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
ContextMap contextMap = ...;
Map<ResourceLocation, LootParams.DynamicDrop> map = ...;
LootParams instance = new LootParams(serverLevel, contextMap, map, 0.0F);
LootParams$Builder
- Full name:
net.minecraft.world.level.storage.loot.LootParams$Builder - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootParams.java - Type:
class - Modifiers:
public static
net.minecraft.world.level.storage.loot.LootParams$Builder#Builder(ServerLevel)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:52 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ LootParams.Builder ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
แก้ state: level.
Parameters
ServerLevel serverLevel
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootParams$Builder#create(ContextKeySet)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:93 - Modifiers:
public - Return:
LootParams
คืออะไร
สร้าง create
ทำงานยังไง
สร้างออบเจ็กต์: LootParams. คืนค่า: new LootParams(this.level, contextMap, this.dynamicDrops, this.luck).
Parameters
ContextKeySet contextKeySet
ตัวอย่างใช้งาน
LootParams.Builder instance = ...;
ContextKeySet contextKeySet = ...;
LootParams result = instance.create(contextKeySet);
net.minecraft.world.level.storage.loot.LootParams$Builder#getLevel()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:56 - Modifiers:
public - Return:
ServerLevel
คืออะไร
อ่านค่า Level
ทำงานยังไง
คืนค่า: this.level.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootParams$Builder#getOptionalParameter(ContextKey<T>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:74 - Modifiers:
public - Return:
T
คืออะไร
อ่านค่า Optional Parameter
ทำงานยังไง
คืนค่า: this.params.getOptionalParameter(contextKey).
Parameters
ContextKey<T> contextKey
ตัวอย่างใช้งาน
LootParams.Builder instance = ...;
ContextKey<T> contextKey = ...;
T result = instance.getOptionalParameter(contextKey);
net.minecraft.world.level.storage.loot.LootParams$Builder#getParameter(ContextKey<T>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:70 - Modifiers:
public - Return:
T
คืออะไร
อ่านค่า Parameter
ทำงานยังไง
คืนค่า: this.params.getParameter(contextKey).
Parameters
ContextKey<T> contextKey
ตัวอย่างใช้งาน
LootParams.Builder instance = ...;
ContextKey<T> contextKey = ...;
T result = instance.getParameter(contextKey);
net.minecraft.world.level.storage.loot.LootParams$Builder#withDynamicDrop(ResourceLocation,LootParams.DynamicDrop)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:79 - Modifiers:
public - Return:
LootParams.Builder
คืออะไร
ดำเนินการ withDynamicDrop ตาม implementation ของ LootParams$Builder
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: put(). สร้างออบเจ็กต์: IllegalStateException. คืนค่า: this.
Parameters
ResourceLocation resourceLocationLootParams.DynamicDrop dynamicDrop
ตัวอย่างใช้งาน
LootParams.Builder instance = ...;
ResourceLocation resourceLocation = ...;
LootParams.DynamicDrop dynamicDrop = ...;
LootParams.Builder result = instance.withDynamicDrop(resourceLocation, dynamicDrop);
net.minecraft.world.level.storage.loot.LootParams$Builder#withLuck(float)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:88 - Modifiers:
public - Return:
LootParams.Builder
คืออะไร
ดำเนินการ withLuck ตาม implementation ของ LootParams$Builder
ทำงานยังไง
แก้ state: luck. คืนค่า: this.
Parameters
float f
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootParams$Builder#withOptionalParameter(ContextKey<T>,T)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:65 - Modifiers:
public - Return:
LootParams.Builder
คืออะไร
ดำเนินการ withOptionalParameter ตาม implementation ของ LootParams$Builder
ทำงานยังไง
คืนค่า: this.
Parameters
ContextKey<T> contextKeyT object
ตัวอย่างใช้งาน
LootParams.Builder instance = ...;
ContextKey<T> contextKey = ...;
T object = ...;
LootParams.Builder result = instance.withOptionalParameter(contextKey, object);
net.minecraft.world.level.storage.loot.LootParams$Builder#withParameter(ContextKey<T>,T)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:60 - Modifiers:
public - Return:
LootParams.Builder
คืออะไร
ดำเนินการ withParameter ตาม implementation ของ LootParams$Builder
ทำงานยังไง
คืนค่า: this.
Parameters
ContextKey<T> contextKeyT object
ตัวอย่างใช้งาน
LootParams.Builder instance = ...;
ContextKey<T> contextKey = ...;
T object = ...;
LootParams.Builder result = instance.withParameter(contextKey, object);
LootParams$DynamicDrop
- Full name:
net.minecraft.world.level.storage.loot.LootParams$DynamicDrop - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootParams.java - Type:
interface - Modifiers:
public
net.minecraft.world.level.storage.loot.LootParams$DynamicDrop#add(Consumer<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootParams.java:101 - Modifiers: ``
- Return:
void
คืออะไร
เพิ่ม add
ทำงานยังไง
ไม่มี body ใน source declaration นี้
Parameters
Consumer<ItemStack> consumer
ตัวอย่างใช้งาน
LootPool
- Full name:
net.minecraft.world.level.storage.loot.LootPool - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootPool.java - Type:
class - Modifiers:
public
net.minecraft.world.level.storage.loot.LootPool#addRandomItems(Consumer<ItemStack>,LootContext)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootPool.java:93 - Modifiers:
public - Return:
void
คืออะไร
เพิ่ม Random Items
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: test(), decorate(), getInt(), floor(), getFloat(), getLuck(), addRandomItem().
Parameters
Consumer<ItemStack> consumerLootContext lootContext
ตัวอย่างใช้งาน
LootPool instance = ...;
Consumer<ItemStack> consumer = ...;
LootContext lootContext = ...;
instance.addRandomItems(consumer, lootContext);
net.minecraft.world.level.storage.loot.LootPool#lootPool()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootPool.java:121 - Modifiers:
public static - Return:
LootPool.Builder
คืออะไร
ดำเนินการ lootPool ตาม implementation ของ LootPool
ทำงานยังไง
เรียกต่อ: Builder(). สร้างออบเจ็กต์: LootPool.Builder. คืนค่า: new LootPool.Builder().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootPool#validate(ValidationContext)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootPool.java:104 - Modifiers:
public - Return:
void
คืออะไร
ตรวจสอบความถูกต้อง validate
ทำงานยังไง
มีการวนลูป. เรียกต่อ: size(), get(), forChild().
Parameters
ValidationContext validationContext
ตัวอย่างใช้งาน
LootPool instance = ...;
ValidationContext validationContext = ...;
instance.validate(validationContext);
LootPool$Builder
- Full name:
net.minecraft.world.level.storage.loot.LootPool$Builder - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootPool.java - Type:
class - Modifiers:
public static - Implements:
FunctionUserBuilder<LootPool.Builder>,ConditionUserBuilder<LootPool.Builder>,FabricLootPoolBuilder
net.minecraft.world.level.storage.loot.LootPool$Builder#add(LootPoolEntryContainer.Builder<?>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootPool.java:149 - Modifiers:
public - Return:
LootPool.Builder
คืออะไร
เพิ่ม add
ทำงานยังไง
เรียกต่อ: build(). คืนค่า: this.
Parameters
LootPoolEntryContainer.Builder<?> builder
ตัวอย่างใช้งาน
LootPool.Builder instance = ...;
LootPoolEntryContainer.Builder<?> builder = ...;
LootPool.Builder result = instance.add(builder);
net.minecraft.world.level.storage.loot.LootPool$Builder#apply(LootItemFunction.Builder)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootPool.java:159 - Modifiers:
public - Return:
LootPool.Builder
คืออะไร
นำไปใช้ apply
ทำงานยังไง
เรียกต่อ: add(), build(). คืนค่า: this.
Parameters
LootItemFunction.Builder builder
ตัวอย่างใช้งาน
LootPool.Builder instance = ...;
LootItemFunction.Builder builder = ...;
LootPool.Builder result = instance.apply(builder);
net.minecraft.world.level.storage.loot.LootPool$Builder#build()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootPool.java:164 - Modifiers:
public - Return:
LootPool
คืออะไร
สร้าง build
ทำงานยังไง
สร้างออบเจ็กต์: LootPool. คืนค่า: new LootPool(this.entries.build(), this.conditions.build(), this.functions.build(), this.rolls, this.bonusRolls).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootPool$Builder#setBonusRolls(NumberProvider)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootPool.java:144 - Modifiers:
public - Return:
LootPool.Builder
คืออะไร
กำหนดค่า Bonus Rolls
ทำงานยังไง
แก้ state: bonusRolls. คืนค่า: this.
Parameters
NumberProvider numberProvider
ตัวอย่างใช้งาน
LootPool.Builder instance = ...;
NumberProvider numberProvider = ...;
LootPool.Builder result = instance.setBonusRolls(numberProvider);
net.minecraft.world.level.storage.loot.LootPool$Builder#setRolls(NumberProvider)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootPool.java:135 - Modifiers:
public - Return:
LootPool.Builder
คืออะไร
กำหนดค่า Rolls
ทำงานยังไง
แก้ state: rolls. คืนค่า: this.
Parameters
NumberProvider numberProvider
ตัวอย่างใช้งาน
LootPool.Builder instance = ...;
NumberProvider numberProvider = ...;
LootPool.Builder result = instance.setRolls(numberProvider);
net.minecraft.world.level.storage.loot.LootPool$Builder#unwrap()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootPool.java:140 - Modifiers:
public - Return:
LootPool.Builder
คืออะไร
ดำเนินการ unwrap ตาม implementation ของ LootPool$Builder
ทำงานยังไง
คืนค่า: this.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootPool$Builder#when(LootItemCondition.Builder)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootPool.java:154 - Modifiers:
public - Return:
LootPool.Builder
คืออะไร
ดำเนินการ when ตาม implementation ของ LootPool$Builder
ทำงานยังไง
เรียกต่อ: add(), build(). คืนค่า: this.
Parameters
LootItemCondition.Builder builder
ตัวอย่างใช้งาน
LootPool.Builder instance = ...;
LootItemCondition.Builder builder = ...;
LootPool.Builder result = instance.when(builder);
LootTable
- Full name:
net.minecraft.world.level.storage.loot.LootTable - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootTable.java - Type:
class - Modifiers:
public
net.minecraft.world.level.storage.loot.LootTable#createStackSplitter(ServerLevel,Consumer<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:61 - Modifiers:
public static - Return:
Consumer<ItemStack>
คืออะไร
สร้าง Stack Splitter
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: isItemEnabled(), enabledFeatures(), getCount(), getMaxStackSize(), accept(), copyWithCount(), min().
Parameters
ServerLevel serverLevelConsumer<ItemStack> consumer
ตัวอย่างใช้งาน
ServerLevel serverLevel = ...;
Consumer<ItemStack> consumer = ...;
Consumer<ItemStack> result = LootTable.createStackSplitter(serverLevel, consumer);
net.minecraft.world.level.storage.loot.LootTable#fill(Container,LootParams,long)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:144 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ fill ตาม implementation ของ LootTable
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: Builder(), withOptionalRandomSeed(), create(), getRandomItems(), getRandom(), getAvailableSlots(), shuffleAndSplitItems(), size(). สร้างออบเจ็กต์: LootContext.Builder.
Parameters
Container containerLootParams lootParamslong l
ตัวอย่างใช้งาน
LootTable instance = ...;
Container container = ...;
LootParams lootParams = ...;
instance.fill(container, lootParams, 0L);
net.minecraft.world.level.storage.loot.LootTable#getParamSet()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:130 - Modifiers:
public - Return:
ContextKeySet
คืออะไร
อ่านค่า Param Set
ทำงานยังไง
คืนค่า: this.paramSet.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootTable#getRandomItems(LootContext,Consumer<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:108 - Modifiers:
public - Return:
void
คืออะไร
อ่านค่า Random Items
ทำงานยังไง
เรียกต่อ: getRandomItemsRaw(), createStackSplitter(), getLevel().
Parameters
LootContext lootContextConsumer<ItemStack> consumer
ตัวอย่างใช้งาน
LootTable instance = ...;
LootContext lootContext = ...;
Consumer<ItemStack> consumer = ...;
instance.getRandomItems(lootContext, consumer);
net.minecraft.world.level.storage.loot.LootTable#getRandomItems(LootParams)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:120 - Modifiers:
public - Return:
ObjectArrayList<ItemStack>
คืออะไร
อ่านค่า Random Items
ทำงานยังไง
เรียกต่อ: Builder(), create(). สร้างออบเจ็กต์: LootContext.Builder. คืนค่า: this.getRandomItems(new LootContext.Builder(lootParams).create(this.randomSequence)).
Parameters
LootParams lootParams
ตัวอย่างใช้งาน
LootTable instance = ...;
LootParams lootParams = ...;
ObjectArrayList<ItemStack> result = instance.getRandomItems(lootParams);
net.minecraft.world.level.storage.loot.LootTable#getRandomItems(LootParams,Consumer<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:104 - Modifiers:
public - Return:
void
คืออะไร
อ่านค่า Random Items
ทำงานยังไง
เรียกต่อ: getRandomItemsRaw(), createStackSplitter(), getLevel().
Parameters
LootParams lootParamsConsumer<ItemStack> consumer
ตัวอย่างใช้งาน
LootTable instance = ...;
LootParams lootParams = ...;
Consumer<ItemStack> consumer = ...;
instance.getRandomItems(lootParams, consumer);
net.minecraft.world.level.storage.loot.LootTable#getRandomItems(LootParams,long)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:116 - Modifiers:
public - Return:
ObjectArrayList<ItemStack>
คืออะไร
อ่านค่า Random Items
ทำงานยังไง
เรียกต่อ: Builder(), withOptionalRandomSeed(), create(). สร้างออบเจ็กต์: LootContext.Builder. คืนค่า: this.getRandomItems(new LootContext.Builder(lootParams).withOptionalRandomSeed(l).create(this.randomSequence)).
Parameters
LootParams lootParamslong l
ตัวอย่างใช้งาน
LootTable instance = ...;
LootParams lootParams = ...;
ObjectArrayList<ItemStack> result = instance.getRandomItems(lootParams, 0L);
net.minecraft.world.level.storage.loot.LootTable#getRandomItems(LootParams,long,Consumer<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:98 - Modifiers:
public - Return:
void
คืออะไร
อ่านค่า Random Items
ทำงานยังไง
เรียกต่อ: getRandomItemsRaw(), Builder(), withOptionalRandomSeed(), create(), createStackSplitter(), getLevel(). สร้างออบเจ็กต์: LootContext.Builder.
Parameters
LootParams lootParamslong lConsumer<ItemStack> consumer
ตัวอย่างใช้งาน
LootTable instance = ...;
LootParams lootParams = ...;
Consumer<ItemStack> consumer = ...;
instance.getRandomItems(lootParams, 0L, consumer);
net.minecraft.world.level.storage.loot.LootTable#getRandomItems(LootParams,RandomSource)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:112 - Modifiers:
public - Return:
ObjectArrayList<ItemStack>
คืออะไร
อ่านค่า Random Items
ทำงานยังไง
เรียกต่อ: Builder(), withOptionalRandomSource(), create(). สร้างออบเจ็กต์: LootContext.Builder. คืนค่า: this.getRandomItems(new LootContext.Builder(lootParams).withOptionalRandomSource(randomSource).create(this.randomSequence)).
Parameters
LootParams lootParamsRandomSource randomSource
ตัวอย่างใช้งาน
LootTable instance = ...;
LootParams lootParams = ...;
RandomSource randomSource = ...;
ObjectArrayList<ItemStack> result = instance.getRandomItems(lootParams, randomSource);
net.minecraft.world.level.storage.loot.LootTable#getRandomItemsRaw(LootContext,Consumer<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:83 - Modifiers:
public - Return:
void
คืออะไร
อ่านค่า Random Items Raw
ทำงานยังไง
ตรวจเงื่อนไขด้วย if ; มีการวนลูป. เรียกต่อ: createVisitedEntry(), pushVisitedElement(), decorate(), addRandomItems(), popVisitedElement(), warn().
Parameters
LootContext lootContextConsumer<ItemStack> consumer
ตัวอย่างใช้งาน
LootTable instance = ...;
LootContext lootContext = ...;
Consumer<ItemStack> consumer = ...;
instance.getRandomItemsRaw(lootContext, consumer);
net.minecraft.world.level.storage.loot.LootTable#getRandomItemsRaw(LootParams,Consumer<ItemStack>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:79 - Modifiers:
public - Return:
void
คืออะไร
อ่านค่า Random Items Raw
ทำงานยังไง
เรียกต่อ: Builder(), create(). สร้างออบเจ็กต์: LootContext.Builder.
Parameters
LootParams lootParamsConsumer<ItemStack> consumer
ตัวอย่างใช้งาน
LootTable instance = ...;
LootParams lootParams = ...;
Consumer<ItemStack> consumer = ...;
instance.getRandomItemsRaw(lootParams, consumer);
net.minecraft.world.level.storage.loot.LootTable#lootTable()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:213 - Modifiers:
public static - Return:
LootTable.Builder
คืออะไร
ดำเนินการ lootTable ตาม implementation ของ LootTable
ทำงานยังไง
เรียกต่อ: Builder(). สร้างออบเจ็กต์: LootTable.Builder. คืนค่า: new LootTable.Builder().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootTable#validate(ValidationContext)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:134 - Modifiers:
public - Return:
void
คืออะไร
ตรวจสอบความถูกต้อง validate
ทำงานยังไง
มีการวนลูป. เรียกต่อ: size(), get(), forChild().
Parameters
ValidationContext validationContext
ตัวอย่างใช้งาน
LootTable instance = ...;
ValidationContext validationContext = ...;
instance.validate(validationContext);
LootTable$Builder
- Full name:
net.minecraft.world.level.storage.loot.LootTable$Builder - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/LootTable.java - Type:
class - Modifiers:
public static - Implements:
FunctionUserBuilder<LootTable.Builder>,FabricLootTableBuilder
net.minecraft.world.level.storage.loot.LootTable$Builder#apply(LootItemFunction.Builder)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:241 - Modifiers:
public - Return:
LootTable.Builder
คืออะไร
นำไปใช้ apply
ทำงานยังไง
เรียกต่อ: add(), build(). คืนค่า: this.
Parameters
LootItemFunction.Builder builder
ตัวอย่างใช้งาน
LootTable.Builder instance = ...;
LootItemFunction.Builder builder = ...;
LootTable.Builder result = instance.apply(builder);
net.minecraft.world.level.storage.loot.LootTable$Builder#build()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:250 - Modifiers:
public - Return:
LootTable
คืออะไร
สร้าง build
ทำงานยังไง
สร้างออบเจ็กต์: LootTable. คืนค่า: new LootTable(this.paramSet, this.randomSequence, this.pools.build(), this.functions.build()).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootTable$Builder#setParamSet(ContextKeySet)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:231 - Modifiers:
public - Return:
LootTable.Builder
คืออะไร
กำหนดค่า Param Set
ทำงานยังไง
แก้ state: paramSet. คืนค่า: this.
Parameters
ContextKeySet contextKeySet
ตัวอย่างใช้งาน
LootTable.Builder instance = ...;
ContextKeySet contextKeySet = ...;
LootTable.Builder result = instance.setParamSet(contextKeySet);
net.minecraft.world.level.storage.loot.LootTable$Builder#setRandomSequence(ResourceLocation)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:236 - Modifiers:
public - Return:
LootTable.Builder
คืออะไร
กำหนดค่า Random Sequence
ทำงานยังไง
แก้ state: randomSequence. เรียกต่อ: of(). คืนค่า: this.
Parameters
ResourceLocation resourceLocation
ตัวอย่างใช้งาน
LootTable.Builder instance = ...;
ResourceLocation resourceLocation = ...;
LootTable.Builder result = instance.setRandomSequence(resourceLocation);
net.minecraft.world.level.storage.loot.LootTable$Builder#unwrap()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:246 - Modifiers:
public - Return:
LootTable.Builder
คืออะไร
ดำเนินการ unwrap ตาม implementation ของ LootTable$Builder
ทำงานยังไง
คืนค่า: this.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.LootTable$Builder#withPool(LootPool.Builder)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/LootTable.java:226 - Modifiers:
public - Return:
LootTable.Builder
คืออะไร
ดำเนินการ withPool ตาม implementation ของ LootTable$Builder
ทำงานยังไง
เรียกต่อ: add(), build(). คืนค่า: this.
Parameters
LootPool.Builder builder
ตัวอย่างใช้งาน
LootTable.Builder instance = ...;
LootPool.Builder builder = ...;
LootTable.Builder result = instance.withPool(builder);
ValidationContext
- Full name:
net.minecraft.world.level.storage.loot.ValidationContext - Package:
net.minecraft.world.level.storage.loot - Source:
common—net/minecraft/world/level/storage/loot/ValidationContext.java - Type:
class - Modifiers:
public
net.minecraft.world.level.storage.loot.ValidationContext#allowsReferences()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ValidationContext.java:63 - Modifiers:
public - Return:
boolean
คืออะไร
ดำเนินการ allowsReferences ตาม implementation ของ ValidationContext
ทำงานยังไง
เรียกต่อ: isPresent(). คืนค่า: this.resolver.isPresent().
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.ValidationContext#enterElement(String,ResourceKey<?>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ValidationContext.java:38 - Modifiers:
public - Return:
ValidationContext
คืออะไร
ดำเนินการ enterElement ตาม implementation ของ ValidationContext
ทำงานยังไง
เรียกต่อ: builder(), addAll(), add(), build(), forChild(). สร้างออบเจ็กต์: ValidationContext. คืนค่า: new ValidationContext(this.reporter.forChild(string), this.contextKeySet, this.resolver, set).
Parameters
String stringResourceKey<?> resourceKey
ตัวอย่างใช้งาน
ValidationContext instance = ...;
ResourceKey<?> resourceKey = ...;
ValidationContext result = instance.enterElement("value", resourceKey);
net.minecraft.world.level.storage.loot.ValidationContext#forChild(String)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ValidationContext.java:34 - Modifiers:
public - Return:
ValidationContext
คืออะไร
ดำเนินการ forChild ตาม implementation ของ ValidationContext
ทำงานยังไง
สร้างออบเจ็กต์: ValidationContext. คืนค่า: new ValidationContext(this.reporter.forChild(string), this.contextKeySet, this.resolver, this.visitedElements).
Parameters
String string
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.ValidationContext#hasVisitedElement(ResourceKey<?>)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ValidationContext.java:43 - Modifiers:
public - Return:
boolean
คืออะไร
ตรวจสอบว่ามี Visited Element
ทำงานยังไง
เรียกต่อ: contains(). คืนค่า: this.visitedElements.contains(resourceKey).
Parameters
ResourceKey<?> resourceKey
ตัวอย่างใช้งาน
ValidationContext instance = ...;
ResourceKey<?> resourceKey = ...;
boolean result = instance.hasVisitedElement(resourceKey);
net.minecraft.world.level.storage.loot.ValidationContext#reporter()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ValidationContext.java:71 - Modifiers:
public - Return:
ProblemReporter
คืออะไร
ดำเนินการ reporter ตาม implementation ของ ValidationContext
ทำงานยังไง
คืนค่า: this.reporter.
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.ValidationContext#reportProblem(String)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ValidationContext.java:47 - Modifiers:
public - Return:
void
คืออะไร
ดำเนินการ reportProblem ตาม implementation ของ ValidationContext
ทำงานยังไง
เรียกต่อ: report().
Parameters
String string
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.ValidationContext#resolver()
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ValidationContext.java:59 - Modifiers:
public - Return:
HolderGetter.Provider
คืออะไร
ดำเนินการ resolver ตาม implementation ของ ValidationContext
ทำงานยังไง
เรียกต่อ: orElseThrow(). สร้างออบเจ็กต์: UnsupportedOperationException. คืนค่า: this.resolver.orElseThrow(() -> new UnsupportedOperationException("References not allowed")).
Parameters
- ไม่มี
ตัวอย่างใช้งาน
net.minecraft.world.level.storage.loot.ValidationContext#setContextKeySet(ContextKeySet)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ValidationContext.java:67 - Modifiers:
public - Return:
ValidationContext
คืออะไร
กำหนดค่า Context Key Set
ทำงานยังไง
สร้างออบเจ็กต์: ValidationContext. คืนค่า: new ValidationContext(this.reporter, contextKeySet, this.resolver, this.visitedElements).
Parameters
ContextKeySet contextKeySet
ตัวอย่างใช้งาน
ValidationContext instance = ...;
ContextKeySet contextKeySet = ...;
ValidationContext result = instance.setContextKeySet(contextKeySet);
net.minecraft.world.level.storage.loot.ValidationContext#validateContextUsage(LootContextUser)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ValidationContext.java:51 - Modifiers:
public - Return:
void
คืออะไร
ตรวจสอบความถูกต้อง Context Usage
ทำงานยังไง
ตรวจเงื่อนไขด้วย if. เรียกต่อ: getReferencedContextParams(), difference(), allowed(), isEmpty(), report().
Parameters
LootContextUser lootContextUser
ตัวอย่างใช้งาน
ValidationContext instance = ...;
LootContextUser lootContextUser = ...;
instance.validateContextUsage(lootContextUser);
net.minecraft.world.level.storage.loot.ValidationContext#ValidationContext(ProblemReporter,ContextKeySet)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ValidationContext.java:23 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ValidationContext ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: empty(), of().
Parameters
ProblemReporter problemReporterContextKeySet contextKeySet
ตัวอย่างใช้งาน
ProblemReporter problemReporter = ...;
ContextKeySet contextKeySet = ...;
ValidationContext instance = new ValidationContext(problemReporter, contextKeySet);
net.minecraft.world.level.storage.loot.ValidationContext#ValidationContext(ProblemReporter,ContextKeySet,HolderGetter.Provider)
- Origin:
common - Source:
net/minecraft/world/level/storage/loot/ValidationContext.java:19 - Modifiers:
public - Kind: constructor
คืออะไร
สร้างออบเจ็กต์ ValidationContext ด้วยพารามิเตอร์ที่ระบุ
ทำงานยังไง
เรียกต่อ: of().
Parameters
ProblemReporter problemReporterContextKeySet contextKeySetHolderGetter.Provider provider
ตัวอย่างใช้งาน
ProblemReporter problemReporter = ...;
ContextKeySet contextKeySet = ...;
HolderGetter.Provider provider = ...;
ValidationContext instance = new ValidationContext(problemReporter, contextKeySet, provider);