Updated Upstream (Bukkit/CraftBukkit/Spigot)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
1d522878 PR-966: Introduce getRespawnLocation as a replacement for getBedSpawnLocation
cc01b745 PR-965: Add DragonBattle#setPreviouslyKilled
28e3702f SPIGOT-6921, PR-957: Add methods to remove all enchantments on an ItemStack
8872404e PR-961: Add BlockData#copyTo
4054cc7b PR-956: Add method to get an offline player's location

CraftBukkit Changes:
292ec79e0 SPIGOT-7568: Call EntityChangeBlockEvent for DecoratedPot
b44bf5aa8 SPIGOT-7575: SuspiciousStewMeta creates invalid PotionEffect data
161784713 PR-1340: Centralize the conversion from and to Minecraft / Bukkit registry items even more and add a test case for them
b93c5a30d PR-1338: Introduce getRespawnLocation as a replacement for getBedSpawnLocation
fb973486c SPIGOT-7570: PrepareItemCraftEvent#isRepair() always returns false
c9c24535e PR-1337: Add DragonBattle#setPreviouslyKilled
c8b4da803 SPIGOT-6921, PR-1330: Add methods to remove all enchantments on an ItemStack
95bc1c4f5 PR-1333: Add BlockData#copyTo
36e2f9ce1 PR-1329: Add method to get an offline player's location

Spigot Changes:
c198da22 SPIGOT-7563: Update to latest release of bungeecord-chat
This commit is contained in:
Nassim Jahnke 2024-01-26 20:17:06 +01:00
parent 98775ea8e5
commit ad30e27e98
19 changed files with 87 additions and 93 deletions

View file

