Loot and block drops ask the Loot and BlockDrops services

EngineBukkitOps, WorldObjectPlacer and WorldBlockDropRouter no longer read loot classes: the modules name the tables and
return resolved ItemDrops, which BukkitItemStacks creates. LootResolver keeps the generic stream helpers; table
resolution moved to LootTables in iris:loot. IrisLootEvent carries the Loot sources.
This commit is contained in:
piexel committed 2026-10-09 22:02:47 +02:00
1 parent 8137f6dba9
commit 946ad61f7f
22 files changed
+714 -261

No files matched your search

@@ -20,6 +20,7 @@ package art.arcane.iris.modded;
import art.arcane.iris.spi.PlatformItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import java.util.concurrent.ConcurrentHashMap;
@@ -55,4 +56,9 @@ public final class ModdedItem implements PlatformItem {
public Object nativeHandle() {
return item;
}
@Override
public int maxDurability() {
return new ItemStack(item).getMaxDamage();
}
}
@@ -19,6 +19,7 @@
package art.arcane.iris.modded;
import art.arcane.iris.engine.framework.LootResolver;
import art.arcane.iris.engine.loot.LootTables;
import art.arcane.iris.engine.object.loot.InventorySlotType;
import art.arcane.iris.engine.object.entity.IrisAttributeModifier;
import art.arcane.iris.engine.object.loot.IrisEnchantment;
@@ -80,7 +81,7 @@ public final class ModdedItemTranslator {
return out;
}
RNG rng = LootResolver.tableRng(lootSeed, table, x, y, z);
RNG rng = LootTables.rng(lootSeed, table, x, y, z);
int m = 0;
int c = 0;
int mx = Math.max(0, LootResolver.inclusive(rng, table.getMinPicked(), table.getMaxPicked()));
@@ -118,7 +119,7 @@ public final class ModdedItemTranslator {
public static ItemStack item(IrisLoot loot, IrisLootTable table, RNG rng, long lootSeed, int entryIndex, ServerLevel level, int x, int y, int z) {
long combinedRarity = LootResolver.combinedRarity(loot.getRarity(), table.getRarity());
if (!LootResolver.spatialOneIn(lootSeed, table, entryIndex, x, y, z, combinedRarity)) {
if (!LootTables.spatialOneIn(lootSeed, table, entryIndex, x, y, z, combinedRarity)) {
return null;
}
@@ -23,6 +23,7 @@ import art.arcane.iris.engine.object.loot.IrisObjectVanillaLoot;
import art.arcane.iris.engine.object.placement.IrisObjectPlacement;
import art.arcane.iris.engine.framework.Engine;
import art.arcane.iris.engine.framework.LootResolver;
import art.arcane.iris.engine.loot.LootTables;
import art.arcane.iris.engine.framework.PlacedObject;
import art.arcane.iris.engine.object.loot.IObjectLoot;
import art.arcane.iris.engine.object.loot.InventorySlotType;
@@ -121,7 +122,7 @@ public final class ModdedLootApplier {
}
}
LootResolver.resolveEnvironmentSources(
LootTables.resolveEnvironmentSources(
sources,
engine,
rng,