SPIGOT-323: Enchanting tables can no longer be force opened.
By: md_5 <git@md-5.net>
This commit is contained in:
parent
885c16fc03
commit
79f99b0c7a
1 changed files with 9 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
package org.bukkit.craftbukkit.entity;
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import net.minecraft.server.*;
|
import net.minecraft.server.*;
|
||||||
|
@ -284,7 +285,15 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
|
||||||
return getHandle().activeContainer.getBukkitView();
|
return getHandle().activeContainer.getBukkitView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InventoryView openEnchanting(Location location) {
|
||||||
|
return openEnchanting(location, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public InventoryView openEnchanting(Location location, boolean force) {
|
public InventoryView openEnchanting(Location location, boolean force) {
|
||||||
|
Preconditions.checkArgument(!force, "Cannot force open enchanting tables!");
|
||||||
|
|
||||||
if (!force) {
|
if (!force) {
|
||||||
Block block = location.getBlock();
|
Block block = location.getBlock();
|
||||||
if (block.getType() != Material.ENCHANTMENT_TABLE) {
|
if (block.getType() != Material.ENCHANTMENT_TABLE) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue