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:
09b1c123 PR-916: Add more lightning API
c085f3de PR-859: Add Entity#getTrackedBy

CraftBukkit Changes:
1bf30a4e9 SPIGOT-7495: Spawning bee entity in asynchronous BlockPopulator causes IllegalStateException - Accessing LegacyRandomSource from multiple threads
476c5bccd PR-1267: Add more lightning API
40d5e6c02 PR-1190: Add Entity#getTrackedBy
40d41acc1 SPIGOT-7491: Downgrade bundled SQLite to be updated next release
44b31da38 PR-1264: Load Bukkit class before creating Registry item
dc45a6738 SPIGOT-7496: Failure to load datapacks with multiple identical predicates
f508657d6 Fix decompile error affecting javac
ef7a4743d PR-1265: Ensure UTF-8 used in new test resource

Spigot Changes:
224dad51 Rebuild patches
This commit is contained in:
Nassim Jahnke 2023-10-03 21:55:12 +10:00
parent 9b7863a607
commit a4d2616808
20 changed files with 38 additions and 132 deletions

View file

@ -28,8 +28,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @return players in tracking range
*/
@Deprecated
@NotNull Set<Player> getTrackedPlayers();
+
+ /**

View file

@ -17,7 +17,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * Returns a set of {@link Player Players} within this entity's tracking range (players that can "see" this entity).
+ *
+ * @return players in tracking range
+ * @deprecated slightly misleading name, use {@link #getTrackedBy()}
+ */
+ @Deprecated
+ @NotNull Set<Player> getTrackedPlayers();
// Paper end
}

View file

@ -434,7 +434,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
@@ -0,0 +0,0 @@ public interface LightningStrike extends Entity {
public boolean isEffect();
public void setCausingPlayer(@Nullable Player player);
// Spigot start
+ /**

View file

@ -8,6 +8,26 @@ diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/jav
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/LightningStrike.java
+++ b/src/main/java/org/bukkit/entity/LightningStrike.java
@@ -0,0 +0,0 @@ public interface LightningStrike extends Entity {
* removed. By default this value is between 1 and 3.
*
* @return the flashes
+ * @deprecated use {@link #getFlashCount()}
*/
+ @Deprecated // Paper
public int getFlashes();
/**
@@ -0,0 +0,0 @@ public interface LightningStrike extends Entity {
* has reduced below 0.
*
* @param flashes the flashes
+ * @deprecated use {@link #setFlashCount(int)}
*/
+ @Deprecated // Paper
public void setFlashes(int flashes);
/**
@@ -0,0 +0,0 @@ public interface LightningStrike extends Entity {
@Deprecated // Paper
Spigot spigot();
@ -31,22 +51,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ void setFlashCount(int flashes);
+
+ /**
+ * Returns the amount of ticks the current flash will do damage for.
+ * Starts with 2 by default, will damage while it is equal to or above 0, with the next flash beginning somewhere between 0 and -9.
+ *
+ * @return ticks the current flash will do damage for
+ */
+ int getLifeTicks();
+
+ /**
+ * Sets the amount of ticks the current flash will do damage/fire for.
+ * Default is 2 for each flash, on which the sound and effect will also be played.
+ *
+ * @param lifeTicks ticks the current flash will do damage for
+ */
+ void setLifeTicks(int lifeTicks);
+
+ /**
+ * Returns the potential entity that caused this lightning strike to spawn in the world.
+ * <p>
+ * As of implementing this method, only {@link Player}s are capable of causing a lightning strike, however as this
@ -65,19 +69,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ */
+ @org.jetbrains.annotations.Nullable
+ Entity getCausingEntity();
+
+ /**
+ * Updates the player that caused this lightning to be summoned into the world.
+ * By default, players that channel their {@link Trident} will be the cause of the respective lightning.
+ * <p>
+ * While the respective getter method {@link #getCausingEntity()} does not guarantee a player as the cause of a
+ * lightning to stay as future proof as possible, as of implementing this method, players are the only entities
+ * that can cause a lightning strike and hence this setter is restricted to players.
+ * </p>
+ *
+ * @param causingPlayer the player that should be the new cause of this lightning. {@code null} may be passed to
+ * indicate that no player is responsible for this lightning.
+ */
+ void setCausingPlayer(@org.jetbrains.annotations.Nullable Player causingPlayer);
+ // Paper end
}

