mirror of
https://github.com/PaperMC/Paper.git
synced 2025-09-03 13:53:51 -07:00
Minecraft 1.9.4
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/server/ContainerEnchantTable.java
|
||||
+++ b/net/minecraft/server/ContainerEnchantTable.java
|
||||
@@ -3,9 +3,22 @@
|
||||
import java.util.List;
|
||||
@@ -4,9 +4,22 @@
|
||||
import java.util.Random;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.Map;
|
||||
@@ -24,7 +24,7 @@
|
||||
public int getMaxStackSize() {
|
||||
return 64;
|
||||
}
|
||||
@@ -14,6 +27,11 @@
|
||||
@@ -15,6 +28,11 @@
|
||||
super.update();
|
||||
ContainerEnchantTable.this.a((IInventory) this);
|
||||
}
|
||||
@@ -36,7 +36,7 @@
|
||||
};
|
||||
private World world;
|
||||
private BlockPosition position;
|
||||
@@ -22,6 +40,10 @@
|
||||
@@ -23,6 +41,10 @@
|
||||
public int[] costs = new int[3];
|
||||
public int[] h = new int[] { -1, -1, -1};
|
||||
public int[] i = new int[] { -1, -1, -1};
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
public ContainerEnchantTable(PlayerInventory playerinventory, World world, BlockPosition blockposition) {
|
||||
this.world = world;
|
||||
@@ -54,6 +76,9 @@
|
||||
@@ -55,6 +77,9 @@
|
||||
this.a(new Slot(playerinventory, i, 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
}
|
||||
|
||||
protected void c(ICrafting icrafting) {
|
||||
@@ -90,7 +115,7 @@
|
||||
@@ -91,7 +116,7 @@
|
||||
ItemStack itemstack = iinventory.getItem(0);
|
||||
int i;
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
if (!this.world.isClientSide) {
|
||||
i = 0;
|
||||
|
||||
@@ -139,6 +164,20 @@
|
||||
@@ -140,6 +165,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
for (j = 0; j < 3; ++j) {
|
||||
if (this.costs[j] > 0) {
|
||||
List list = this.a(itemstack, j, this.costs[j]);
|
||||
@@ -175,24 +214,55 @@
|
||||
@@ -176,24 +215,55 @@
|
||||
} else if (this.costs[i] > 0 && itemstack != null && (entityhuman.expLevel >= j && entityhuman.expLevel >= this.costs[i] || entityhuman.abilities.canInstantlyBuild)) {
|
||||
if (!this.world.isClientSide) {
|
||||
List list = this.a(itemstack, i, this.costs[i]);
|
||||
@@ -150,7 +150,7 @@
|
||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||
itemstack1.count -= j;
|
||||
if (itemstack1.count <= 0) {
|
||||
@@ -226,6 +296,11 @@
|
||||
@@ -227,6 +297,11 @@
|
||||
|
||||
public void b(EntityHuman entityhuman) {
|
||||
super.b(entityhuman);
|
||||
@@ -162,7 +162,7 @@
|
||||
if (!this.world.isClientSide) {
|
||||
for (int i = 0; i < this.enchantSlots.getSize(); ++i) {
|
||||
ItemStack itemstack = this.enchantSlots.splitWithoutUpdate(i);
|
||||
@@ -239,6 +314,7 @@
|
||||
@@ -240,6 +315,7 @@
|
||||
}
|
||||
|
||||
public boolean a(EntityHuman entityhuman) {
|
||||
@@ -170,7 +170,7 @@
|
||||
return this.world.getType(this.position).getBlock() != Blocks.ENCHANTING_TABLE ? false : entityhuman.e((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D) <= 64.0D;
|
||||
}
|
||||
|
||||
@@ -291,4 +367,17 @@
|
||||
@@ -293,4 +369,17 @@
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
|
Reference in New Issue
Block a user