Archiviert
13
0

Made books less powerful, though you should still read them!

Dieser Commit ist enthalten in:
EvilSeph 2012-10-27 20:44:11 -04:00
Ursprung bd6c824c11
Commit df7f86d028
2 geänderte Dateien mit 15 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -329,4 +329,14 @@ public final class ItemStack {
public boolean hasEnchantments() { public boolean hasEnchantments() {
return this.tag != null && this.tag.hasKey("ench"); return this.tag != null && this.tag.hasKey("ench");
} }
// CraftBukkit start - temporary method for book fix
public void a(String s, NBTBase nbtbase) {
if (this.tag == null) {
this.setTag(new NBTTagCompound());
}
this.tag.set(s, nbtbase);
}
// CraftBukkit end
} }

Datei anzeigen

@ -1426,7 +1426,11 @@ public class NetServerHandler extends NetHandler {
itemstack1 = this.player.inventory.getItemInHand(); itemstack1 = this.player.inventory.getItemInHand();
if (itemstack != null && itemstack.id == Item.WRITTEN_BOOK.id && itemstack1.id == Item.BOOK_AND_QUILL.id) { if (itemstack != null && itemstack.id == Item.WRITTEN_BOOK.id && itemstack1.id == Item.BOOK_AND_QUILL.id) {
itemstack1.setTag(itemstack.getTag()); // CraftBukkit start
itemstack1.a("author", new NBTTagString("author", this.player.name));
itemstack1.a("title", new NBTTagString("title", itemstack.getTag().getString("title")));
itemstack1.a("pages", itemstack.getTag().getList("pages"));
// CraftBukkit end
itemstack1.id = Item.WRITTEN_BOOK.id; itemstack1.id = Item.WRITTEN_BOOK.id;
} }
} catch (Exception exception1) { } catch (Exception exception1) {