View file

@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ public static final class LegacyRegistry extends CraftRegistry<ConfiguredStructure, Structure> {
+
+ public LegacyRegistry(final Registry<Structure> minecraftRegistry) {
+ super(minecraftRegistry, LegacyRegistry::minecraftToBukkit);
+ super(ConfiguredStructure.class, minecraftRegistry, LegacyRegistry::minecraftToBukkit);
+ }
+
+ private static @Nullable ConfiguredStructure minecraftToBukkit(NamespacedKey key, Structure nms) {
@ -80,7 +80,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
@@ -0,0 +0,0 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
return new CraftRegistry<>(registryHolder.registryOrThrow(Registries.TRIM_PATTERN), CraftTrimPattern::new);
return new CraftRegistry<>(TrimPattern.class, registryHolder.registryOrThrow(Registries.TRIM_PATTERN), CraftTrimPattern::new);
}
// TODO registry modification API
+ // Paper start - remove this after a while along with all ConfiguredStructure stuff

View file

@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
implementation("org.ow2.asm:asm:9.5")
+ implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.43.0.0")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
@@ -0,0 +0,0 @@ dependencies {

View file

@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
implementation("commons-lang:commons-lang:2.6")
+ implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation
runtimeOnly("org.xerial:sqlite-jdbc:3.43.0.0")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
@@ -0,0 +0,0 @@ tasks.check {

View file

@ -8,28 +8,6 @@ and constructing an entity off the main thread
should be supported. Some entities (for whatever
reason) use the level's random in some places.
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -0,0 +0,0 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
BeeGoToHiveGoal() {
super();
- this.travellingTicks = Bee.this.level().random.nextInt(10);
+ this.travellingTicks = Bee.this./* level(). */random.nextInt(10); // Paper - use entity random
this.blacklistedTargets = Lists.newArrayList();
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
}
@@ -0,0 +0,0 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
BeeGoToKnownFlowerGoal() {
super();
- this.travellingTicks = Bee.this.level().random.nextInt(10);
+ this.travellingTicks = Bee.this./* level(). */random.nextInt(10); // Paper - use entity random
this.setFlags(EnumSet.of(Goal.Flag.MOVE));
}
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java

View file

@ -1,36 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Tue, 26 Sep 2023 18:32:49 -0700
Subject: [PATCH] Fix creating the reverse map for loot table keys
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java b/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
+++ b/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
@@ -0,0 +0,0 @@ public class LootDataManager implements PreparableReloadListener, LootDataResolv
public static final LootDataId<LootTable> EMPTY_LOOT_TABLE_KEY = new LootDataId<>(LootDataType.TABLE, BuiltInLootTables.EMPTY);
private Map<LootDataId<?>, ?> elements = Map.of();
private Multimap<LootDataType<?>, ResourceLocation> typeKeys = ImmutableMultimap.of();
- public Map<?, ResourceLocation> lootTableToKey = ImmutableMap.of(); // CraftBukkit
+ public Map<LootTable, ResourceLocation> lootTableToKey = ImmutableMap.of(); // CraftBukkit // Paper - only store loot tables because those don't override equals and hashCode
public LootDataManager() {}
@@ -0,0 +0,0 @@ public class LootDataManager implements PreparableReloadListener, LootDataResolv
this.elements = map1;
this.typeKeys = com_google_common_collect_immutablemultimap_builder.build();
// CraftBukkit start - build a reversed registry map
- ImmutableMap.Builder<Object, ResourceLocation> lootTableToKeyBuilder = ImmutableMap.builder();
- this.elements.forEach((key, lootTable) -> lootTableToKeyBuilder.put((Object) lootTable, key.location()));
+ // Paper start - only create a map for loot tables
+ ImmutableMap.Builder<LootTable, ResourceLocation> lootTableToKeyBuilder = ImmutableMap.builder();
+ this.elements.forEach((lootDataId, value) -> {
+ if (lootDataId.type() == LootDataType.TABLE && value instanceof LootTable lootTable) {
+ lootTableToKeyBuilder.put(lootTable, lootDataId.location());
+ }
+ });
+ // Paper end
this.lootTableToKey = lootTableToKeyBuilder.build();
// CraftBukkit end
}

View file

@ -257,16 +257,3 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return AbortableIterationConsumer.Continuation.ABORT;
}
}
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/StructurePiece.java b/src/main/java/net/minecraft/world/level/levelgen/structure/StructurePiece.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/StructurePiece.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/StructurePiece.java
@@ -0,0 +0,0 @@ public abstract class StructurePiece {
}
public static BoundingBox createBoundingBox(Stream<StructurePiece> pieces) {
- Stream stream1 = pieces.map(StructurePiece::getBoundingBox);
+ Stream<BoundingBox> stream1 = pieces.map(StructurePiece::getBoundingBox); // Paper - decompile fix
Objects.requireNonNull(stream1);
return (BoundingBox) BoundingBox.encapsulatingBoxes(stream1::iterator).orElseThrow(() -> {

View file

@ -29,24 +29,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+
+ @Override
+ public int getLifeTicks() {
+ return getHandle().life;
+ }
+
+ @Override
+ public void setLifeTicks(int lifeTicks) {
+ getHandle().life = lifeTicks;
+ }
+
+ @Override
+ public @org.jetbrains.annotations.Nullable org.bukkit.entity.Entity getCausingEntity() {
+ final var cause = this.getHandle().getCause();
+ return cause == null ? null : cause.getBukkitEntity();
+ }
+
+ @Override
+ public void setCausingPlayer(@org.jetbrains.annotations.Nullable org.bukkit.entity.Player causingPlayer) {
+ this.getHandle().setCause(causingPlayer == null ? null : ((CraftPlayer) causingPlayer).getHandle());
+ }
+ // Paper end
}

View file

@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
+ implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.43.0.0")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
new file mode 100644

View file

@ -48,7 +48,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ implementation("org.ow2.asm:asm:9.5")
+ implementation("commons-lang:commons-lang:2.6")
+ runtimeOnly("org.xerial:sqlite-jdbc:3.43.0.0")
+ runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
+ runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
+
+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
@ -413,7 +413,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>org.xerial</groupId>
- <artifactId>sqlite-jdbc</artifactId>
- <version>3.43.0.0</version>
- <version>3.42.0.1</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>

View file

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegistry.java
@@ -0,0 +0,0 @@ public class CraftRegistry<B extends Keyed, M> implements Registry<B> {
if (bukkitClass == TrimPattern.class) {
return new CraftRegistry<>(registryHolder.registryOrThrow(Registries.TRIM_PATTERN), CraftTrimPattern::new);
return new CraftRegistry<>(TrimPattern.class, registryHolder.registryOrThrow(Registries.TRIM_PATTERN), CraftTrimPattern::new);
}
+ // TODO registry modification API

View file

@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation
+ testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.43.0.0")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
@@ -0,0 +0,0 @@ tasks.compileJava {
options.setIncremental(false)

View file

@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+++ b/build.gradle.kts
@@ -0,0 +0,0 @@ dependencies {
implementation("commons-lang:commons-lang:2.6")
runtimeOnly("org.xerial:sqlite-jdbc:3.43.0.0")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
+ runtimeOnly("com.lmax:disruptor:3.4.4") // Paper

View file

@ -9,7 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -0,0 +0,0 @@ dependencies {
runtimeOnly("org.xerial:sqlite-jdbc:3.43.0.0")
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
+ // Paper start - Use Velocity cipher

@ -1 +1 @@
Subproject commit 044d4ee93f77d1e9d82c91155d38742640d557f4
Subproject commit 09b1c123ebe4fe06ced3a6277a100aa8d4f55fcc

@ -1 +1 @@
Subproject commit 99aafc222b5fdc36dc0bc124080d114dcae06cb3
Subproject commit 1bf30a4e9019c8a6444e1460135c6c33d72f45a2

@ -1 +1 @@
Subproject commit a0f3d48691557f3f6e528fc62cd7d48a1974f016
Subproject commit 224dad51c7c6dbae96729d15807094bff1283ac4