Created
July 9, 2014 15:55
-
-
Save frymaster/88f30faac8bd34975816 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/src/com/martinbrook/tesseractuhc/listeners/SpectateListener.java | |
+++ b/src/com/martinbrook/tesseractuhc/listeners/SpectateListener.java | |
@@ -25,6 +25,8 @@ import org.bukkit.inventory.DoubleChestInventory; | |
import org.bukkit.inventory.Inventory; | |
import org.bukkit.inventory.InventoryHolder; | |
import org.bukkit.inventory.ItemStack; | |
+import org.bukkit.block.Chest; | |
+import org.bukkit.block.DoubleChest; | |
import com.martinbrook.tesseractuhc.MatchPhase; | |
import com.martinbrook.tesseractuhc.UhcMatch; | |
@@ -128,6 +130,8 @@ public class SpectateListener implements Listener { | |
InventoryHolder invh = (InventoryHolder) e.getClickedBlock().getState(); | |
Inventory inv = invh.getInventory(); | |
+ e.setCancelled(true); | |
+ if (! (invh instanceof DoubleChest || invh instanceof Chest)) return; | |
ItemStack[] contents = inv.getContents(); | |
for (int i = 0; i < contents.length; ++i) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment