mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 18:37:35 +01:00
Fixed enchanting in Creative. Fixes BUKKIT-1119
This commit is contained in:
parent
77ef051095
commit
68c89fcac9
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user