mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 04:33:56 -07:00
Update CraftBukkit to 1.6.1
This commit is contained in:
committed by
Wesley Wolfe
parent
f887b76a25
commit
6c09066e22
@@ -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();
|
||||
|
Reference in New Issue
Block a user