diff --git a/core/src/main/java/com/volmit/iris/core/commands/CommandStudio.java b/core/src/main/java/com/volmit/iris/core/commands/CommandStudio.java index 7227b431d..824177705 100644 --- a/core/src/main/java/com/volmit/iris/core/commands/CommandStudio.java +++ b/core/src/main/java/com/volmit/iris/core/commands/CommandStudio.java @@ -306,7 +306,7 @@ public class CommandStudio implements DecreeExecutor { Inventory inv = Bukkit.createInventory(null, 27 * 2); try { - engine().addItems(true, inv, RNG.r, tables, InventorySlotType.STORAGE, player().getLocation().getBlockX(), player().getLocation().getBlockY(), player().getLocation().getBlockZ(), 1); + engine().addItems(true, inv, RNG.r, tables, InventorySlotType.STORAGE, player().getWorld(), player().getLocation().getBlockX(), player().getLocation().getBlockY(), player().getLocation().getBlockZ(), 1); } catch (Throwable e) { Iris.reportError(e); sender().sendMessage(C.RED + "Cannot add items to virtual inventory because of: " + e.getMessage()); @@ -329,7 +329,7 @@ public class CommandStudio implements DecreeExecutor { inv.clear(); } - engine().addItems(true, inv, new RNG(RNG.r.imax()), tables, InventorySlotType.STORAGE, player().getLocation().getBlockX(), player().getLocation().getBlockY(), player().getLocation().getBlockZ(), 1); + engine().addItems(true, inv, new RNG(RNG.r.imax()), tables, InventorySlotType.STORAGE, player().getWorld(), player().getLocation().getBlockX(), player().getLocation().getBlockY(), player().getLocation().getBlockZ(), 1); }, 0, fast ? 5 : 35)); sender().sendMessage(C.GREEN + "Opening inventory now!"); diff --git a/core/src/main/java/com/volmit/iris/core/nms/v1X/NMSBinding1X.java b/core/src/main/java/com/volmit/iris/core/nms/v1X/NMSBinding1X.java index 0db2e294b..cb156dc65 100644 --- a/core/src/main/java/com/volmit/iris/core/nms/v1X/NMSBinding1X.java +++ b/core/src/main/java/com/volmit/iris/core/nms/v1X/NMSBinding1X.java @@ -19,6 +19,7 @@ package com.volmit.iris.core.nms.v1X; import com.volmit.iris.Iris; +import com.volmit.iris.core.nms.IMemoryWorld; import com.volmit.iris.core.nms.INMSBinding; import com.volmit.iris.core.nms.container.BiomeColor; import com.volmit.iris.core.nms.container.BlockPos; @@ -42,6 +43,7 @@ import org.bukkit.inventory.ItemStack; import java.awt.*; import java.awt.Color; +import java.io.IOException; public class NMSBinding1X implements INMSBinding { private static final boolean supportsCustomHeight = testCustomHeight(); @@ -120,6 +122,11 @@ public class NMSBinding1X implements INMSBinding { return new KList<>(list); } + @Override + public IMemoryWorld createMemoryWorld(NamespacedKey levelType, WorldCreator creator) throws IOException { + throw new IOException("Unsupported version!"); + } + @Override public CompoundTag serializeEntity(Entity location) { return null; diff --git a/core/src/main/java/com/volmit/iris/engine/framework/Engine.java b/core/src/main/java/com/volmit/iris/engine/framework/Engine.java index 43aff0686..22c0ed567 100644 --- a/core/src/main/java/com/volmit/iris/engine/framework/Engine.java +++ b/core/src/main/java/com/volmit/iris/engine/framework/Engine.java @@ -386,7 +386,7 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat if (tables.isEmpty()) return; InventoryHolder m = (InventoryHolder) block.getState(); - addItems(false, m.getInventory(), rx, tables, slot, x, y, z, 15); + addItems(false, m.getInventory(), rx, tables, slot, c.getWorld(), x, y, z, 15); } catch (Throwable e) { Iris.reportError(e); diff --git a/core/src/main/java/com/volmit/iris/engine/framework/LootProvider.java b/core/src/main/java/com/volmit/iris/engine/framework/LootProvider.java index b24f2e3ae..c8d48e43b 100644 --- a/core/src/main/java/com/volmit/iris/engine/framework/LootProvider.java +++ b/core/src/main/java/com/volmit/iris/engine/framework/LootProvider.java @@ -23,6 +23,7 @@ import com.volmit.iris.engine.object.IrisLootReference; import com.volmit.iris.engine.object.IrisLootTable; import com.volmit.iris.util.collection.KList; import com.volmit.iris.util.math.RNG; +import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.inventory.Inventory; @@ -33,5 +34,5 @@ public interface LootProvider { KList getLootTables(RNG rng, Block b); - void addItems(boolean debug, Inventory inv, RNG rng, KList tables, InventorySlotType slot, int x, int y, int z, int mgf); + void addItems(boolean debug, Inventory inv, RNG rng, KList tables, InventorySlotType slot, World world, int x, int y, int z, int mgf); } diff --git a/core/src/main/java/com/volmit/iris/engine/framework/placer/WorldObjectPlacer.java b/core/src/main/java/com/volmit/iris/engine/framework/placer/WorldObjectPlacer.java index 974f1c4ec..86d2b24cf 100644 --- a/core/src/main/java/com/volmit/iris/engine/framework/placer/WorldObjectPlacer.java +++ b/core/src/main/java/com/volmit/iris/engine/framework/placer/WorldObjectPlacer.java @@ -77,7 +77,7 @@ public class WorldObjectPlacer implements IObjectPlacer { if (tables.isEmpty()) return; InventoryHolder m = (InventoryHolder) block.getState(); - engine.addItems(false, m.getInventory(), rx, tables, slot, x, y, z, 15); + engine.addItems(false, m.getInventory(), rx, tables, slot, world, x, y, z, 15); } catch (Throwable e) { Iris.reportError(e); }