From 9784338acff089ad16bc6399fca13fe83d0a371a Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 5 Jan 2015 09:59:31 +1100 Subject: [PATCH] SPIGOT-323: Enchanting tables can no longer be force opened. --- .../org/bukkit/craftbukkit/entity/CraftHumanEntity.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index f045e1c73b..f5cfdcb162 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.entity; +import com.google.common.base.Preconditions; import java.util.Set; import net.minecraft.server.*; @@ -284,7 +285,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { return getHandle().activeContainer.getBukkitView(); } + @Override + public InventoryView openEnchanting(Location location) { + return openEnchanting(location, false); + } + + @Override public InventoryView openEnchanting(Location location, boolean force) { + Preconditions.checkArgument(!force, "Cannot force open enchanting tables!"); + if (!force) { Block block = location.getBlock(); if (block.getType() != Material.ENCHANTMENT_TABLE) {