@@ -61,7 +61,7 @@
|
||||
@Override
|
||||
public boolean mayPlace(ItemStack itemstack) {
|
||||
return itemstack.is(Items.LAPIS_LAZULI);
|
||||
@@ -101,6 +125,9 @@
|
||||
@@ -89,6 +113,9 @@
|
||||
this.addDataSlot(ContainerProperty.shared(this.levelClue, 0));
|
||||
this.addDataSlot(ContainerProperty.shared(this.levelClue, 1));
|
||||
this.addDataSlot(ContainerProperty.shared(this.levelClue, 2));
|
||||
@@ -71,16 +71,16 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,7 +135,7 @@
|
||||
@@ -96,7 +123,7 @@
|
||||
if (iinventory == this.enchantSlots) {
|
||||
ItemStack itemstack = iinventory.getItem(0);
|
||||
|
||||
- if (!itemstack.isEmpty() && itemstack.isEnchantable()) {
|
||||
+ if (!itemstack.isEmpty()) { // CraftBukkit - relax condition
|
||||
this.access.execute((world, blockposition) -> {
|
||||
Registry<Holder<Enchantment>> registry = world.registryAccess().registryOrThrow(Registries.ENCHANTMENT).asHolderIdMap();
|
||||
Registry<Holder<Enchantment>> registry = world.registryAccess().lookupOrThrow(Registries.ENCHANTMENT).asHolderIdMap();
|
||||
int i = 0;
|
||||
@@ -148,6 +175,41 @@
|
||||
@@ -136,6 +163,41 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,14 +122,14 @@
|
||||
this.broadcastChanges();
|
||||
});
|
||||
} else {
|
||||
@@ -175,21 +237,46 @@
|
||||
@@ -163,21 +225,46 @@
|
||||
ItemStack itemstack2 = itemstack;
|
||||
List<WeightedRandomEnchant> list = this.getEnchantmentList(world.registryAccess(), itemstack, i, this.costs[i]);
|
||||
|
||||
- if (!list.isEmpty()) {
|
||||
- entityhuman.onEnchantmentPerformed(itemstack, j);
|
||||
+ // CraftBukkit start
|
||||
+ Registry<Holder<Enchantment>> registry = world.registryAccess().registryOrThrow(Registries.ENCHANTMENT).asHolderIdMap();
|
||||
+ Registry<Holder<Enchantment>> registry = world.registryAccess().lookupOrThrow(Registries.ENCHANTMENT).asHolderIdMap();
|
||||
+ if (true || !list.isEmpty()) {
|
||||
+ // entityhuman.onEnchantmentPerformed(itemstack, j); // Moved down
|
||||
+ Map<org.bukkit.enchantments.Enchantment, Integer> enchants = new java.util.HashMap<org.bukkit.enchantments.Enchantment, Integer>();
|
||||
@@ -175,7 +175,7 @@
|
||||
itemstack1.consume(j, entityhuman);
|
||||
if (itemstack1.isEmpty()) {
|
||||
this.enchantSlots.setItem(1, ItemStack.EMPTY);
|
||||
@@ -256,6 +343,7 @@
|
||||
@@ -244,6 +331,7 @@
|
||||
|
||||
@Override
|
||||
public boolean stillValid(EntityHuman entityhuman) {
|
||||
@@ -183,7 +183,7 @@
|
||||
return stillValid(this.access, entityhuman, Blocks.ENCHANTING_TABLE);
|
||||
}
|
||||
|
||||
@@ -306,4 +394,17 @@
|
||||
@@ -294,4 +382,17 @@
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user