@@ -1,11 +1,10 @@
|
||||
--- a/net/minecraft/server/ContainerEnchantTable.java
|
||||
+++ b/net/minecraft/server/ContainerEnchantTable.java
|
||||
@@ -3,6 +3,21 @@
|
||||
@@ -3,6 +3,20 @@
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.Collections;
|
||||
+import java.util.Map;
|
||||
+import org.bukkit.Location;
|
||||
+import org.bukkit.NamespacedKey;
|
||||
@@ -22,7 +21,7 @@
|
||||
public class ContainerEnchantTable extends Container {
|
||||
|
||||
private final IInventory enchantSlots;
|
||||
@@ -12,6 +27,10 @@
|
||||
@@ -12,6 +26,10 @@
|
||||
public final int[] costs;
|
||||
public final int[] enchantments;
|
||||
public final int[] levels;
|
||||
@@ -33,7 +32,7 @@
|
||||
|
||||
public ContainerEnchantTable(int i, PlayerInventory playerinventory) {
|
||||
this(i, playerinventory, ContainerAccess.a);
|
||||
@@ -25,6 +44,13 @@
|
||||
@@ -25,6 +43,13 @@
|
||||
super.update();
|
||||
ContainerEnchantTable.this.a((IInventory) this);
|
||||
}
|
||||
@@ -47,7 +46,7 @@
|
||||
};
|
||||
this.h = new Random();
|
||||
this.i = ContainerProperty.a();
|
||||
@@ -72,6 +98,9 @@
|
||||
@@ -72,6 +97,9 @@
|
||||
this.a(ContainerProperty.a(this.levels, 0));
|
||||
this.a(ContainerProperty.a(this.levels, 1));
|
||||
this.a(ContainerProperty.a(this.levels, 2));
|
||||
@@ -57,7 +56,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,7 +108,7 @@
|
||||
@@ -79,7 +107,7 @@
|
||||
if (iinventory == this.enchantSlots) {
|
||||
ItemStack itemstack = iinventory.getItem(0);
|
||||
|
||||
@@ -66,7 +65,7 @@
|
||||
this.containerAccess.a((world, blockposition) -> {
|
||||
int i = 0;
|
||||
|
||||
@@ -135,12 +164,47 @@
|
||||
@@ -135,12 +163,47 @@
|
||||
if (list != null && !list.isEmpty()) {
|
||||
WeightedRandomEnchant weightedrandomenchant = (WeightedRandomEnchant) list.get(this.h.nextInt(list.size()));
|
||||
|
||||
@@ -115,7 +114,7 @@
|
||||
this.c();
|
||||
});
|
||||
} else {
|
||||
@@ -167,9 +231,24 @@
|
||||
@@ -167,9 +230,24 @@
|
||||
ItemStack itemstack2 = itemstack;
|
||||
List<WeightedRandomEnchant> list = this.a(itemstack, i, this.costs[i]);
|
||||
|
||||
@@ -142,7 +141,7 @@
|
||||
|
||||
if (flag) {
|
||||
itemstack2 = new ItemStack(Items.ENCHANTED_BOOK);
|
||||
@@ -182,16 +261,29 @@
|
||||
@@ -182,16 +260,29 @@
|
||||
this.enchantSlots.setItem(0, itemstack2);
|
||||
}
|
||||
|
||||
@@ -178,7 +177,7 @@
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
itemstack1.subtract(j);
|
||||
if (itemstack1.isEmpty()) {
|
||||
@@ -238,6 +330,7 @@
|
||||
@@ -238,6 +329,7 @@
|
||||
|
||||
@Override
|
||||
public boolean canUse(EntityHuman entityhuman) {
|
||||
@@ -186,7 +185,7 @@
|
||||
return a(this.containerAccess, entityhuman, Blocks.ENCHANTING_TABLE);
|
||||
}
|
||||
|
||||
@@ -289,4 +382,17 @@
|
||||
@@ -289,4 +381,17 @@
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user