Fixed enchanting in Creative. Fixes BUKKIT-1119

Dieser Commit ist enthalten in:
EvilSeph 2012-03-10 15:39:29 -05:00
Ursprung 77ef051095
Commit 68c89fcac9

Datei anzeigen

@ -18,9 +18,8 @@ import org.bukkit.entity.Player;
public class ContainerEnchantTable extends Container { public class ContainerEnchantTable extends Container {
// CraftBukkit start - make type specific (changed from IInventory) // CraftBukkit - make type specific (changed from IInventory)
public ContainerEnchantTableInventory enchantSlots = new ContainerEnchantTableInventory(this, "Enchant", 1); public ContainerEnchantTableInventory enchantSlots = new ContainerEnchantTableInventory(this, "Enchant", 1);
// CraftBukkit end
private World world; private World world;
private int x; private int x;
private int y; private int y;
@ -163,7 +162,7 @@ public class ContainerEnchantTable extends Container {
this.world.getServer().getPluginManager().callEvent(event); this.world.getServer().getPluginManager().callEvent(event);
int level = event.getExpLevelCost(); int level = event.getExpLevelCost();
if (event.isCancelled() || (level > entityhuman.expLevel) || enchants.isEmpty()) { if (event.isCancelled() || (level > entityhuman.expLevel && !entityhuman.abilities.canInstantlyBuild) || enchants.isEmpty()) {
return false; return false;
} }
entityhuman.levelDown(level); entityhuman.levelDown(level);