summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/ContainerAnvil.java
diff options
context:
space:
mode:
authorNate Mortensen <nate.richard.mortensen@gmail.com>2013-07-01 06:03:00 -0500
committerWesley Wolfe <weswolf@aol.com>2013-07-01 12:10:06 -0500
commit6c09066e224ac85b8a6464eaf8f53edfeb4beda4 (patch)
tree573e05f4b148cb1891a1d3839175e501e6257442 /src/main/java/net/minecraft/server/ContainerAnvil.java
parentf887b76a259e12468b28d82d1eced93f0b73bd6d (diff)
downloadcraftbukkit-6c09066e224ac85b8a6464eaf8f53edfeb4beda4.tar
craftbukkit-6c09066e224ac85b8a6464eaf8f53edfeb4beda4.tar.gz
craftbukkit-6c09066e224ac85b8a6464eaf8f53edfeb4beda4.tar.lz
craftbukkit-6c09066e224ac85b8a6464eaf8f53edfeb4beda4.tar.xz
craftbukkit-6c09066e224ac85b8a6464eaf8f53edfeb4beda4.zip
Update CraftBukkit to 1.6.1
Diffstat (limited to 'src/main/java/net/minecraft/server/ContainerAnvil.java')
-rw-r--r--src/main/java/net/minecraft/server/ContainerAnvil.java29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java
index d7cee91d..9b73555c 100644
--- a/src/main/java/net/minecraft/server/ContainerAnvil.java
+++ b/src/main/java/net/minecraft/server/ContainerAnvil.java
@@ -3,6 +3,8 @@ package net.minecraft.server;
import java.util.Iterator;
import java.util.Map;
+import org.apache.commons.lang3.StringUtils;
+
import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit
public class ContainerAnvil extends Container {
@@ -13,8 +15,8 @@ public class ContainerAnvil extends Container {
private int i;
private int j;
private int k;
- public int a = 0;
- private int l = 0;
+ public int a;
+ private int l;
private String m;
private final EntityHuman n;
// CraftBukkit start
@@ -202,7 +204,13 @@ public class ContainerAnvil extends Container {
}
}
- if (this.m != null && this.m.length() > 0 && !this.m.equalsIgnoreCase(this.n.getLocale().c(itemstack.a())) && !this.m.equals(itemstack.getName())) {
+ if (StringUtils.isBlank(this.m)) {
+ if (itemstack.hasName()) {
+ j = itemstack.g() ? 7 : itemstack.count * 5;
+ i += j;
+ itemstack1.t();
+ }
+ } else if (!this.m.equals(itemstack.getName())) {
j = itemstack.g() ? 7 : itemstack.count * 5;
i += j;
if (itemstack.hasName()) {
@@ -260,7 +268,6 @@ public class ContainerAnvil extends Container {
}
if (j == i && j > 0 && this.a >= 40) {
- // this.h.getLogger().info("Naming an item only, cost too high; giving discount to cap cost to 39 levels"); // CraftBukkit - remove debug
this.a = 39;
}
@@ -319,7 +326,7 @@ public class ContainerAnvil extends Container {
ItemStack itemstack = null;
Slot slot = (Slot) this.c.get(i);
- if (slot != null && slot.d()) {
+ if (slot != null && slot.e()) {
ItemStack itemstack1 = slot.getItem();
itemstack = itemstack1.cloneItemStack();
@@ -340,7 +347,7 @@ public class ContainerAnvil extends Container {
if (itemstack1.count == 0) {
slot.set((ItemStack) null);
} else {
- slot.e();
+ slot.f();
}
if (itemstack1.count == itemstack.count) {
@@ -355,8 +362,14 @@ public class ContainerAnvil extends Container {
public void a(String s) {
this.m = s;
- if (this.getSlot(2).d()) {
- this.getSlot(2).getItem().c(this.m);
+ if (this.getSlot(2).e()) {
+ ItemStack itemstack = this.getSlot(2).getItem();
+
+ if (StringUtils.isBlank(s)) {
+ itemstack.t();
+ } else {
+ itemstack.c(this.m);
+ }
}
this.e();