From 68e1830d8e42b0123813ad0de8c171b845187b79 Mon Sep 17 00:00:00 2001 From: Daniel Mills Date: Wed, 21 Oct 2020 11:01:59 -0400 Subject: [PATCH] Fix std loot --- .../iris/command/CommandIrisStudioLoot.java | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/volmit/iris/command/CommandIrisStudioLoot.java b/src/main/java/com/volmit/iris/command/CommandIrisStudioLoot.java index b6a7c7c1f..952c61307 100644 --- a/src/main/java/com/volmit/iris/command/CommandIrisStudioLoot.java +++ b/src/main/java/com/volmit/iris/command/CommandIrisStudioLoot.java @@ -47,10 +47,36 @@ public class CommandIrisStudioLoot extends MortarCommand return true; } + try + { + if(Iris.proj.getActiveProject().getActiveProvider().getGlUpdate() == null) + { + sender.sendMessage("You can only use /iris loot in a studio world of iris."); + return true; + } + } + + catch(Throwable e) + { + sender.sendMessage("You can only use /iris loot in a studio world of iris."); + return true; + } + prov.initGLUpdate(); KList tables = prov.getGlUpdate().getLootTables(RNG.r, p.getLocation().getBlock()); Inventory inv = Bukkit.createInventory(null, 27 * 2); - Iris.proj.getActiveProject().getActiveProvider().getGlUpdate().addItems(true, inv, RNG.r, tables, InventorySlotType.STORAGE, p.getLocation().getBlockX(), p.getLocation().getBlockY(), p.getLocation().getBlockZ(), 1); + + try + { + Iris.proj.getActiveProject().getActiveProvider().getGlUpdate().addItems(true, inv, RNG.r, tables, InventorySlotType.STORAGE, p.getLocation().getBlockX(), p.getLocation().getBlockY(), p.getLocation().getBlockZ(), 1); + } + + catch(Throwable e) + { + sender.sendMessage("You can only use /iris loot in a studio world of iris."); + return true; + } + p.openInventory(inv); for(IrisLootTable i : tables)