Fixup luck and random implementation in CB loot-tables (#11926)

This commit is contained in:
FlorianMichael
2025-02-16 22:06:01 +01:00
committed by GitHub
parent b27e11cce6
commit 88cdd22076
2 changed files with 11 additions and 12 deletions

View File

@@ -24,13 +24,14 @@
}
public void fill(Container container, LootParams params, long seed) {
- LootContext lootContext = new LootContext.Builder(params).withOptionalRandomSeed(seed).create(this.randomSequence);
+ // CraftBukkit start
+ this.fillInventory(container, params, seed, false);
+ this.fill(container, params, seed == 0L ? null : RandomSource.create(seed), false);
+ }
+
+ public void fillInventory(Container container, LootParams params, long seed, boolean plugin) {
+ public void fill(Container container, LootParams params, RandomSource randomSource, boolean plugin) {
+ // CraftBukkit end
LootContext lootContext = new LootContext.Builder(params).withOptionalRandomSeed(seed).create(this.randomSequence);
+ LootContext lootContext = new LootContext.Builder(params).withOptionalRandomSource(randomSource).create(this.randomSequence);
ObjectArrayList<ItemStack> randomItems = this.getRandomItems(lootContext);
RandomSource random = lootContext.getRandom();
+ // CraftBukkit start