3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-15 19:10:09 +01:00

Make it compile again

Dieser Commit ist enthalten in:
Nassim Jahnke 2023-12-06 21:28:59 +01:00
Ursprung a2b6275487
Commit c833571526
2 geänderte Dateien mit 23 neuen und 10 gelöschten Zeilen

Datei anzeigen

@ -70,7 +70,7 @@ index 9861cd23b07f8fbacb1d125af835dee58c2debbb..e6a47317eb24fc65ed02a4d4f9c4b19b
public boolean isEnchanted() { public boolean isEnchanted() {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
index 7278ac809eff364e8b838d63a2ec1291493869f8..0003d6508b0bd75130a3e0e21e252c5dc23a903c 100644 index 7278ac809eff364e8b838d63a2ec1291493869f8..7dd0c000fa7f363997178ffa6de7d39e17702348 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -188,28 +188,11 @@ public final class CraftItemStack extends ItemStack { @@ -188,28 +188,11 @@ public final class CraftItemStack extends ItemStack {
@ -107,15 +107,7 @@ index 7278ac809eff364e8b838d63a2ec1291493869f8..0003d6508b0bd75130a3e0e21e252c5d
} }
static boolean makeTag(net.minecraft.world.item.ItemStack item) { static boolean makeTag(net.minecraft.world.item.ItemStack item) {
@@ -235,57 +218,29 @@ public final class CraftItemStack extends ItemStack { @@ -242,50 +225,22 @@ public final class CraftItemStack extends ItemStack {
if (this.handle == null) {
return 0;
}
- return EnchantmentHelper.getItemEnchantmentLevel(CraftEnchantment.bukkitToMinecraft(ench), this.handle);
+ return EnchantmentHelper.getItemEnchantmentLevel(CraftEnchantment.getRaw(ench), handle);
}
@Override
public int removeEnchantment(Enchantment ench) { public int removeEnchantment(Enchantment ench) {
Preconditions.checkArgument(ench != null, "Enchantment cannot be null"); Preconditions.checkArgument(ench != null, "Enchantment cannot be null");

Datei anzeigen

@ -0,0 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Nassim Jahnke <nassim@njahnke.dev>
Date: Wed, 6 Dec 2023 21:24:54 +0100
Subject: [PATCH] HACK id string codec in hover event
Temporary hack to remove serialization to the int array, since adventure has not been updated to deserialize this format
diff --git a/src/main/java/net/minecraft/network/chat/HoverEvent.java b/src/main/java/net/minecraft/network/chat/HoverEvent.java
index 7fd85ae2ebd7225f06d874aa7e37fbdb89e3ea92..7ff694a3dd492224dedfa00b4ff0ff3015b50d1c 100644
--- a/src/main/java/net/minecraft/network/chat/HoverEvent.java
+++ b/src/main/java/net/minecraft/network/chat/HoverEvent.java
@@ -134,7 +134,7 @@ public class HoverEvent {
public static final Codec<HoverEvent.EntityTooltipInfo> CODEC = RecordCodecBuilder.create((instance) -> {
return instance.group(BuiltInRegistries.ENTITY_TYPE.byNameCodec().fieldOf("type").forGetter((content) -> {
return content.type;
- }), UUIDUtil.LENIENT_CODEC.fieldOf("id").forGetter((content) -> {
+ }), UUIDUtil.STRING_CODEC.fieldOf("id").forGetter((content) -> {
return content.id;
}), ExtraCodecs.strictOptionalField(ComponentSerialization.CODEC, "name").forGetter((content) -> {
return content.name;