@ -30,8 +30,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
/**
@@ -0,0 +0,0 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
*/
@Nullable
@Deprecated
public Location getBedSpawnLocation();
+ // Paper start
+ /**
@ -59,4 +59,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper end
/**
* Increments the given statistic for this player.
* Gets the Location where the player will spawn at, null if they

View file

@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@@ -0,0 +0,0 @@ java {
val annotationsVersion = "24.0.1"
val bungeeCordChatVersion = "1.20-R0.1"
val bungeeCordChatVersion = "1.20-R0.2"
+val adventureVersion = "4.15.0"
+val apiAndDocs: Configuration by configurations.creating {
+ attributes {
@ -33,7 +33,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
api("com.google.code.gson:gson:2.10.1")
- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion")
+ // Paper start - adventure
+ api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.14") {
+ api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.18") {
+ exclude("com.google.guava", "guava")
+ }
+ // Paper - adventure

View file

@ -19,7 +19,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/build.gradle.kts
@@ -0,0 +0,0 @@ java {
val annotationsVersion = "24.0.1"
val bungeeCordChatVersion = "1.20-R0.1"
val bungeeCordChatVersion = "1.20-R0.2"
val adventureVersion = "4.15.0"
+val slf4jVersion = "2.0.9"
+val log4jVersion = "2.17.1"

View file

@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+}
+
+val annotationsVersion = "24.0.1"
+val bungeeCordChatVersion = "1.20-R0.1"
+val bungeeCordChatVersion = "1.20-R0.2"
+
+dependencies {
+ // api dependencies are listed transitively to API consumers
@ -185,7 +185,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>net.md-5</groupId>
- <artifactId>bungeecord-chat</artifactId>
- <version>1.20-R0.1</version>
- <version>1.20-R0.2</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>

View file

@ -192,7 +192,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override
public void setBedSpawnLocation(Location location, boolean override) {
public void setRespawnLocation(Location location, boolean override) {
if (location == null) {
- this.getHandle().setRespawnPosition(null, null, 0.0F, override, false, PlayerSpawnChangeEvent.Cause.PLUGIN);
+ this.getHandle().setRespawnPosition(null, null, 0.0F, override, false, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.PLUGIN); // Paper - Add PlayerSetSpawnEvent

View file

@ -193,10 +193,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ System.setOut(out);
+ }
+}
diff --git a/src/test/java/org/bukkit/PerRegistryTest.java b/src/test/java/org/bukkit/PerRegistryTest.java
diff --git a/src/test/java/org/bukkit/registry/PerRegistryTest.java b/src/test/java/org/bukkit/registry/PerRegistryTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/PerRegistryTest.java
+++ b/src/test/java/org/bukkit/PerRegistryTest.java
--- a/src/test/java/org/bukkit/registry/PerRegistryTest.java
+++ b/src/test/java/org/bukkit/registry/PerRegistryTest.java
@@ -0,0 +0,0 @@ public class PerRegistryTest extends AbstractTestingBase {
if (!(object instanceof CraftRegistry<?, ?> registry)) {
continue;
@ -205,3 +205,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
data.add(Arguments.of(registry));
} catch (ReflectiveOperationException e) {
diff --git a/src/test/java/org/bukkit/registry/RegistryArgumentAddedTest.java b/src/test/java/org/bukkit/registry/RegistryArgumentAddedTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/registry/RegistryArgumentAddedTest.java
+++ b/src/test/java/org/bukkit/registry/RegistryArgumentAddedTest.java
@@ -0,0 +0,0 @@ public class RegistryArgumentAddedTest extends AbstractTestingBase {
Set<Class<?>> loadedRegistries = new HashSet<>(DummyServer.registers.keySet());
Set<Class<?>> notFound = new HashSet<>();
+ loadedRegistries.remove(io.papermc.paper.world.structure.ConfiguredStructure.class); // Paper - ignore
RegistriesArgumentProvider
.getData()

View file

@ -28,7 +28,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
+++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
@@ -0,0 +0,0 @@ public class CraftEnchantment extends Enchantment {
@@ -0,0 +0,0 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
public net.kyori.adventure.text.Component displayName(int level) {
return io.papermc.paper.adventure.PaperAdventure.asAdventure(getHandle().getFullname(level));
}

View file

@ -4008,7 +4008,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
+++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
@@ -0,0 +0,0 @@ public class CraftEnchantment extends Enchantment {
@@ -0,0 +0,0 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
CraftEnchantment ench = (CraftEnchantment) other;
return !this.handle.isCompatibleWith(ench.getHandle());
}

View file

@ -73,7 +73,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
- if (i < 3) {
+ if (i < world.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable cactus/bamboo/reed growth heightt
+ if (i < world.paperConfig().maxGrowthHeight.cactus) { // Paper - Configurable cactus/bamboo/reed growth height
int j = (Integer) state.getValue(CactusBlock.AGE);
int modifier = world.spigotConfig.cactusModifier; // Spigot - SPIGOT-7159: Better modifier resolution
@ -86,7 +86,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
- if (i < 3) {
+ if (i < world.paperConfig().maxGrowthHeight.reeds) { // Paper - Configurable cactus/bamboo/reed growth height
+ if (i < world.paperConfig().maxGrowthHeight.reeds) { // Paper - Configurable cactus/bamboo/reed growth heigh
int j = (Integer) state.getValue(SugarCaneBlock.AGE);
int modifier = world.spigotConfig.caneModifier; // Spigot - SPIGOT-7159: Better modifier resolution

View file

@ -1,21 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Date: Sat, 23 Sep 2023 16:36:54 +0200
Subject: [PATCH] Fix SuspiciousStewMeta
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSuspiciousStew.java
@@ -0,0 +0,0 @@ import org.bukkit.potion.PotionEffectType;
@DelegateDeserialization(CraftMetaItem.SerializableMeta.class)
public class CraftMetaSuspiciousStew extends CraftMetaItem implements SuspiciousStewMeta {
- static final ItemMetaKey DURATION = new ItemMetaKey("EffectDuration", "duration");
- static final ItemMetaKey EFFECTS = new ItemMetaKey("Effects", "effects");
+ static final ItemMetaKey DURATION = new ItemMetaKey("duration", "duration"); // Paper
+ static final ItemMetaKey EFFECTS = new ItemMetaKey(net.minecraft.world.item.SuspiciousStewItem.EFFECTS_TAG, "effects"); // Paper
static final ItemMetaKey ID = new ItemMetaKey("id", "id");
private List<PotionEffect> customEffects;

View file

@ -159,6 +159,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return level;
}
@@ -0,0 +0,0 @@ public final class CraftItemStack extends ItemStack {
@Override
public Map<Enchantment, Integer> getEnchantments() {

View file

@ -40,30 +40,30 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimMateri
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimMaterial.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimMaterial.java
@@ -0,0 +0,0 @@ public class CraftTrimMaterial implements TrimMaterial {
@@ -0,0 +0,0 @@ public class CraftTrimMaterial implements TrimMaterial, Handleable<net.minecraft
@Override
@NotNull
public NamespacedKey getKey() {
+ if (true) return java.util.Objects.requireNonNull(org.bukkit.Registry.TRIM_MATERIAL.getKey(this), () -> this + " doesn't have a key"); // Paper
return this.key;
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java b/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/trim/CraftTrimPattern.java
@@ -0,0 +0,0 @@ public class CraftTrimPattern implements TrimPattern {
@@ -0,0 +0,0 @@ public class CraftTrimPattern implements TrimPattern, Handleable<net.minecraft.w
@Override
@NotNull
public NamespacedKey getKey() {
+ if (true) return java.util.Objects.requireNonNull(org.bukkit.Registry.TRIM_PATTERN.getKey(this), () -> this + " doesn't have a key"); // Paper
return this.key;
}
diff --git a/src/test/java/org/bukkit/PerRegistryTest.java b/src/test/java/org/bukkit/PerRegistryTest.java
}
diff --git a/src/test/java/org/bukkit/registry/PerRegistryTest.java b/src/test/java/org/bukkit/registry/PerRegistryTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/PerRegistryTest.java
+++ b/src/test/java/org/bukkit/PerRegistryTest.java
--- a/src/test/java/org/bukkit/registry/PerRegistryTest.java
+++ b/src/test/java/org/bukkit/registry/PerRegistryTest.java
@@ -0,0 +0,0 @@ public class PerRegistryTest extends AbstractTestingBase {
@ParameterizedTest

View file

@ -12,7 +12,7 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
+++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java
@@ -0,0 +0,0 @@ public class CraftEnchantment extends Enchantment {
@@ -0,0 +0,0 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
@Override
public boolean isCursed() {
@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
@Override
@@ -0,0 +0,0 @@ public class CraftEnchantment extends Enchantment {
@@ -0,0 +0,0 @@ public class CraftEnchantment extends Enchantment implements Handleable<net.mine
public String translationKey() {
return this.handle.getDescriptionId();
}

View file

@ -8,11 +8,10 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.j
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionEffectType.java
@@ -0,0 +0,0 @@ public class CraftPotionEffectType extends PotionEffectType {
return ((CraftPotionEffectType) bukkit).getHandle();
@@ -0,0 +0,0 @@ public class CraftPotionEffectType extends PotionEffectType implements Handleabl
return Color.fromRGB(this.handle.getColor());
}
+
+ // Paper start
+ @Override
+ public java.util.Map<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> getEffectAttributes() {
@ -54,7 +53,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ };
+ }
+ // Paper end
}
+
@Override
public boolean equals(Object other) {
if (this == other) {
diff --git a/src/test/java/io/papermc/paper/effects/EffectCategoryTest.java b/src/test/java/io/papermc/paper/effects/EffectCategoryTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000

View file

@ -131,44 +131,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
String.format("""
Could not encoded particle param for particle %s.
This can indicated, that the wrong particle param is created in CraftParticle.
diff --git a/src/test/java/org/bukkit/RegistryConstantsTest.java b/src/test/java/org/bukkit/RegistryConstantsTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/RegistryConstantsTest.java
+++ b/src/test/java/org/bukkit/RegistryConstantsTest.java
@@ -0,0 +0,0 @@ public class RegistryConstantsTest extends AbstractTestingBase {
@Test
public void testTrimMaterial() {
- this.testExcessConstants(TrimMaterial.class, Registry.TRIM_MATERIAL);
+ this.testExcessConstants(TrimMaterial.class, org.bukkit.Registry.TRIM_MATERIAL); // Paper - remap fix
this.testMissingConstants(TrimMaterial.class, Registries.TRIM_MATERIAL);
}
@Test
public void testTrimPattern() {
- this.testExcessConstants(TrimPattern.class, Registry.TRIM_PATTERN);
+ this.testExcessConstants(TrimPattern.class, org.bukkit.Registry.TRIM_PATTERN); // Paper - remap fix
this.testMissingConstants(TrimPattern.class, Registries.TRIM_PATTERN);
}
- private <T extends Keyed> void testExcessConstants(Class<T> clazz, Registry<T> registry) {
+ private <T extends Keyed> void testExcessConstants(Class<T> clazz, org.bukkit.Registry<T> registry) { // Paper - remap fix
List<NamespacedKey> excessKeys = new ArrayList<>();
for (Field field : clazz.getFields()) {
diff --git a/src/test/java/org/bukkit/RegistryLoadOrderTest.java b/src/test/java/org/bukkit/RegistryLoadOrderTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/RegistryLoadOrderTest.java
+++ b/src/test/java/org/bukkit/RegistryLoadOrderTest.java
@@ -0,0 +0,0 @@ public class RegistryLoadOrderTest extends AbstractTestingBase {
private static boolean initInterface = false;
private static boolean initAbstract = false;
- private static Registry<Keyed> registry;
+ private static org.bukkit.Registry<Keyed> registry; // Paper - remap fix
public static Stream<Arguments> data() {
return Stream.of(
diff --git a/src/test/java/org/bukkit/entity/EntityTypesTest.java b/src/test/java/org/bukkit/entity/EntityTypesTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/entity/EntityTypesTest.java
@ -224,3 +186,41 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
org.bukkit.entity.Panda.Gene bukkit = CraftPanda.fromNms(gene);
assertNotNull(bukkit, "Bukkit gene null for " + gene);
diff --git a/src/test/java/org/bukkit/registry/RegistryConstantsTest.java b/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
+++ b/src/test/java/org/bukkit/registry/RegistryConstantsTest.java
@@ -0,0 +0,0 @@ public class RegistryConstantsTest extends AbstractTestingBase {
@Test
public void testTrimMaterial() {
- this.testExcessConstants(TrimMaterial.class, Registry.TRIM_MATERIAL);
+ this.testExcessConstants(TrimMaterial.class, org.bukkit.Registry.TRIM_MATERIAL); // Paper - remap fix
this.testMissingConstants(TrimMaterial.class, Registries.TRIM_MATERIAL);
}
@Test
public void testTrimPattern() {
- this.testExcessConstants(TrimPattern.class, Registry.TRIM_PATTERN);
+ this.testExcessConstants(TrimPattern.class, org.bukkit.Registry.TRIM_PATTERN); // Paper - remap fix
this.testMissingConstants(TrimPattern.class, Registries.TRIM_PATTERN);
}
- private <T extends Keyed> void testExcessConstants(Class<T> clazz, Registry<T> registry) {
+ private <T extends Keyed> void testExcessConstants(Class<T> clazz, org.bukkit.Registry<T> registry) { // Paper - remap fix
List<NamespacedKey> excessKeys = new ArrayList<>();
for (Field field : clazz.getFields()) {
diff --git a/src/test/java/org/bukkit/registry/RegistryLoadOrderTest.java b/src/test/java/org/bukkit/registry/RegistryLoadOrderTest.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/test/java/org/bukkit/registry/RegistryLoadOrderTest.java
+++ b/src/test/java/org/bukkit/registry/RegistryLoadOrderTest.java
@@ -0,0 +0,0 @@ public class RegistryLoadOrderTest extends AbstractTestingBase {
private static boolean initInterface = false;
private static boolean initAbstract = false;
- private static Registry<Keyed> registry;
+ private static org.bukkit.Registry<Keyed> registry; // Paper - remap fix
public static Stream<Arguments> data() {
return Stream.of(

View file

@ -102,8 +102,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/test/java/org/bukkit/support/DummyServer.java
+++ b/src/test/java/org/bukkit/support/DummyServer.java
@@ -0,0 +0,0 @@ public final class DummyServer {
when(instance.getRegistry(any())).then(mock -> CraftRegistry.createRegistry(mock.getArgument(0), AbstractTestingBase.REGISTRY_CUSTOM));
return registers.computeIfAbsent(aClass, key -> CraftRegistry.createRegistry(aClass, AbstractTestingBase.REGISTRY_CUSTOM));
});
+ // Paper start - testing additions
+ final Thread currentThread = Thread.currentThread();

@ -1 +1 @@
Subproject commit 63c208dd3f16a0874b5e21348c35ce9e5c829d03
Subproject commit 1d5228782e11c20c984621d26ea05822e46b3d3f

@ -1 +1 @@
Subproject commit 771182f70cd789f3d220cfef80876845a48ebec5
Subproject commit 292ec79e09e3b90358560dd9e571452c9da7500f

@ -1 +1 @@
Subproject commit 864e4acc0db6ad9899f269740823a23d082d18d0
Subproject commit c198da22a814a0ba9c3128c3a9946286e0839b5a