diff --git a/patches/api/Add-API-to-get-the-collision-shape-of-a-block-before.patch b/patches/api/Add-API-to-get-the-collision-shape-of-a-block-before.patch index a6ea0ac298..6e321886fa 100644 --- a/patches/api/Add-API-to-get-the-collision-shape-of-a-block-before.patch +++ b/patches/api/Add-API-to-get-the-collision-shape-of-a-block-before.patch @@ -27,5 +27,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + /** - * Gets the material that a player would use to place this block. - *

+ * Gets the color this block should appear as when rendered on a map. + * diff --git a/patches/api/Add-FastUtil-to-Bukkit.patch b/patches/api/Add-FastUtil-to-Bukkit.patch index 58114b0f3c..2f6d14cfee 100644 --- a/patches/api/Add-FastUtil-to-Bukkit.patch +++ b/patches/api/Add-FastUtil-to-Bukkit.patch @@ -16,4 +16,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + api("it.unimi.dsi:fastutil:8.5.6") // Paper end - compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") + compileOnly("org.apache.maven:maven-resolver-provider:3.9.6") diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index 4d9c04b117..acb17cdd86 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -53,7 +53,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + apiAndDocs("net.kyori:adventure-text-logger-slf4j") // Paper end - compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") + compileOnly("org.apache.maven:maven-resolver-provider:3.9.6") @@ -0,0 +0,0 @@ tasks.withType { "https://guava.dev/releases/32.1.2-jre/api/docs/", "https://javadoc.io/doc/org.yaml/snakeyaml/2.2/", @@ -2681,8 +2681,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + /** - * Gets the Scoreboard displayed to this player - * + * Request that the player's client remove a resource pack sent by the + * server. @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * * @param title Title text diff --git a/patches/api/Build-system-changes.patch b/patches/api/Build-system-changes.patch index 6211257dcc..a3eddbaa24 100644 --- a/patches/api/Build-system-changes.patch +++ b/patches/api/Build-system-changes.patch @@ -18,9 +18,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") - compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") - compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3") + compileOnly("org.apache.maven:maven-resolver-provider:3.9.6") + compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") + compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18") - val annotations = "org.jetbrains:annotations-java5:$annotationsVersion" + val annotations = "org.jetbrains:annotations:$annotationsVersion" // Paper - we don't want Java 5 annotations... diff --git a/patches/api/Complete-resource-pack-API.patch b/patches/api/Complete-resource-pack-API.patch index e90fd0bcf7..a9c5b4a6de 100644 --- a/patches/api/Complete-resource-pack-API.patch +++ b/patches/api/Complete-resource-pack-API.patch @@ -182,8 +182,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end - more resource pack API + /** - * Gets the Scoreboard displayed to this player - * + * Request that the player's client remove a resource pack sent by the + * server. diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java diff --git a/patches/api/Convert-project-to-Gradle.patch b/patches/api/Convert-project-to-Gradle.patch index e4881c2ef2..c0c02107ea 100644 --- a/patches/api/Convert-project-to-Gradle.patch +++ b/patches/api/Convert-project-to-Gradle.patch @@ -52,9 +52,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + api("org.yaml:snakeyaml:2.2") + api("org.joml:joml:1.10.5") + -+ compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") -+ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") -+ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3") ++ compileOnly("org.apache.maven:maven-resolver-provider:3.9.6") ++ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") ++ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18") + + val annotations = "org.jetbrains:annotations-java5:$annotationsVersion" + compileOnly(annotations) @@ -199,19 +199,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.apache.maven - maven-resolver-provider -- 3.8.5 +- 3.9.6 - provided - - - org.apache.maven.resolver - maven-resolver-connector-basic -- 1.7.3 +- 1.9.18 - provided - - - org.apache.maven.resolver - maven-resolver-transport-http -- 1.7.3 +- 1.9.18 - provided - - @@ -370,7 +370,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - - checkstyle.xml -- checkstyle-suppressions.xml - true - - diff --git a/patches/api/Fix-upstream-javadocs.patch b/patches/api/Fix-upstream-javadocs.patch index 409ad7ff86..94eb0fb6d4 100644 --- a/patches/api/Fix-upstream-javadocs.patch +++ b/patches/api/Fix-upstream-javadocs.patch @@ -471,46 +471,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 * the player loaded the pack! - *

  • There is no concept of resetting resource packs back to default - * within Minecraft, so players will have to relog to do so or you -- * have to send an empty pack. - *
  • The request is sent with empty string as the hash when the hash is - * not provided. This might result in newer versions not loading the - * pack correctly. -@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * case this method will have no affect on them. Use the - * {@link PlayerResourcePackStatusEvent} to figure out whether or not - * the player loaded the pack! -- *
  • There is no concept of resetting resource packs back to default -- * within Minecraft, so players will have to relog to do so or you -- * have to send an empty pack. - *
  • The request is sent with empty string as the hash when the hash is - * not provided. This might result in newer versions not loading the - * pack correctly. -@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * case this method will have no affect on them. Use the - * {@link PlayerResourcePackStatusEvent} to figure out whether or not - * the player loaded the pack! -- *
  • There is no concept of resetting resource packs back to default -- * within Minecraft, so players will have to relog to do so or you -- * have to send an empty pack. - *
  • The request is sent with empty string as the hash when the hash is - * not provided. This might result in newer versions not loading the - * pack correctly. -@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * case this method will have no affect on them. Use the - * {@link PlayerResourcePackStatusEvent} to figure out whether or not - * the player loaded the pack! -- *
  • There is no concept of resetting resource packs back to default -- * within Minecraft, so players will have to relog to do so or you -- * have to send an empty pack. - *
  • The request is sent with empty string as the hash when the hash is - * not provided. This might result in newer versions not loading the - * pack correctly. -@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * case this method will have no affect on them. Use the - * {@link PlayerResourcePackStatusEvent} to figure out whether or not - * the player loaded the pack! -- *
  • There is no concept of resetting resource packs back to default -- * within Minecraft, so players will have to relog to do so or you - * have to send an empty pack. *
  • The request is sent with empty string as the hash when the hash is * not provided. This might result in newer versions not loading the diff --git a/patches/api/Paper-Plugins.patch b/patches/api/Paper-Plugins.patch index b73a55beaf..8b515ddce1 100644 --- a/patches/api/Paper-Plugins.patch +++ b/patches/api/Paper-Plugins.patch @@ -12,10 +12,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 implementation("org.ow2.asm:asm-commons:9.5") // Paper end -- compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") -+ api("org.apache.maven:maven-resolver-provider:3.8.5") - compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") - compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3") +- compileOnly("org.apache.maven:maven-resolver-provider:3.9.6") ++ api("org.apache.maven:maven-resolver-provider:3.9.6") // Paper - make API dependency for Paper Plugins + compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") + compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18") @@ -0,0 +0,0 @@ tasks.withType { "https://jd.advntr.dev/text-serializer-plain/$adventureVersion/", diff --git a/patches/api/Use-ASM-for-event-executors.patch b/patches/api/Use-ASM-for-event-executors.patch index f38294dbf4..9e03995c7a 100644 --- a/patches/api/Use-ASM-for-event-executors.patch +++ b/patches/api/Use-ASM-for-event-executors.patch @@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("org.ow2.asm:asm-commons:9.5") // Paper end - compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") + compileOnly("org.apache.maven:maven-resolver-provider:3.9.6") diff --git a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/patches/server/Add-API-to-get-the-collision-shape-of-a-block-before.patch b/patches/server/Add-API-to-get-the-collision-shape-of-a-block-before.patch index 99c377b01c..415c0af28d 100644 --- a/patches/server/Add-API-to-get-the-collision-shape-of-a-block-before.patch +++ b/patches/server/Add-API-to-get-the-collision-shape-of-a-block-before.patch @@ -28,5 +28,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper end + @Override - public Material getPlacementMaterial() { - return CraftMagicNumbers.getMaterial(this.state.getBlock().asItem()); + public Color getMapColor() { + return Color.fromRGB(this.state.getMapColor(null, null).col); diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 9f4a275c18..678fca5d54 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -4227,14 +4227,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } else { + hash = ""; + } -+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundResourcePackPopPacket(Optional.empty())); ++ this.getHandle().connection.send(new ClientboundResourcePackPopPacket(Optional.empty())); + this.getHandle().connection.send(new ClientboundResourcePackPushPacket(uuid, url, hash, force, io.papermc.paper.adventure.PaperAdventure.asVanilla(prompt))); + } + // Paper end - adventure + - public void addChannel(String channel) { - Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel); - channel = StandardMessenger.validateAndCorrectChannel(channel); + @Override + public void removeResourcePack(UUID id) { + Preconditions.checkArgument(id != null, "Resource pack id cannot be null"); @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return (this.getHandle().requestedViewDistance() == 0) ? Bukkit.getViewDistance() : this.getHandle().requestedViewDistance(); } diff --git a/patches/server/Allow-spawning-Item-entities-with-World.spawnEntity.patch b/patches/server/Allow-spawning-Item-entities-with-World.spawnEntity.patch deleted file mode 100644 index 2cbc6f8e47..0000000000 --- a/patches/server/Allow-spawning-Item-entities-with-World.spawnEntity.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Mon, 4 Jun 2018 20:39:20 -0400 -Subject: [PATCH] Allow spawning Item entities with World.spawnEntity - -This API has more capabilities than .dropItem with the Consumer function - -Item can be set inside of the Consumer pre spawn function. - -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor { - entity = net.minecraft.world.entity.EntityType.BOAT.create(world); - } - entity.moveTo(x, y, z, yaw, pitch); -+ // Paper start -+ } else if (org.bukkit.entity.Item.class.isAssignableFrom(clazz)) { -+ entity = new net.minecraft.world.entity.item.ItemEntity(world, x, y, z, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.DIRT)); -+ // Paper end - } else if (FallingBlock.class.isAssignableFrom(clazz)) { - BlockPos pos = BlockPos.containing(x, y, z); - entity = FallingBlockEntity.fall(world, pos, this.getHandle().getBlockState(pos)); diff --git a/patches/server/Anti-Xray.patch b/patches/server/Anti-Xray.patch index e690b0409f..430177f29d 100644 --- a/patches/server/Anti-Xray.patch +++ b/patches/server/Anti-Xray.patch @@ -1602,11 +1602,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private Set tiles; private final Set lights = new HashSet<>(); + // Paper start - Anti-Xray - Add parameters -+ private final World world; ++ private final org.bukkit.World world; - public OldCraftChunkData(int minHeight, int maxHeight, Registry biomes) { + @Deprecated @io.papermc.paper.annotation.DoNotUse public OldCraftChunkData(int minHeight, int maxHeight, Registry biomes) { this(minHeight, maxHeight, biomes, null); } -+ public OldCraftChunkData(int minHeight, int maxHeight, Registry biomes, World world) { ++ public OldCraftChunkData(int minHeight, int maxHeight, Registry biomes, org.bukkit.World world) { + this.world = world; + // Paper end this.minHeight = minHeight; diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index 83651e373b..d72905ce9f 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + 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.42.0.1") - runtimeOnly("com.mysql:mysql-connector-j:8.1.0") + runtimeOnly("com.mysql:mysql-connector-j:8.2.0") @@ -0,0 +0,0 @@ tasks.jar { val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim() val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\"" @@ -148,7 +148,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, -3); + deadline.add(Calendar.DAY_OF_YEAR, -7); 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 diff --git a/patches/server/Collision-API.patch b/patches/server/Collision-API.patch index 7a2da86c36..cb43d44d52 100644 --- a/patches/server/Collision-API.patch +++ b/patches/server/Collision-API.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + @Override + public boolean hasCollisionsIn(@org.jetbrains.annotations.NotNull org.bukkit.util.BoundingBox boundingBox) { -+ net.minecraft.world.phys.AABB aabb = new AABB(boundingBox.getMinX(), boundingBox.getMinY(), boundingBox.getMinZ(), boundingBox.getMaxX(), boundingBox.getMaxY(), boundingBox.getMaxZ(), false); ++ net.minecraft.world.phys.AABB aabb = new net.minecraft.world.phys.AABB(boundingBox.getMinX(), boundingBox.getMinY(), boundingBox.getMinZ(), boundingBox.getMaxX(), boundingBox.getMaxY(), boundingBox.getMaxZ(), false); + + return !this.getHandle().noCollision(aabb); + } diff --git a/patches/server/Complete-resource-pack-API.patch b/patches/server/Complete-resource-pack-API.patch index af44f8050b..f11a740b52 100644 --- a/patches/server/Complete-resource-pack-API.patch +++ b/patches/server/Complete-resource-pack-API.patch @@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + final net.minecraft.network.chat.Component promptComponent = resourcePackPrompt != null ? + io.papermc.paper.adventure.PaperAdventure.asVanilla(resourcePackPrompt) : + null; -+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundResourcePackPopPacket(Optional.empty())); ++ this.getHandle().connection.send(new ClientboundResourcePackPopPacket(Optional.empty())); + this.getHandle().connection.send(new ClientboundResourcePackPushPacket(uuid, url, hash, required, promptComponent)); + } + @@ -56,6 +56,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - more resource pack API + - public void addChannel(String channel) { - Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel); - channel = StandardMessenger.validateAndCorrectChannel(channel); + @Override + public void removeResourcePack(UUID id) { + Preconditions.checkArgument(id != null, "Resource pack id cannot be null"); diff --git a/patches/server/Convert-legacy-attributes-in-Item-Meta.patch b/patches/server/Convert-legacy-attributes-in-Item-Meta.patch index 450ae58c26..1d3ee63d40 100644 --- a/patches/server/Convert-legacy-attributes-in-Item-Meta.patch +++ b/patches/server/Convert-legacy-attributes-in-Item-Meta.patch @@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier); - String attributeName = entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT); -+ String attributeName = CraftAttributeMap.convertIfNeeded(entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT)); // Paper ++ String attributeName = org.bukkit.craftbukkit.attribute.CraftAttributeMap.convertIfNeeded(entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT)); // Paper if (attributeName == null || attributeName.isEmpty()) { continue; } diff --git a/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 95fd11f5d4..177051e0d7 100644 --- a/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 implementation("commons-lang:commons-lang:2.6") + implementation("net.fabricmc:mapping-io:0.5.0") // Paper - needed to read mappings for stacktrace deobfuscation runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") - runtimeOnly("com.mysql:mysql-connector-j:8.1.0") + runtimeOnly("com.mysql:mysql-connector-j:8.2.0") runtimeOnly("com.lmax:disruptor:3.4.4") // Paper @@ -0,0 +0,0 @@ tasks.check { } diff --git a/patches/server/Don-t-tick-signs.patch b/patches/server/Don-t-tick-signs.patch deleted file mode 100644 index 450b2434cd..0000000000 --- a/patches/server/Don-t-tick-signs.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> -Date: Wed, 12 Jul 2023 17:38:26 -0400 -Subject: [PATCH] Don't tick signs - -Minecraft now ticks signs in order to validate the playerWhoMayEdit field. This is a horrible idea, as this means that even waxed signs are ticked for essentially no reason. This moves the logic lazily onto the getter. - -== AT == -private net.minecraft.world.level.block.entity.SignBlockEntity playerWhoMayEdit - -diff --git a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java -@@ -0,0 +0,0 @@ public class CeilingHangingSignBlock extends SignBlock { - @Nullable - @Override - public BlockEntityTicker getTicker(Level world, BlockState state, BlockEntityType type) { -- return createTickerHelper(type, BlockEntityType.HANGING_SIGN, SignBlockEntity::tick); -+ return null; // Paper - } - } -diff --git a/src/main/java/net/minecraft/world/level/block/SignBlock.java b/src/main/java/net/minecraft/world/level/block/SignBlock.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/SignBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/SignBlock.java -@@ -0,0 +0,0 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo - @Nullable - @Override - public BlockEntityTicker getTicker(Level world, BlockState state, BlockEntityType type) { -- return createTickerHelper(type, BlockEntityType.SIGN, SignBlockEntity::tick); -+ return null; // Paper - } - } -diff --git a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java -@@ -0,0 +0,0 @@ public class WallHangingSignBlock extends SignBlock { - @Nullable - @Override - public BlockEntityTicker getTicker(Level world, BlockState state, BlockEntityType type) { -- return createTickerHelper(type, BlockEntityType.HANGING_SIGN, SignBlockEntity::tick); -+ return null; // Paper - } - } -diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -@@ -0,0 +0,0 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C - - @Nullable - public UUID getPlayerWhoMayEdit() { -+ // Paper start -+ if (this.hasLevel() && this.playerWhoMayEdit != null) { -+ // Manually invalidate the value lazily. -+ this.clearInvalidPlayerWhoMayEdit(this, this.getLevel(), this.playerWhoMayEdit); -+ } -+ // Paper end - return this.playerWhoMayEdit; - } - diff --git a/patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 82375ed55d..0255ae8227 100644 --- a/patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/patches/server/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -323,19 +323,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } @Override -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor { - } else if (TNTPrimed.class.isAssignableFrom(clazz)) { - entity = new PrimedTnt(world, x, y, z, null); - } else if (ExperienceOrb.class.isAssignableFrom(clazz)) { -- entity = new net.minecraft.world.entity.ExperienceOrb(world, x, y, z, 0); -+ entity = new net.minecraft.world.entity.ExperienceOrb(world, x, y, z, 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null); // Paper - } else if (LightningStrike.class.isAssignableFrom(clazz)) { - entity = net.minecraft.world.entity.EntityType.LIGHTNING_BOLT.create(world); - entity.moveTo(location.getX(), location.getY(), location.getZ()); +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +@@ -0,0 +0,0 @@ public final class CraftEntityTypes { + return item; + })); + register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new, +- spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0) ++ spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null) // Paper + )); + register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, spawnData -> new net.minecraft.world.entity.AreaEffectCloud(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); + register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java diff --git a/patches/server/Fix-PotionEffect-ignores-icon-flag.patch b/patches/server/Fix-PotionEffect-ignores-icon-flag.patch index 5c24236e10..f96d586958 100644 --- a/patches/server/Fix-PotionEffect-ignores-icon-flag.patch +++ b/patches/server/Fix-PotionEffect-ignores-icon-flag.patch @@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public boolean addPotionEffect(PotionEffect effect, boolean force) { - this.getHandle().addEffect(new MobEffectInstance(CraftPotionEffectType.bukkitToMinecraft(effect.getType()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()), EntityPotionEffectEvent.Cause.PLUGIN); -+ this.getHandle().addEffect(CraftPotionUtil.fromBukkit(effect), EntityPotionEffectEvent.Cause.PLUGIN); // Paper - Don't ignore icon ++ this.getHandle().addEffect(org.bukkit.craftbukkit.potion.CraftPotionUtil.fromBukkit(effect), EntityPotionEffectEvent.Cause.PLUGIN); // Paper - Don't ignore icon return true; } @@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public PotionEffect getPotionEffect(PotionEffectType type) { MobEffectInstance handle = this.getHandle().getEffect(CraftPotionEffectType.bukkitToMinecraft(type)); - return (handle == null) ? null : new PotionEffect(CraftPotionEffectType.minecraftToBukkit(handle.getEffect()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isVisible()); -+ return (handle == null) ? null : CraftPotionUtil.toBukkit(handle); // Paper ++ return (handle == null) ? null : org.bukkit.craftbukkit.potion.CraftPotionUtil.toBukkit(handle); // Paper } @Override @@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 List effects = new ArrayList(); for (MobEffectInstance handle : this.getHandle().activeEffects.values()) { - effects.add(new PotionEffect(CraftPotionEffectType.minecraftToBukkit(handle.getEffect()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isVisible())); -+ effects.add(CraftPotionUtil.toBukkit(handle)); // Paper ++ effects.add(org.bukkit.craftbukkit.potion.CraftPotionUtil.toBukkit(handle)); // Paper } return effects; } diff --git a/patches/server/Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch index 2f34244be1..06fa5ca9f9 100644 --- a/patches/server/Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch @@ -48,9 +48,6 @@ https://bugs.mojang.com/browse/MC-123848 by: BillyGalbreath Fixes item frames dropping items above when pointing down -https://bugs.mojang.com/browse/MC-264285 - Fix unbreakable flint and steel being consumed when igniting creepers - https://bugs.mojang.com/browse/MC-84789 Fix wild wolves not considering bones interesting @@ -319,19 +316,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 private void removeFramedMap(ItemStack itemstack) { this.getFramedMapId().ifPresent((i) -> { MapItemSavedData worldmap = MapItem.getSavedData(i, this.level()); -diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java -+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java -@@ -0,0 +0,0 @@ public class Creeper extends Monster implements PowerableMob { - this.level().playSound(player, this.getX(), this.getY(), this.getZ(), soundeffect, this.getSoundSource(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F); - if (!this.level().isClientSide) { - this.ignite(); -- if (!itemstack.isDamageableItem()) { -+ if (itemstack.getItem().getMaxDamage() == 0) { // Paper - fix MC-264285, only shrink the stack if the item type actually has no durability - itemstack.shrink(1); - } else { - itemstack.hurtAndBreak(1, player, (entityhuman1) -> { diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java diff --git a/patches/server/Fix-falling-block-spawn-methods.patch b/patches/server/Fix-falling-block-spawn-methods.patch index d4dc8ab609..1f7f96b6c9 100644 --- a/patches/server/Fix-falling-block-spawn-methods.patch +++ b/patches/server/Fix-falling-block-spawn-methods.patch @@ -10,19 +10,6 @@ Restores the API behavior from previous versions of the server == AT == public net.minecraft.world.entity.item.FallingBlockEntity (Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor { - // Paper end - } else if (FallingBlock.class.isAssignableFrom(clazz)) { - BlockPos pos = BlockPos.containing(x, y, z); -- entity = FallingBlockEntity.fall(world, pos, this.getHandle().getBlockState(pos)); -+ entity = new FallingBlockEntity(world, x, y, z, this.getHandle().getBlockState(pos)); // Paper - } else if (Projectile.class.isAssignableFrom(clazz)) { - if (Snowball.class.isAssignableFrom(clazz)) { - entity = new net.minecraft.world.entity.projectile.Snowball(world, x, y, z); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -55,3 +42,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 return (FallingBlock) entity.getBukkitEntity(); } +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +@@ -0,0 +0,0 @@ public final class CraftEntityTypes { + register(new EntityTypeData<>(EntityType.PRIMED_TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null))); + register(new EntityTypeData<>(EntityType.FALLING_BLOCK, FallingBlock.class, CraftFallingBlock::new, spawnData -> { + BlockPos pos = BlockPos.containing(spawnData.x(), spawnData.y(), spawnData.z()); +- return FallingBlockEntity.fall(spawnData.minecraftWorld(), pos, spawnData.world().getBlockState(pos)); ++ return new FallingBlockEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), spawnData.world().getBlockState(pos)); // Paper - create falling block entities correctly + })); + register(new EntityTypeData<>(EntityType.FIREWORK, Firework.class, CraftFirework::new, spawnData -> new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY))); + register(new EntityTypeData<>(EntityType.EVOKER_FANGS, EvokerFangs.class, CraftEvokerFangs::new, spawnData -> new net.minecraft.world.entity.projectile.EvokerFangs(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), (float) Math.toRadians(spawnData.yaw()), 0, null))); diff --git a/patches/server/Fix-possible-NPE-on-painting-creation.patch b/patches/server/Fix-possible-NPE-on-painting-creation.patch index aed73db03f..d48a987fd2 100644 --- a/patches/server/Fix-possible-NPE-on-painting-creation.patch +++ b/patches/server/Fix-possible-NPE-on-painting-creation.patch @@ -4,25 +4,31 @@ Date: Sat, 24 Jun 2023 09:42:53 -0700 Subject: [PATCH] Fix possible NPE on painting creation -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor { - AABB bb = (ItemFrame.class.isAssignableFrom(clazz)) - ? net.minecraft.world.entity.decoration.ItemFrame.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height) - : HangingEntity.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height); -+ if (!this.getHandle().noCollision(bb)) continue; // Paper - add collision check - List list = (List) this.getHandle().getEntities(null, bb); - for (Iterator it = list.iterator(); !taken && it.hasNext(); ) { - net.minecraft.world.entity.Entity e = it.next(); -@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor { - if (Painting.class.isAssignableFrom(clazz)) { - if (this.isNormalWorld() && randomizeData) { - entity = net.minecraft.world.entity.decoration.Painting.create(world, pos, dir).orElse(null); +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +@@ -0,0 +0,0 @@ public final class CraftEntityTypes { + // Hanging + register(new EntityTypeData<>(EntityType.PAINTING, Painting.class, CraftPainting::new, createHanging(Painting.class, (spawnData, hangingData) -> { + if (spawnData.normalWorld && hangingData.randomize()) { +- return net.minecraft.world.entity.decoration.Painting.create(spawnData.minecraftWorld(), hangingData.position(), hangingData.direction()).orElse(null); - } else { -+ } // Paper -+ if (entity == null) { // Paper - if randomizeData fails, force it - entity = new net.minecraft.world.entity.decoration.Painting(net.minecraft.world.entity.EntityType.PAINTING, this.getHandle().getMinecraftWorld()); - entity.absMoveTo(x, y, z, yaw, pitch); - ((net.minecraft.world.entity.decoration.Painting) entity).setDirection(dir); ++ // Paper start - if randomizeData fails, force it ++ final net.minecraft.world.entity.decoration.Painting entity = net.minecraft.world.entity.decoration.Painting.create(spawnData.minecraftWorld(), hangingData.position(), hangingData.direction()).orElse(null); ++ if (entity != null) { ++ return entity; ++ } ++ } /*else*/ { ++ // Paper end - if randomizeData fails, force it + net.minecraft.world.entity.decoration.Painting entity = new net.minecraft.world.entity.decoration.Painting(net.minecraft.world.entity.EntityType.PAINTING, spawnData.minecraftWorld()); + entity.absMoveTo(spawnData.x(), spawnData.y(), spawnData.z(), spawnData.yaw(), spawnData.pitch()); + entity.setDirection(hangingData.direction()); +@@ -0,0 +0,0 @@ public final class CraftEntityTypes { + AABB bb = (ItemFrame.class.isAssignableFrom(clazz)) + ? net.minecraft.world.entity.decoration.ItemFrame.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height) + : HangingEntity.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height); ++ if (!spawnData.world.noCollision(bb)) continue; // Paper - add collision check + List list = spawnData.world().getEntities(null, bb); + for (Iterator it = list.iterator(); !taken && it.hasNext(); ) { + net.minecraft.world.entity.Entity e = it.next(); diff --git a/patches/server/Fix-rotation-when-spawning-display-entities.patch b/patches/server/Fix-rotation-when-spawning-display-entities.patch index 1b7f6daf3c..089eeadd65 100644 --- a/patches/server/Fix-rotation-when-spawning-display-entities.patch +++ b/patches/server/Fix-rotation-when-spawning-display-entities.patch @@ -4,15 +4,29 @@ Date: Sun, 30 Jul 2023 13:30:34 +0300 Subject: [PATCH] Fix rotation when spawning display entities -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor { +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +@@ -0,0 +0,0 @@ public final class CraftEntityTypes { + Vector direction = spawnData.location().getDirection().multiply(10); + entity.setDirection(direction.getX(), direction.getY(), direction.getZ()); + }; ++ private static final BiConsumer ROT = (spawnData, entity) -> entity.setRot(spawnData.yaw(), spawnData.pitch()); // Paper + private static final Map, EntityTypeData> CLASS_TYPE_DATA = new HashMap<>(); + private static final Map> ENTITY_TYPE_DATA = new HashMap<>(); - if (entity != null) { - entity.setPos(x, y, z); -+ entity.setRot(yaw, pitch); // Paper - Set Display Rotation - } - } +@@ -0,0 +0,0 @@ public final class CraftEntityTypes { + // Set pos + register(new EntityTypeData<>(EntityType.MARKER, Marker.class, CraftMarker::new, createAndSetPos(net.minecraft.world.entity.EntityType.MARKER))); +- register(new EntityTypeData<>(EntityType.BLOCK_DISPLAY, BlockDisplay.class, CraftBlockDisplay::new, createAndSetPos(net.minecraft.world.entity.EntityType.BLOCK_DISPLAY))); ++ register(new EntityTypeData<>(EntityType.BLOCK_DISPLAY, BlockDisplay.class, CraftBlockDisplay::new, combine(createAndSetPos(net.minecraft.world.entity.EntityType.BLOCK_DISPLAY), ROT))); // Paper + register(new EntityTypeData<>(EntityType.INTERACTION, Interaction.class, CraftInteraction::new, createAndSetPos(net.minecraft.world.entity.EntityType.INTERACTION))); +- register(new EntityTypeData<>(EntityType.ITEM_DISPLAY, ItemDisplay.class, CraftItemDisplay::new, createAndSetPos(net.minecraft.world.entity.EntityType.ITEM_DISPLAY))); +- register(new EntityTypeData<>(EntityType.TEXT_DISPLAY, TextDisplay.class, CraftTextDisplay::new, createAndSetPos(net.minecraft.world.entity.EntityType.TEXT_DISPLAY))); ++ register(new EntityTypeData<>(EntityType.ITEM_DISPLAY, ItemDisplay.class, CraftItemDisplay::new, combine(createAndSetPos(net.minecraft.world.entity.EntityType.ITEM_DISPLAY), ROT))); // Paper ++ register(new EntityTypeData<>(EntityType.TEXT_DISPLAY, TextDisplay.class, CraftTextDisplay::new, combine(createAndSetPos(net.minecraft.world.entity.EntityType.TEXT_DISPLAY), ROT))); // Paper + + // MISC + register(new EntityTypeData<>(EntityType.DROPPED_ITEM, Item.class, CraftItem::new, spawnData -> { diff --git a/patches/server/Fix-this-stupid-bullshit.patch b/patches/server/Fix-this-stupid-bullshit.patch index 997faaa22d..6cf977ef88 100644 --- a/patches/server/Fix-this-stupid-bullshit.patch +++ b/patches/server/Fix-this-stupid-bullshit.patch @@ -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, -3); + deadline.add(Calendar.DAY_OF_YEAR, -7); if (buildDate.before(deadline.getTime())) { - System.err.println("*** Error, this build is outdated ***"); + // Paper start - This is some stupid bullshit diff --git a/patches/server/Flag-to-disable-the-channel-limit.patch b/patches/server/Flag-to-disable-the-channel-limit.patch index 09745a21db..fa2f639edc 100644 --- a/patches/server/Flag-to-disable-the-channel-limit.patch +++ b/patches/server/Flag-to-disable-the-channel-limit.patch @@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - // Paper end - more resource pack API + } public void addChannel(String channel) { - Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel); diff --git a/patches/server/Implement-Mob-Goal-API.patch b/patches/server/Implement-Mob-Goal-API.patch index 107ad74d77..2c45cf35a0 100644 --- a/patches/server/Implement-Mob-Goal-API.patch +++ b/patches/server/Implement-Mob-Goal-API.patch @@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { - runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") - runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3") + runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") + runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18") + testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test testImplementation("org.junit.jupiter:junit-jupiter:5.10.0") diff --git a/patches/server/Improve-and-expand-AsyncCatcher.patch b/patches/server/Improve-and-expand-AsyncCatcher.patch index 9fc8447a29..c3f10784bb 100644 --- a/patches/server/Improve-and-expand-AsyncCatcher.patch +++ b/patches/server/Improve-and-expand-AsyncCatcher.patch @@ -174,7 +174,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Override public boolean addPotionEffect(PotionEffect effect, boolean force) { + org.spigotmc.AsyncCatcher.catchOp("effect add"); // Paper - this.getHandle().addEffect(CraftPotionUtil.fromBukkit(effect), EntityPotionEffectEvent.Cause.PLUGIN); // Paper - Don't ignore icon + this.getHandle().addEffect(org.bukkit.craftbukkit.potion.CraftPotionUtil.fromBukkit(effect), EntityPotionEffectEvent.Cause.PLUGIN); // Paper - Don't ignore icon return true; } diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java diff --git a/patches/server/MC-Dev-fixes.patch b/patches/server/MC-Dev-fixes.patch index 0f908d93d2..cfc893631e 100644 --- a/patches/server/MC-Dev-fixes.patch +++ b/patches/server/MC-Dev-fixes.patch @@ -193,40 +193,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 })); this.byName = Maps.newHashMap(builder.build()); // CraftBukkit RecipeManager.LOGGER.info("Loaded {} recipes", map1.size()); -diff --git a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java -@@ -0,0 +0,0 @@ public class CeilingHangingSignBlock extends SignBlock { - public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { - BlockEntity itemStack = world.getBlockEntity(pos); - if (itemStack instanceof SignBlockEntity signBlockEntity) { -- ItemStack itemStack = player.getItemInHand(hand); -- if (this.shouldTryToChainAnotherHangingSign(player, hit, signBlockEntity, itemStack)) { -+ // Paper start - decompile fixes -+ ItemStack itemStack0 = player.getItemInHand(hand); -+ if (this.shouldTryToChainAnotherHangingSign(player, hit, signBlockEntity, itemStack0)) { -+ // Paper end - decompile fixes - return InteractionResult.PASS; - } - } -diff --git a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java -@@ -0,0 +0,0 @@ public class WallHangingSignBlock extends SignBlock { - public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { - BlockEntity itemStack = world.getBlockEntity(pos); - if (itemStack instanceof SignBlockEntity signBlockEntity) { -- ItemStack itemStack = player.getItemInHand(hand); -- if (this.shouldTryToChainAnotherHangingSign(state, player, hit, signBlockEntity, itemStack)) { -+ // Paper start - decompile fixes -+ ItemStack itemStack0 = player.getItemInHand(hand); -+ if (this.shouldTryToChainAnotherHangingSign(state, player, hit, signBlockEntity, itemStack0)) { -+ // Paper end - return InteractionResult.PASS; - } - } diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java diff --git a/patches/server/Missing-Entity-API.patch b/patches/server/Missing-Entity-API.patch index 82d5daa3ab..44656cefd1 100644 --- a/patches/server/Missing-Entity-API.patch +++ b/patches/server/Missing-Entity-API.patch @@ -370,36 +370,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @Nullable @Override protected EntityHitResult findHitEntity(Vec3 currentPosition, Vec3 nextPosition) { -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor { - } else if (Phantom.class.isAssignableFrom(clazz)) { - entity = net.minecraft.world.entity.EntityType.PHANTOM.create(world); - } else if (Fish.class.isAssignableFrom(clazz)) { -- if (Cod.class.isAssignableFrom(clazz)) { -- entity = net.minecraft.world.entity.EntityType.COD.create(world); -+ // Paper start - Schooling Fish API -+ if (io.papermc.paper.entity.SchoolableFish.class.isAssignableFrom(clazz)) { -+ if (Cod.class.isAssignableFrom(clazz)) { -+ entity = net.minecraft.world.entity.EntityType.COD.create(world); -+ } else if (Salmon.class.isAssignableFrom(clazz)) { -+ entity = net.minecraft.world.entity.EntityType.SALMON.create(world); -+ } else if (TropicalFish.class.isAssignableFrom(clazz)) { -+ entity = net.minecraft.world.entity.EntityType.TROPICAL_FISH.create(world); -+ } -+ // Paper stop - } else if (PufferFish.class.isAssignableFrom(clazz)) { - entity = net.minecraft.world.entity.EntityType.PUFFERFISH.create(world); -- } else if (Salmon.class.isAssignableFrom(clazz)) { -- entity = net.minecraft.world.entity.EntityType.SALMON.create(world); -- } else if (TropicalFish.class.isAssignableFrom(clazz)) { -- entity = net.minecraft.world.entity.EntityType.TROPICAL_FISH.create(world); -+ // Paper - remove old fish impl - } else if (Tadpole.class.isAssignableFrom(clazz)) { - entity = net.minecraft.world.entity.EntityType.TADPOLE.create(world); - } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java @@ -668,30 +638,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end } -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { - else { return new CraftSquid(server, (Squid) entity); } - } - else if (entity instanceof AbstractFish) { -- if (entity instanceof Cod) { return new CraftCod(server, (Cod) entity); } -+ // Paper start - Schooling Fish API -+ if (entity instanceof net.minecraft.world.entity.animal.AbstractSchoolingFish abstractSchoolingFish) { -+ if (entity instanceof Cod) { return new CraftCod(server, (Cod) entity); } -+ else if (entity instanceof Salmon) { return new CraftSalmon(server, (Salmon) entity); } -+ else if (entity instanceof TropicalFish) { return new CraftTropicalFish(server, (TropicalFish) entity); } -+ else { return new io.papermc.paper.entity.PaperSchoolableFish(server, abstractSchoolingFish); } -+ } -+ // Paper end - else if (entity instanceof Pufferfish) { return new CraftPufferFish(server, (Pufferfish) entity); } -- else if (entity instanceof Salmon) { return new CraftSalmon(server, (Salmon) entity); } -- else if (entity instanceof TropicalFish) { return new CraftTropicalFish(server, (TropicalFish) entity); } -+ // Paper - move fish - else if (entity instanceof Tadpole) { return new CraftTadpole(server, (Tadpole) entity); } - else { return new CraftFish(server, (AbstractFish) entity); } - } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java diff --git a/patches/server/More-Teleport-API.patch b/patches/server/More-Teleport-API.patch index 8921c93074..7fe135ae5f 100644 --- a/patches/server/More-Teleport-API.patch +++ b/patches/server/More-Teleport-API.patch @@ -179,7 +179,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ServerPlayer entity = this.getHandle(); @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - return false; + return false; } - if (entity.isVehicle()) { diff --git a/patches/server/Paper-config-files.patch b/patches/server/Paper-config-files.patch index 25161ee842..65628f5ab4 100644 --- a/patches/server/Paper-config-files.patch +++ b/patches/server/Paper-config-files.patch @@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") - runtimeOnly("com.mysql:mysql-connector-j:8.1.0") + runtimeOnly("com.mysql:mysql-connector-j:8.2.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 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/patches/server/Respect-randomizeData-on-more-entities-when-spawning.patch b/patches/server/Respect-randomizeData-on-more-entities-when-spawning.patch index aafe302747..7f6d103858 100644 --- a/patches/server/Respect-randomizeData-on-more-entities-when-spawning.patch +++ b/patches/server/Respect-randomizeData-on-more-entities-when-spawning.patch @@ -8,54 +8,61 @@ Subject: [PATCH] Respect randomizeData on more entities when spawning * FireworkRocketEntity * ExperienceOrb -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor { - } else if (org.bukkit.entity.Item.class.isAssignableFrom(clazz)) { - entity = new net.minecraft.world.entity.item.ItemEntity(world, x, y, z, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.DIRT)); - // Paper end -+ // Paper start - respect randomizeData -+ if (!randomizeData) { -+ entity.setDeltaMovement(net.minecraft.world.phys.Vec3.ZERO); +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +@@ -0,0 +0,0 @@ public final class CraftEntityTypes { + entity.setDirection(direction.getX(), direction.getY(), direction.getZ()); + }; + private static final BiConsumer ROT = (spawnData, entity) -> entity.setRot(spawnData.yaw(), spawnData.pitch()); // Paper ++ // Paper start - respect randomizeData ++ private static final BiConsumer CLEAR_MOVE_IF_NOT_RANDOMIZED = (spawnData, entity) -> { ++ if (!spawnData.randomizeData()) { ++ entity.setDeltaMovement(net.minecraft.world.phys.Vec3.ZERO); ++ } ++ }; ++ // Paper end - respect randomizeData + private static final Map, EntityTypeData> CLASS_TYPE_DATA = new HashMap<>(); + private static final Map> ENTITY_TYPE_DATA = new HashMap<>(); + +@@ -0,0 +0,0 @@ public final class CraftEntityTypes { + net.minecraft.world.item.ItemStack itemStack = new net.minecraft.world.item.ItemStack(Items.STONE); + ItemEntity item = new ItemEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), itemStack); + item.setPickUpDelay(10); ++ CLEAR_MOVE_IF_NOT_RANDOMIZED.accept(spawnData, item); // Paper - respect randomizeData + + return item; + })); + register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new, +- spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null) // Paper ++ combine(combine(spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null), CLEAR_MOVE_IF_NOT_RANDOMIZED), (spawnData, experienceOrb) -> { if (!spawnData.randomizeData()) { experienceOrb.setYRot(0); } }) // Paper - respect randomizeData + )); + register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, createAndMove(net.minecraft.world.entity.EntityType.AREA_EFFECT_CLOUD))); // Paper - set area effect cloud rotation + register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); +@@ -0,0 +0,0 @@ public final class CraftEntityTypes { + entity.setItem(CraftItemStack.asNMSCopy(new ItemStack(Material.SPLASH_POTION, 1))); + return entity; + })); +- register(new EntityTypeData<>(EntityType.PRIMED_TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null))); ++ register(new EntityTypeData<>(EntityType.PRIMED_TNT, TNTPrimed.class, CraftTNTPrimed::new, combine(spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null), CLEAR_MOVE_IF_NOT_RANDOMIZED))); // Paper - respect randomizeData + register(new EntityTypeData<>(EntityType.FALLING_BLOCK, FallingBlock.class, CraftFallingBlock::new, spawnData -> { + BlockPos pos = BlockPos.containing(spawnData.x(), spawnData.y(), spawnData.z()); + return new FallingBlockEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), spawnData.world().getBlockState(pos)); // Paper - create falling block entities correctly + })); +- register(new EntityTypeData<>(EntityType.FIREWORK, Firework.class, CraftFirework::new, spawnData -> new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY))); ++ // Paper start - respect randomizeData ++ register(new EntityTypeData<>(EntityType.FIREWORK, Firework.class, CraftFirework::new, spawnData -> { ++ FireworkRocketEntity entity = new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY); ++ if (!spawnData.randomizeData()) { ++ // logic below was taken from FireworkRocketEntity constructor ++ entity.setDeltaMovement(0, 0.05, 0); ++ //noinspection PointlessArithmeticExpression ++ entity.lifetime = 10 * 1 + 6; + } -+ // Paper end - respect randomizeData - } else if (FallingBlock.class.isAssignableFrom(clazz)) { - BlockPos pos = BlockPos.containing(x, y, z); - entity = new FallingBlockEntity(world, x, y, z, this.getHandle().getBlockState(pos)); // Paper -@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor { - entity.moveTo(x, y, z, yaw, pitch); - } else if (Firework.class.isAssignableFrom(clazz)) { - entity = new FireworkRocketEntity(world, x, y, z, net.minecraft.world.item.ItemStack.EMPTY); -+ // Paper start - respect randomizeData -+ if (!randomizeData) { -+ // logic below was taken from FireworkRocketEntity constructor -+ entity.setDeltaMovement(0, 0.05, 0); -+ //noinspection PointlessArithmeticExpression -+ ((FireworkRocketEntity) entity).lifetime = 10 * 1 + 6; -+ } -+ // Paper end - respect randomizeData - } - } else if (Minecart.class.isAssignableFrom(clazz)) { - if (PoweredMinecart.class.isAssignableFrom(clazz)) { -@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor { - } - } else if (TNTPrimed.class.isAssignableFrom(clazz)) { - entity = new PrimedTnt(world, x, y, z, null); -+ // Paper start - respect randomizeData -+ if (!randomizeData) { -+ entity.setDeltaMovement(net.minecraft.world.phys.Vec3.ZERO); -+ } -+ // Paper end - respect randomizeData - } else if (ExperienceOrb.class.isAssignableFrom(clazz)) { - entity = new net.minecraft.world.entity.ExperienceOrb(world, x, y, z, 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null); // Paper -+ // Paper start - respect randomizeData -+ if (!randomizeData) { -+ entity.setDeltaMovement(net.minecraft.world.phys.Vec3.ZERO); -+ entity.setYRot(0); -+ } -+ // Paper end - respect randomizeData - } else if (LightningStrike.class.isAssignableFrom(clazz)) { - entity = net.minecraft.world.entity.EntityType.LIGHTNING_BOLT.create(world); - entity.moveTo(location.getX(), location.getY(), location.getZ()); ++ return entity; ++ })); ++ // Paper end - respect randomizeData + register(new EntityTypeData<>(EntityType.EVOKER_FANGS, EvokerFangs.class, CraftEvokerFangs::new, spawnData -> new net.minecraft.world.entity.projectile.EvokerFangs(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), (float) Math.toRadians(spawnData.yaw()), 0, null))); + register(new EntityTypeData<>(EntityType.MINECART_COMMAND, CommandMinecart.class, CraftMinecartCommand::new, spawnData -> new MinecartCommandBlock(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); + register(new EntityTypeData<>(EntityType.MINECART, RideableMinecart.class, CraftMinecartRideable::new, spawnData -> new Minecart(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); diff --git a/patches/server/Set-area-affect-cloud-rotation.patch b/patches/server/Set-area-affect-cloud-rotation.patch index 4eaba65e59..9afd5c0921 100644 --- a/patches/server/Set-area-affect-cloud-rotation.patch +++ b/patches/server/Set-area-affect-cloud-rotation.patch @@ -4,15 +4,16 @@ Date: Mon, 5 Apr 2021 16:58:20 -0400 Subject: [PATCH] Set area affect cloud rotation -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java -@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor { - entity.moveTo(location.getX(), location.getY(), location.getZ()); - } else if (AreaEffectCloud.class.isAssignableFrom(clazz)) { - entity = new net.minecraft.world.entity.AreaEffectCloud(world, x, y, z); -+ entity.moveTo(x, y, z, yaw, pitch); // Paper - Set area effect cloud Rotation - } else if (EvokerFangs.class.isAssignableFrom(clazz)) { - entity = new net.minecraft.world.entity.projectile.EvokerFangs(world, x, y, z, (float) Math.toRadians(yaw), 0, null); - } else if (Marker.class.isAssignableFrom(clazz)) { +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java +@@ -0,0 +0,0 @@ public final class CraftEntityTypes { + register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new, + spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null) // Paper + )); +- register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, spawnData -> new net.minecraft.world.entity.AreaEffectCloud(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); ++ register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, createAndMove(net.minecraft.world.entity.EntityType.AREA_EFFECT_CLOUD))); // Paper - set area effect cloud rotation + register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); + register(new EntityTypeData<>(EntityType.LEASH_HITCH, LeashHitch.class, CraftLeash::new, spawnData -> new LeashFenceKnotEntity(spawnData.minecraftWorld(), BlockPos.containing(spawnData.x(), spawnData.y(), spawnData.z())))); // SPIGOT-5732: LeashHitch has no direction and is always centered at a block + register(new EntityTypeData<>(EntityType.SNOWBALL, Snowball.class, CraftSnowball::new, spawnData -> new net.minecraft.world.entity.projectile.Snowball(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z()))); diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index 674c91c632..a27bc142ef 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -49,11 +49,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + implementation("org.ow2.asm:asm:9.5") + implementation("commons-lang:commons-lang:2.6") + runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") -+ runtimeOnly("com.mysql:mysql-connector-j:8.1.0") ++ runtimeOnly("com.mysql:mysql-connector-j:8.2.0") + -+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5") -+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") -+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3") ++ runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6") ++ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") ++ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18") + + testImplementation("org.junit.jupiter:junit-jupiter:5.10.0") + testImplementation("org.hamcrest:hamcrest:2.2") @@ -420,26 +420,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - com.mysql - mysql-connector-j -- 8.1.0 +- 8.2.0 - runtime - - - - org.apache.maven - maven-resolver-provider -- 3.8.5 +- 3.9.6 - runtime - - - org.apache.maven.resolver - maven-resolver-connector-basic -- 1.7.3 +- 1.9.18 - runtime - - - org.apache.maven.resolver - maven-resolver-transport-http -- 1.7.3 +- 1.9.18 - runtime - - diff --git a/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index c1093120a8..a46534b52e 100644 --- a/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -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, -3); + deadline.add(Calendar.DAY_OF_YEAR, -7); 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 ***"); diff --git a/patches/server/Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch b/patches/server/Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch index 7214ff5959..32c3dd9dea 100644 --- a/patches/server/Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch +++ b/patches/server/Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch @@ -11,11 +11,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 @@ -0,0 +0,0 @@ dependencies { implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") - runtimeOnly("com.mysql:mysql-connector-j:8.1.0") + runtimeOnly("com.mysql:mysql-connector-j:8.2.0") + runtimeOnly("com.lmax:disruptor:3.4.4") // Paper - runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5") - runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") + runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6") + runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/resources/log4j2.xml diff --git a/patches/server/Use-Velocity-compression-and-cipher-natives.patch b/patches/server/Use-Velocity-compression-and-cipher-natives.patch index 113dc004f7..19f0cbfb84 100644 --- a/patches/server/Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/Use-Velocity-compression-and-cipher-natives.patch @@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") - runtimeOnly("com.mysql:mysql-connector-j:8.1.0") + runtimeOnly("com.mysql:mysql-connector-j:8.2.0") runtimeOnly("com.lmax:disruptor:3.4.4") // Paper + // Paper start - Use Velocity cipher + implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") { @@ -18,8 +18,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5") - runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") + runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6") + runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") diff --git a/src/main/java/net/minecraft/network/CipherDecoder.java b/src/main/java/net/minecraft/network/CipherDecoder.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/network/CipherDecoder.java diff --git a/scripts/upstreamCommit.sh b/scripts/upstreamCommit.sh index 3e5e79f1b9..e994d90a5f 100755 --- a/scripts/upstreamCommit.sh +++ b/scripts/upstreamCommit.sh @@ -5,7 +5,7 @@ PS1="$" function changelog() { base=$(git ls-tree HEAD $1 | cut -d' ' -f3 | cut -f1) - cd $1 && git log --oneline ${base}...HEAD | sed -E 's/(^[0-9a-f]{8,}( SPIGOT-[0-9]{1,4},?)* |Revert ")#([0-9]+)/\1PR-\3/' + cd $1 && git log --oneline ${base}...HEAD | sed -E 's/(^[0-9a-f]{8,}( (SPIGOT-[0-9]{1,4}|MC-[0-9]{1,6}),?)* |Revert ")#([0-9]+)/\1PR-\4/' } bukkit=$(changelog work/Bukkit) cb=$(changelog work/CraftBukkit) diff --git a/work/Bukkit b/work/Bukkit index 01bb6ba7d0..f29cb80158 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 01bb6ba7d0add97af46db9ae8c2c991912033aa7 +Subproject commit f29cb8015897da1bca0c93522c5884c4c9f93601 diff --git a/work/CraftBukkit b/work/CraftBukkit index cb2ea54def..b3b43a6ad2 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit cb2ea54def89e749d9d1f6a4a7ea029110f03a43 +Subproject commit b3b43a6ad21c9f7fc2dd0a1e7e94abae0057770d diff --git a/work/Spigot b/work/Spigot index ce0f71e427..06d602e7c3 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit ce0f71e4276e911707a258a968371f06f8718aca +Subproject commit 06d602e7c3165ebf32f7419cb5873ec82d54ff7c