bunch more general fixes
This commit is contained in:
parent
1de01302d4
commit
16d7d73bd5
13 changed files with 504 additions and 40 deletions
|
@ -12,7 +12,7 @@ public net.minecraft.server.RegistryLayer STATIC_ACCESS
|
|||
|
||||
diff --git a/src/main/java/io/papermc/paper/registry/PaperRegistries.java b/src/main/java/io/papermc/paper/registry/PaperRegistries.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..b5df90b500a64ee3ba1026fa3449ca6441293367
|
||||
index 0000000000000000000000000000000000000000..9657c35ffbcc12061b394b97c97224e699c99b4f
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/io/papermc/paper/registry/PaperRegistries.java
|
||||
@@ -0,0 +1,152 @@
|
||||
|
@ -108,6 +108,7 @@ index 0000000000000000000000000000000000000000..b5df90b500a64ee3ba1026fa3449ca64
|
|||
+ entry(Registries.FLUID, RegistryKey.FLUID, Fluid.class, CraftFluid::new),
|
||||
+
|
||||
+ // data-drivens
|
||||
+ entry(Registries.BIOME, RegistryKey.BIOME, Biome.class, CraftBiome::new).delayed(),
|
||||
+ entry(Registries.STRUCTURE, RegistryKey.STRUCTURE, Structure.class, CraftStructure::new).delayed(),
|
||||
+ entry(Registries.TRIM_MATERIAL, RegistryKey.TRIM_MATERIAL, TrimMaterial.class, CraftTrimMaterial::new).delayed(),
|
||||
+ entry(Registries.TRIM_PATTERN, RegistryKey.TRIM_PATTERN, TrimPattern.class, CraftTrimPattern::new).delayed(),
|
||||
|
@ -116,7 +117,6 @@ index 0000000000000000000000000000000000000000..b5df90b500a64ee3ba1026fa3449ca64
|
|||
+ entry(Registries.ENCHANTMENT, RegistryKey.ENCHANTMENT, Enchantment.class, CraftEnchantment::new).withSerializationUpdater(FieldRename.ENCHANTMENT_RENAME).delayed(),
|
||||
+ entry(Registries.JUKEBOX_SONG, RegistryKey.JUKEBOX_SONG, JukeboxSong.class, CraftJukeboxSong::new).delayed(),
|
||||
+ entry(Registries.BANNER_PATTERN, RegistryKey.BANNER_PATTERN, PatternType.class, CraftPatternType::new).delayed(),
|
||||
+ entry(Registries.BIOME, RegistryKey.BIOME, Biome.class, CraftBiome::new).delayed(),
|
||||
+
|
||||
+ // api-only
|
||||
+ apiOnly(Registries.PAINTING_VARIANT, RegistryKey.PAINTING_VARIANT, () -> org.bukkit.Registry.ART),
|
||||
|
|
|
@ -1049,7 +1049,7 @@ index 566d893a413fd04b99e83dc2da8fe958a48492a8..a944803771d514572f94b4e98a6d4435
|
|||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec532cc0d9ba 100644
|
||||
index 14aab3a2adfde7a236610be2b928651bc01067f5..71d0ade48d450b76be9cb396ac613fa4c783679e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -199,9 +199,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
@ -1177,7 +1177,15 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
if (lore == null) {
|
||||
this.lore = null;
|
||||
} else {
|
||||
@@ -1596,6 +1603,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1420,6 +1427,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Override
|
||||
public void setEnchantable(Integer data) {
|
||||
+ Preconditions.checkArgument(data > 0, "Enchantability must be > 0");
|
||||
this.enchantableValue = data;
|
||||
}
|
||||
|
||||
@@ -1596,6 +1604,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Override
|
||||
public void setUseRemainder(ItemStack useRemainder) {
|
||||
|
@ -1185,7 +1193,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
this.useRemainder = useRemainder;
|
||||
}
|
||||
|
||||
@@ -1606,7 +1614,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1606,7 +1615,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Override
|
||||
public UseCooldownComponent getUseCooldown() {
|
||||
|
@ -1194,7 +1202,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -1692,7 +1700,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1692,7 +1701,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Override
|
||||
public Multimap<Attribute, AttributeModifier> getAttributeModifiers(@Nullable EquipmentSlot slot) {
|
||||
|
@ -1203,7 +1211,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
SetMultimap<Attribute, AttributeModifier> result = LinkedHashMultimap.create();
|
||||
for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) {
|
||||
if (entry.getValue().getSlot() == null || entry.getValue().getSlot() == slot) {
|
||||
@@ -1705,6 +1713,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1705,6 +1714,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@Override
|
||||
public Collection<AttributeModifier> getAttributeModifiers(@Nonnull Attribute attribute) {
|
||||
Preconditions.checkNotNull(attribute, "Attribute cannot be null");
|
||||
|
@ -1211,7 +1219,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
return this.attributeModifiers.containsKey(attribute) ? ImmutableList.copyOf(this.attributeModifiers.get(attribute)) : null;
|
||||
}
|
||||
|
||||
@@ -1712,22 +1721,33 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1712,22 +1722,33 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
public boolean addAttributeModifier(@Nonnull Attribute attribute, @Nonnull AttributeModifier modifier) {
|
||||
Preconditions.checkNotNull(attribute, "Attribute cannot be null");
|
||||
Preconditions.checkNotNull(modifier, "AttributeModifier cannot be null");
|
||||
|
@ -1249,7 +1257,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
|
||||
Iterator<Map.Entry<Attribute, AttributeModifier>> iterator = attributeModifiers.entries().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1737,6 +1757,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1737,6 +1758,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
|
@ -1257,7 +1265,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
this.attributeModifiers.put(next.getKey(), next.getValue());
|
||||
}
|
||||
}
|
||||
@@ -1744,13 +1765,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1744,13 +1766,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@Override
|
||||
public boolean removeAttributeModifier(@Nonnull Attribute attribute) {
|
||||
Preconditions.checkNotNull(attribute, "Attribute cannot be null");
|
||||
|
@ -1273,7 +1281,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
int removed = 0;
|
||||
Iterator<Map.Entry<Attribute, AttributeModifier>> iter = this.attributeModifiers.entries().iterator();
|
||||
|
||||
@@ -1770,7 +1791,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1770,7 +1792,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
public boolean removeAttributeModifier(@Nonnull Attribute attribute, @Nonnull AttributeModifier modifier) {
|
||||
Preconditions.checkNotNull(attribute, "Attribute cannot be null");
|
||||
Preconditions.checkNotNull(modifier, "AttributeModifier cannot be null");
|
||||
|
@ -1282,7 +1290,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
int removed = 0;
|
||||
Iterator<Map.Entry<Attribute, AttributeModifier>> iter = this.attributeModifiers.entries().iterator();
|
||||
|
||||
@@ -1792,7 +1813,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1792,7 +1814,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Override
|
||||
public String getAsString() {
|
||||
|
@ -1291,7 +1299,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
this.applyToItem(tag);
|
||||
DataComponentPatch patch = tag.build();
|
||||
net.minecraft.nbt.Tag nbt = DataComponentPatch.CODEC.encodeStart(MinecraftServer.getDefaultRegistryAccess().createSerializationContext(NbtOps.INSTANCE), patch).getOrThrow();
|
||||
@@ -1801,7 +1822,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1801,7 +1823,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Override
|
||||
public String getAsComponentString() {
|
||||
|
@ -1300,7 +1308,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
this.applyToItem(tag);
|
||||
DataComponentPatch patch = tag.build();
|
||||
|
||||
@@ -1841,6 +1862,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1841,6 +1863,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
if (first == null || second == null) {
|
||||
return false;
|
||||
}
|
||||
|
@ -1308,7 +1316,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
for (Map.Entry<Attribute, AttributeModifier> entry : first.entries()) {
|
||||
if (!second.containsEntry(entry.getKey(), entry.getValue())) {
|
||||
return false;
|
||||
@@ -1856,19 +1878,33 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1856,19 +1879,33 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Override
|
||||
public boolean hasDamage() {
|
||||
|
@ -1344,7 +1352,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
@Override
|
||||
public boolean hasMaxDamage() {
|
||||
return this.maxDamage != null;
|
||||
@@ -1882,6 +1918,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1882,6 +1919,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
@Override
|
||||
public void setMaxDamage(Integer maxDamage) {
|
||||
|
@ -1352,7 +1360,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
this.maxDamage = maxDamage;
|
||||
}
|
||||
|
||||
@@ -1914,7 +1951,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1914,7 +1952,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
&& (this.hasEnchantable() ? that.hasEnchantable() && this.enchantableValue.equals(that.enchantableValue) : !that.hasEnchantable())
|
||||
&& (this.hasBlockData() ? that.hasBlockData() && this.blockData.equals(that.blockData) : !that.hasBlockData())
|
||||
&& (this.hasRepairCost() ? that.hasRepairCost() && this.repairCost == that.repairCost : !that.hasRepairCost())
|
||||
|
@ -1361,7 +1369,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
&& (this.unhandledTags.equals(that.unhandledTags))
|
||||
&& (this.removedTags.equals(that.removedTags))
|
||||
&& (Objects.equals(this.customTag, that.customTag))
|
||||
@@ -1935,7 +1972,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1935,7 +1973,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
&& (this.hasTool() ? that.hasTool() && this.tool.equals(that.tool) : !that.hasTool())
|
||||
&& (this.hasEquippable() ? that.hasEquippable() && this.equippable.equals(that.equippable) : !that.hasEquippable())
|
||||
&& (this.hasJukeboxPlayable() ? that.hasJukeboxPlayable() && this.jukebox.equals(that.jukebox) : !that.hasJukeboxPlayable())
|
||||
|
@ -1370,7 +1378,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
&& (this.hasMaxDamage() ? that.hasMaxDamage() && this.maxDamage.equals(that.maxDamage) : !that.hasMaxDamage())
|
||||
&& (this.canPlaceOnPredicates != null ? that.canPlaceOnPredicates != null && this.canPlaceOnPredicates.equals(that.canPlaceOnPredicates) : that.canPlaceOnPredicates == null) // Paper
|
||||
&& (this.canBreakPredicates != null ? that.canBreakPredicates != null && this.canBreakPredicates.equals(that.canBreakPredicates) : that.canBreakPredicates == null) // Paper
|
||||
@@ -1988,9 +2025,9 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1988,9 +2026,9 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
hash = 61 * hash + (this.hasTool() ? this.tool.hashCode() : 0);
|
||||
hash = 61 * hash + (this.hasJukeboxPlayable() ? this.jukebox.hashCode() : 0);
|
||||
hash = 61 * hash + (this.hasEquippable() ? this.equippable.hashCode() : 0);
|
||||
|
@ -1383,7 +1391,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
hash = 61 * hash + (this.canPlaceOnPredicates != null ? this.canPlaceOnPredicates.hashCode() : 0); // Paper
|
||||
hash = 61 * hash + (this.canBreakPredicates != null ? this.canBreakPredicates.hashCode() : 0); // Paper
|
||||
hash = 61 * hash + this.version;
|
||||
@@ -2011,7 +2048,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -2011,7 +2049,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
if (this.enchantments != null) {
|
||||
clone.enchantments = new EnchantmentMap(this.enchantments); // Paper
|
||||
}
|
||||
|
@ -1392,7 +1400,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
|
||||
}
|
||||
if (this.customTag != null) {
|
||||
@@ -2178,7 +2215,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -2178,7 +2216,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
builder.put(CraftMetaItem.JUKEBOX_PLAYABLE.BUKKIT, this.jukebox);
|
||||
}
|
||||
|
||||
|
@ -1401,7 +1409,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
builder.put(CraftMetaItem.DAMAGE.BUKKIT, this.damage);
|
||||
}
|
||||
|
||||
@@ -2279,7 +2316,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -2279,7 +2317,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
}
|
||||
|
||||
static void serializeModifiers(Multimap<Attribute, AttributeModifier> modifiers, ImmutableMap.Builder<String, Object> builder, ItemMetaKey key) {
|
||||
|
@ -1410,7 +1418,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
return;
|
||||
}
|
||||
|
||||
@@ -2361,7 +2398,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -2361,7 +2399,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
// Paper start - improve checking handled tags
|
||||
@org.jetbrains.annotations.VisibleForTesting
|
||||
public static final Map<Class<? extends CraftMetaItem>, Set<DataComponentType<?>>> HANDLED_DCTS_PER_TYPE = new HashMap<>();
|
||||
|
@ -1419,7 +1427,7 @@ index 14aab3a2adfde7a236610be2b928651bc01067f5..5eb1f0126c3d3bca9bf3e769bec4ec53
|
|||
CraftMetaItem.NAME.TYPE,
|
||||
CraftMetaItem.ITEM_NAME.TYPE,
|
||||
CraftMetaItem.LORE.TYPE,
|
||||
@@ -2437,7 +2474,12 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -2437,7 +2475,12 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
// Paper end - improve checking handled data component types
|
||||
|
||||
protected static <T> Optional<? extends T> getOrEmpty(DataComponentPatch tag, ItemMetaKeyType<T> type) {
|
||||
|
@ -1606,7 +1614,7 @@ index b118d8ecb505d187c02bb158f14df333f487a87f..fa1d1a7f37aadf2750f03a0e215fb25f
|
|||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java
|
||||
index 6f0eebcaffa20337cf5a7f8485f891c690d948ae..18dc2e83dab0821e5129bd68361de189363823b3 100644
|
||||
index 6f0eebcaffa20337cf5a7f8485f891c690d948ae..49690dab508b07f9f56b2fb21eeb5f20172b5bd3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java
|
||||
@@ -38,7 +38,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
||||
|
@ -1651,6 +1659,14 @@ index 6f0eebcaffa20337cf5a7f8485f891c690d948ae..18dc2e83dab0821e5129bd68361de189
|
|||
}
|
||||
|
||||
@Override
|
||||
@@ -317,6 +317,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta {
|
||||
|
||||
@Override
|
||||
public void setCustomName(String customName) {
|
||||
+ Preconditions.checkArgument(customName == null || customName.length() <= 32767, "Custom name is longer than 32767 characters");
|
||||
this.customName = customName;
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaShield.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaShield.java
|
||||
index 967d8940aec0065bce496d5d7a8c73de5733bd2c..e229ca6acb6dbc3185f326f6653b3d66d835a9e5 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaShield.java
|
||||
|
|
|
@ -52,10 +52,10 @@ index e62baea16df017f1e394e3c706157e158066eb93..656c9a6d8cd42891141ee29ec91ab5d1
|
|||
throw new IllegalArgumentException("Could not get slot " + slot + " - not a valid slot for PlayerInventory");
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index a6e2281bfac94f1e19836d9c8415d8270387b16d..a4d6c95e55722c9a0e381d7b84916787240cea8e 100644
|
||||
index 71d0ade48d450b76be9cb396ac613fa4c783679e..b24857e34d87ea4fa9aa0db0ba684014c2625cc1 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -1703,7 +1703,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1704,7 +1704,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
if (this.attributeModifiers == null) return LinkedHashMultimap.create(); // Paper - don't change the components
|
||||
SetMultimap<Attribute, AttributeModifier> result = LinkedHashMultimap.create();
|
||||
for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) {
|
||||
|
@ -64,7 +64,7 @@ index a6e2281bfac94f1e19836d9c8415d8270387b16d..a4d6c95e55722c9a0e381d7b84916787
|
|||
result.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
@@ -1777,9 +1777,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -1778,9 +1778,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
|
||||
while (iter.hasNext()) {
|
||||
Map.Entry<Attribute, AttributeModifier> entry = iter.next();
|
||||
|
|
|
@ -5,7 +5,7 @@ Subject: [PATCH] Add registry entry and builders
|
|||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/registry/PaperRegistries.java b/src/main/java/io/papermc/paper/registry/PaperRegistries.java
|
||||
index 36bc8d005de14622eb8a0bf4736d964276c95344..3ad1ba8c14fe3745cedcbbd9bb28dad36eb6c7bb 100644
|
||||
index 3c48848a2628d07c470425d1c70d10b45db346a1..97fceb4de04d6756bd9b18b650e3325f21854f40 100644
|
||||
--- a/src/main/java/io/papermc/paper/registry/PaperRegistries.java
|
||||
+++ b/src/main/java/io/papermc/paper/registry/PaperRegistries.java
|
||||
@@ -1,6 +1,8 @@
|
||||
|
@ -26,7 +26,7 @@ index 36bc8d005de14622eb8a0bf4736d964276c95344..3ad1ba8c14fe3745cedcbbd9bb28dad3
|
|||
entry(Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, StructureType.class, CraftStructureType::new),
|
||||
entry(Registries.INSTRUMENT, RegistryKey.INSTRUMENT, MusicInstrument.class, CraftMusicInstrument::new),
|
||||
entry(Registries.MOB_EFFECT, RegistryKey.MOB_EFFECT, PotionEffectType.class, CraftPotionEffectType::new),
|
||||
@@ -97,7 +99,7 @@ public final class PaperRegistries {
|
||||
@@ -98,7 +100,7 @@ public final class PaperRegistries {
|
||||
entry(Registries.TRIM_PATTERN, RegistryKey.TRIM_PATTERN, TrimPattern.class, CraftTrimPattern::new).delayed(),
|
||||
entry(Registries.DAMAGE_TYPE, RegistryKey.DAMAGE_TYPE, DamageType.class, CraftDamageType::new).delayed(),
|
||||
entry(Registries.WOLF_VARIANT, RegistryKey.WOLF_VARIANT, Wolf.Variant.class, CraftWolf.CraftVariant::new).delayed(),
|
||||
|
@ -34,7 +34,7 @@ index 36bc8d005de14622eb8a0bf4736d964276c95344..3ad1ba8c14fe3745cedcbbd9bb28dad3
|
|||
+ writable(Registries.ENCHANTMENT, RegistryKey.ENCHANTMENT, Enchantment.class, CraftEnchantment::new, PaperEnchantmentRegistryEntry.PaperBuilder::new).withSerializationUpdater(FieldRename.ENCHANTMENT_RENAME).delayed(),
|
||||
entry(Registries.JUKEBOX_SONG, RegistryKey.JUKEBOX_SONG, JukeboxSong.class, CraftJukeboxSong::new).delayed(),
|
||||
entry(Registries.BANNER_PATTERN, RegistryKey.BANNER_PATTERN, PatternType.class, CraftPatternType::new).delayed(),
|
||||
entry(Registries.BIOME, RegistryKey.BIOME, Biome.class, CraftBiome::new).delayed(),
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/registry/data/PaperEnchantmentRegistryEntry.java b/src/main/java/io/papermc/paper/registry/data/PaperEnchantmentRegistryEntry.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..481f5f0cfae1fada3bc3f873fb7e04c3086ea9bf
|
||||
|
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add API for CanPlaceOn and CanDestroy NBT values
|
|||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
index a4d6c95e55722c9a0e381d7b84916787240cea8e..188684a480c8ae2b761ed12ca0b1d256cef67538 100644
|
||||
index b24857e34d87ea4fa9aa0db0ba684014c2625cc1..5bb37a77363d91222dae833d018da753e3549f93 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
|
||||
@@ -2499,4 +2499,119 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@@ -2500,4 +2500,119 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
}
|
||||
// Paper end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue