mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-11 12:31:34 +01:00
Update upstream B/CB/S
This commit is contained in:
parent
5eebb50cf2
commit
4ea87e5378
4 changed files with 16 additions and 15 deletions
|
@ -1,4 +1,4 @@
|
|||
From 532022b01bd12414fe58ce5f93a919ac47a59667 Mon Sep 17 00:00:00 2001
|
||||
From 1fc3e056ef00e598274783495e7f732f1933e5b1 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Thu, 28 May 2015 23:00:19 -0400
|
||||
Subject: [PATCH] Handle Item Meta Inconsistencies
|
||||
|
@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the
|
|||
ItemMeta API equivalents, and should deprecate the old API's.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index 866e54d..46baf00 100644
|
||||
index 0ce23f0..9ae05b3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -4,6 +4,7 @@ import static org.bukkit.craftbukkit.inventory.CraftMetaItem.ENCHANTMENTS;
|
||||
|
@ -144,7 +144,7 @@ index 866e54d..46baf00 100644
|
|||
|
||||
static Map<Enchantment, Integer> getEnchantments(net.minecraft.server.ItemStack item) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 22cc267..94f2ba0 100644
|
||||
index 4b70495..e91ca49 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -6,13 +6,8 @@ import java.lang.annotation.RetentionPolicy;
|
||||
|
@ -182,7 +182,7 @@ index 22cc267..94f2ba0 100644
|
|||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import net.minecraft.server.NBTCompressedStreamTools;
|
||||
@@ -222,13 +224,13 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
@@ -222,14 +224,14 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
|
||||
private String displayName;
|
||||
private List<String> lore;
|
||||
|
@ -190,6 +190,7 @@ index 22cc267..94f2ba0 100644
|
|||
+ private EnchantmentMap enchantments; // Paper
|
||||
private int repairCost;
|
||||
private int hideFlag;
|
||||
private boolean unbreakable;
|
||||
|
||||
private static final Set<String> HANDLED_TAGS = Sets.newHashSet();
|
||||
|
||||
|
@ -198,7 +199,7 @@ index 22cc267..94f2ba0 100644
|
|||
|
||||
CraftMetaItem(CraftMetaItem meta) {
|
||||
if (meta == null) {
|
||||
@@ -242,7 +244,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
@@ -243,7 +245,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
}
|
||||
|
||||
if (meta.enchantments != null) { // Spigot
|
||||
|
@ -207,8 +208,8 @@ index 22cc267..94f2ba0 100644
|
|||
}
|
||||
|
||||
this.repairCost = meta.repairCost;
|
||||
@@ -457,13 +459,13 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
// Spigot end
|
||||
@@ -455,13 +457,13 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
}
|
||||
}
|
||||
|
||||
- static Map<Enchantment, Integer> buildEnchantments(NBTTagCompound tag, ItemMetaKey key) {
|
||||
|
@ -223,7 +224,7 @@ index 22cc267..94f2ba0 100644
|
|||
|
||||
for (int i = 0; i < ench.size(); i++) {
|
||||
int id = 0xffff & ((NBTTagCompound) ench.get(i)).getShort(ENCHANTMENTS_ID.NBT);
|
||||
@@ -536,13 +538,13 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
@@ -531,13 +533,13 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
void deserializeInternal(NBTTagCompound tag) {
|
||||
}
|
||||
|
||||
|
@ -239,7 +240,7 @@ index 22cc267..94f2ba0 100644
|
|||
for (Map.Entry<?, ?> entry : ench.entrySet()) {
|
||||
Enchantment enchantment = Enchantment.getByName(entry.getKey().toString());
|
||||
|
||||
@@ -672,12 +674,12 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
@@ -663,12 +665,12 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
}
|
||||
|
||||
public Map<Enchantment, Integer> getEnchants() {
|
||||
|
@ -254,7 +255,7 @@ index 22cc267..94f2ba0 100644
|
|||
}
|
||||
|
||||
if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) {
|
||||
@@ -835,7 +837,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
@@ -836,7 +838,7 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
clone.lore = new ArrayList<String>(this.lore);
|
||||
}
|
||||
if (this.enchantments != null) {
|
||||
|
@ -262,8 +263,8 @@ index 22cc267..94f2ba0 100644
|
|||
+ clone.enchantments = new EnchantmentMap(this.enchantments); // Paper
|
||||
}
|
||||
clone.hideFlag = this.hideFlag;
|
||||
return clone;
|
||||
@@ -991,6 +993,28 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
clone.unbreakable = this.unbreakable;
|
||||
@@ -989,6 +991,28 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 5037da9d4c088c32d235647c7ff37e4ad573926d
|
||||
Subproject commit d986a3f774df1628dcfbd25730dfdbfe4471a447
|
|
@ -1 +1 @@
|
|||
Subproject commit 691628ab5cc38c77b9c1a9bd884c7ce40b96373c
|
||||
Subproject commit b5b0a97d44df120d69b6102b7b1f702c8b917cd3
|
|
@ -1 +1 @@
|
|||
Subproject commit 261f18109ea6338aa7a5dfe34fbb87e87945b8e5
|
||||
Subproject commit 0f17cfb6c463710def7e7ea8b9b93d91df09231c
|
Loading…
Reference in a new issue