mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-29 03:02:02 -07:00
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#8874)
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: 6b3c598b PR-814: Add a method to send multiple equipment changes 181a984b Update Maven shade version to align with CraftBukkit a5a36e32 Revert "Update Maven shade version to align with CraftBukkit" 7a8f4a42 Update Maven shade version to align with CraftBukkit 58327201 Add support for Java 20 CraftBukkit Changes: b56426c7a PR-1142: Calculate explosion damage separately for each affected EntityComplexPart fbe3410af PR-1140: Add a method to send multiple equipment changes 8434e3633 Add support for Java 20 c998a1d23 Increase outdated build delay 4a929b5d6 SPIGOT-7267: Fix EntityType#getTranslationKey() and add unit test 086d8dc8a SPIGOT-7268: CraftMetaPotion reads ShowParticles and ShowIcon properties incorrectly 8ba5e399e SPIGOT-7262: Improve visibility API Spigot Changes: a2190e30 Rebuild patches
This commit is contained in:
@@ -1,38 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aya <31237389+tal5@users.noreply.github.com>
|
||||
Date: Fri, 20 Jan 2023 13:49:59 +0000
|
||||
Subject: [PATCH] Add Player#sendEquipmentChange(Map) API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.sendSignChange0(components, loc, dyeColor, hasGlowingText); // Paper
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
@Override
|
||||
- public void sendEquipmentChange(LivingEntity entity, EquipmentSlot slot, ItemStack item) {
|
||||
+ public void sendEquipmentChange(LivingEntity entity, Map<EquipmentSlot, ItemStack> equipmentChanges) {
|
||||
Preconditions.checkArgument(entity != null, "entity must not be null");
|
||||
- Preconditions.checkArgument(slot != null, "slot must not be null");
|
||||
- Preconditions.checkArgument(item != null, "item must not be null");
|
||||
+ Preconditions.checkNotNull(equipmentChanges, "equipmentChanges must not be null");
|
||||
|
||||
if (this.getHandle().connection == null) return;
|
||||
|
||||
- List<Pair<net.minecraft.world.entity.EquipmentSlot, net.minecraft.world.item.ItemStack>> equipment = Arrays.asList(
|
||||
- new Pair<>(CraftEquipmentSlot.getNMS(slot), CraftItemStack.asNMSCopy(item))
|
||||
- );
|
||||
+ List<Pair<net.minecraft.world.entity.EquipmentSlot, net.minecraft.world.item.ItemStack>> equipment = new ArrayList<>(equipmentChanges.size());
|
||||
+ for (Map.Entry<EquipmentSlot, ItemStack> entry : equipmentChanges.entrySet()) {
|
||||
+ Preconditions.checkNotNull(entry.getKey(), "EquipmentSlot key must not be null");
|
||||
+ Preconditions.checkNotNull(entry.getValue(), "ItemStack value must not be null");
|
||||
+ equipment.add(new Pair<>(CraftEquipmentSlot.getNMS(entry.getKey()), CraftItemStack.asNMSCopy(entry.getValue())));
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
this.getHandle().connection.send(new ClientboundSetEquipmentPacket(entity.getEntityId(), equipment));
|
||||
}
|
@@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ implementation("io.netty:netty-codec-haproxy:4.1.87.Final") // Paper - Add support for proxy protocol
|
||||
// Paper end
|
||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm:9.3")
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java
|
||||
|
@@ -2305,19 +2305,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
} else {
|
||||
this.chat(s, message, true);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
}
|
||||
|
||||
public void sendPlayerChatMessage(PlayerChatMessage message, ChatType.Bound params) {
|
||||
+ // Paper start
|
||||
+ if (!this.getCraftPlayer().canSee(message.link().sender())) {
|
||||
+ this.sendDisguisedChatMessage(message.decoratedContent(), params);
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end
|
||||
this.send(new ClientboundPlayerChatPacket(message.link().sender(), message.link().index(), message.signature(), message.signedBody().pack(this.messageSignatureCache), message.unsignedContent(), message.filterMask(), params.toNetwork(this.player.level.registryAccess())));
|
||||
this.addPendingMessage(message);
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
||||
return;
|
||||
}
|
||||
@@ -3508,19 +3495,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
@Override
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return !this.hiddenEntities.containsKey(entity.getUniqueId());
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ public boolean canSee(UUID entityUUID) {
|
||||
+ return !this.hiddenEntities.containsKey(entityUUID);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public Map<String, Object> serialize() {
|
||||
Map<String, Object> result = new LinkedHashMap<String, Object>();
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public void setResourcePack(String url) {
|
||||
|
@@ -16,8 +16,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- exclude(group = "org.apache.logging.log4j", module = "log4j-api")
|
||||
- }
|
||||
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm:9.3")
|
||||
+ implementation("org.ow2.asm:asm-commons:9.3") // Paper - ASM event executor generation
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
+ implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3")
|
||||
runtimeOnly("mysql:mysql-connector-java:8.0.29")
|
||||
@@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper
|
||||
|
||||
Calendar deadline = Calendar.getInstance();
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -14);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -28);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
|
@@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ annotationProcessor("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - Needed to generate meta for our Log4j plugins
|
||||
// Paper end
|
||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm:9.3")
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
@@ -0,0 +0,0 @@ dependencies {
|
||||
testImplementation("org.mockito:mockito-core:4.9.0") // Paper - switch to mockito
|
||||
implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files
|
||||
|
@@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -0,0 +0,0 @@ public class Main {
|
||||
Calendar deadline = Calendar.getInstance();
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -14);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -28);
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
- System.err.println("*** Error, this build is outdated ***");
|
||||
+ // Paper start - This is some stupid bullshit
|
||||
|
@@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation
|
||||
// Paper end
|
||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm:9.3")
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
|
@@ -18,8 +18,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -0,0 +0,0 @@ dependencies {
|
||||
implementation("org.ow2.asm:asm:9.3")
|
||||
implementation("org.ow2.asm:asm-commons:9.3") // Paper - ASM event executor generation
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation
|
||||
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")
|
||||
|
@@ -12,8 +12,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
System.err.println("Unsupported Java detected (" + javaVersion + "). This version of Minecraft requires at least Java 17. Check your Java version with the command 'java -version'.");
|
||||
return;
|
||||
}
|
||||
- if (javaVersion > 63.0) {
|
||||
- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 19 is supported.");
|
||||
- if (javaVersion > 64.0) {
|
||||
- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 20 is supported.");
|
||||
- return;
|
||||
- }
|
||||
|
||||
|
@@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") {
|
||||
+ exclude(group = "org.apache.logging.log4j", module = "log4j-api")
|
||||
+ }
|
||||
+ implementation("org.ow2.asm:asm:9.3")
|
||||
+ implementation("org.ow2.asm:asm:9.4")
|
||||
+ implementation("commons-lang:commons-lang:2.6")
|
||||
+ runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3")
|
||||
+ runtimeOnly("mysql:mysql-connector-java:8.0.29")
|
||||
@@ -238,7 +238,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- <dependency>
|
||||
- <groupId>org.ow2.asm</groupId>
|
||||
- <artifactId>asm</artifactId>
|
||||
- <version>9.3</version>
|
||||
- <version>9.4</version>
|
||||
- <scope>compile</scope>
|
||||
- </dependency>
|
||||
- <!-- Mojang depends -->
|
||||
@@ -559,19 +559,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- <plugin>
|
||||
- <groupId>org.apache.maven.plugins</groupId>
|
||||
- <artifactId>maven-shade-plugin</artifactId>
|
||||
- <version>3.2.4</version>
|
||||
- <dependencies>
|
||||
- <dependency>
|
||||
- <groupId>org.ow2.asm</groupId>
|
||||
- <artifactId>asm</artifactId>
|
||||
- <version>9.3</version>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.ow2.asm</groupId>
|
||||
- <artifactId>asm-commons</artifactId>
|
||||
- <version>9.3</version>
|
||||
- </dependency>
|
||||
- </dependencies>
|
||||
- <version>3.4.1</version>
|
||||
- <executions>
|
||||
- <execution>
|
||||
- <phase>package</phase>
|
||||
|
@@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -0,0 +0,0 @@ public class Main {
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -14);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -28);
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
System.err.println("*** Error, this build is outdated ***");
|
||||
- System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***");
|
||||
|
@@ -1,24 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Thu, 16 Feb 2023 03:19:19 +0000
|
||||
Subject: [PATCH] Temp fix for EntityType.translationKey()
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
|
||||
@Override
|
||||
public String getTranslationKey(EntityType entityType) {
|
||||
- return net.minecraft.world.entity.EntityType.byString(entityType.name()).map(net.minecraft.world.entity.EntityType::getDescriptionId).orElseThrow();
|
||||
+ // Paper start
|
||||
+ if (entityType.getName() == null || entityType == EntityType.UNKNOWN) {
|
||||
+ throw new IllegalArgumentException("Cannot lookup translation key of entity type " + entityType);
|
||||
+ }
|
||||
+ return net.minecraft.world.entity.EntityType.byString(entityType.getName()).map(net.minecraft.world.entity.EntityType::getDescriptionId).orElseThrow();
|
||||
+ // Paper end
|
||||
}
|
||||
|
||||
@Override
|
@@ -10,8 +10,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+++ b/build.gradle.kts
|
||||
@@ -0,0 +0,0 @@ dependencies {
|
||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm:9.3")
|
||||
implementation("org.ow2.asm:asm-commons:9.3") // Paper - ASM event executor generation
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
implementation("org.ow2.asm:asm-commons:9.4") // 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.36.0.3")
|
||||
|
@@ -39,8 +39,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ runtimeOnly("org.apache.logging.log4j:log4j-core:2.14.1")
|
||||
+ // Paper end
|
||||
implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion
|
||||
implementation("org.ow2.asm:asm:9.3")
|
||||
implementation("org.ow2.asm:asm-commons:9.3") // Paper - ASM event executor generation
|
||||
implementation("org.ow2.asm:asm:9.4")
|
||||
implementation("org.ow2.asm:asm-commons:9.4") // Paper - ASM event executor generation
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
|
Reference in New Issue
Block a user