diff --git a/patches/api/Add-API-to-get-exact-interaction-point-in-PlayerInte.patch b/patches/api/Add-API-to-get-exact-interaction-point-in-PlayerInte.patch index 16a1229b77..c1464806b4 100644 --- a/patches/api/Add-API-to-get-exact-interaction-point-in-PlayerInte.patch +++ b/patches/api/Add-API-to-get-exact-interaction-point-in-PlayerInte.patch @@ -16,38 +16,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -0,0 +0,0 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { - private Result useClickedBlock; - private Result useItemInHand; - private EquipmentSlot hand; -+ private Location interactionPoint; // Paper - - public PlayerInteractEvent(@NotNull final Player who, @NotNull final Action action, @Nullable final ItemStack item, @Nullable final Block clickedBlock, @NotNull final BlockFace clickedFace) { - this(who, action, item, clickedBlock, clickedFace, EquipmentSlot.HAND); - } - - public PlayerInteractEvent(@NotNull final Player who, @NotNull final Action action, @Nullable final ItemStack item, @Nullable final Block clickedBlock, @NotNull final BlockFace clickedFace, @Nullable final EquipmentSlot hand) { -+ // Paper start - Add interactionPoint -+ this(who, action, item, clickedBlock, clickedFace, hand, null); -+ } -+ -+ public PlayerInteractEvent(@NotNull final Player who, @NotNull final Action action, @Nullable final ItemStack item, @Nullable final Block clickedBlock, @NotNull final BlockFace clickedFace, @Nullable final EquipmentSlot hand, @Nullable final Location interactionPoint) { - super(who); - this.action = action; - this.item = item; - this.blockClicked = clickedBlock; - this.blockFace = clickedFace; - this.hand = hand; -+ this.interactionPoint = interactionPoint; - - useItemInHand = Result.DEFAULT; - useClickedBlock = clickedBlock == null ? Result.DENY : Result.ALLOW; - } -+ // Paper end - - /** - * Returns the action type -@@ -0,0 +0,0 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable { - return hand; + *

+ * All vector components are between 0.0 and 1.0 inclusive. + * ++ * @deprecated misleading, use {@link #getInteractionPoint()} + * @return the clicked position. May be null. + */ + @Nullable ++ @Deprecated // Paper + public Vector getClickedPosition() { + return clickedPosistion; } + // Paper start @@ -58,7 +36,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + */ + @Nullable + public Location getInteractionPoint() { -+ return interactionPoint; ++ if (this.blockClicked == null || this.clickedPosistion == null) { ++ return null; ++ } ++ return this.blockClicked.getLocation().add(this.clickedPosistion); + } + // Paper end + diff --git a/patches/api/Add-FastUtil-to-Bukkit.patch b/patches/api/Add-FastUtil-to-Bukkit.patch index dd3cbde276..58114b0f3c 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.9.2") + compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index 36b18fb140..8075c09e61 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -51,7 +51,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + apiAndDocs("net.kyori:adventure-text-logger-slf4j") // Paper end - compileOnly("org.apache.maven:maven-resolver-provider:3.9.2") + compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") @@ -0,0 +0,0 @@ tasks.withType { "https://guava.dev/releases/31.1-jre/api/docs/", "https://javadoc.io/doc/org.yaml/snakeyaml/2.0/", diff --git a/patches/api/Build-system-changes.patch b/patches/api/Build-system-changes.patch index 5dd813b8af..11478221cf 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.9.2") - compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10") - compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.10") + 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("com.google.code.findbugs:jsr305:1.3.9") // Paper - val annotations = "org.jetbrains:annotations-java5:$annotationsVersion" diff --git a/patches/api/Convert-project-to-Gradle.patch b/patches/api/Convert-project-to-Gradle.patch index 884d4feac0..a7f3afed80 100644 --- a/patches/api/Convert-project-to-Gradle.patch +++ b/patches/api/Convert-project-to-Gradle.patch @@ -51,9 +51,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + api("org.yaml:snakeyaml:2.0") + api("org.joml:joml:1.10.5") + -+ compileOnly("org.apache.maven:maven-resolver-provider:3.9.2") -+ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10") -+ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.10") ++ 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") + + val annotations = "org.jetbrains:annotations-java5:$annotationsVersion" + compileOnly(annotations) @@ -193,19 +193,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.apache.maven - maven-resolver-provider -- 3.9.2 +- 3.8.5 - provided - - - org.apache.maven.resolver - maven-resolver-connector-basic -- 1.9.10 +- 1.7.3 - provided - - - org.apache.maven.resolver - maven-resolver-transport-http -- 1.9.10 +- 1.7.3 - provided - - diff --git a/patches/api/Paper-Plugins.patch b/patches/api/Paper-Plugins.patch index 14ff666d9c..a7fc991a7c 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.4") // Paper end -- compileOnly("org.apache.maven:maven-resolver-provider:3.9.2") -+ api("org.apache.maven:maven-resolver-provider:3.9.2") - compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10") - compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.10") +- 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("com.google.code.findbugs:jsr305:1.3.9") // Paper diff --git a/src/main/java/io/papermc/paper/plugin/PermissionManager.java b/src/main/java/io/papermc/paper/plugin/PermissionManager.java new file mode 100644 diff --git a/patches/api/Use-ASM-for-event-executors.patch b/patches/api/Use-ASM-for-event-executors.patch index 31022d18de..888ff399f8 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.4") // Paper end - compileOnly("org.apache.maven:maven-resolver-provider:3.9.2") + compileOnly("org.apache.maven:maven-resolver-provider:3.8.5") 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/Correctly-handle-interactions-with-items-on-cooldown.patch b/patches/server/Correctly-handle-interactions-with-items-on-cooldown.patch index 521cb74265..51442065d5 100644 --- a/patches/server/Correctly-handle-interactions-with-items-on-cooldown.patch +++ b/patches/server/Correctly-handle-interactions-with-items-on-cooldown.patch @@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + cancelledItem = true; // Paper - correctly handle items on cooldown } -- PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, blockposition, hitResult.getDirection(), stack, cancelledBlock, hand, hitResult.getLocation()); // Paper +- PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, blockposition, hitResult.getDirection(), stack, cancelledBlock, hand, hitResult.getLocation()); + PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, blockposition, hitResult.getDirection(), stack, cancelledBlock, cancelledItem, hand, hitResult.getLocation()); // Paper this.firedInteract = true; this.interactResult = event.useItemInHand() == Event.Result.DENY; @@ -34,18 +34,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { + return CraftEventFactory.callPlayerInteractEvent(who, action, position, direction, itemstack, false, hand, null); } - public static PlayerInteractEvent callPlayerInteractEvent(net.minecraft.world.entity.player.Player who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, InteractionHand hand, Vec3 hitVec) { -+ // Paper start - correctly handle items on cooldown -+ return callPlayerInteractEvent(who, action, position, direction, itemstack, cancelledBlock, false, hand, hitVec); -+ } + -+ public static PlayerInteractEvent callPlayerInteractEvent(net.minecraft.world.entity.player.Player who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, boolean cancelledItem, InteractionHand hand, Vec3 hitVec) { -+ // Paper end - correctly handle items on cooldown - // Paper end ++ // Paper start - cancelledItem param + public static PlayerInteractEvent callPlayerInteractEvent(net.minecraft.world.entity.player.Player who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, InteractionHand hand, Vec3 targetPos) { ++ return CraftEventFactory.callPlayerInteractEvent(who, action, position, direction, itemstack, false, false, hand, null); ++ } ++ public static PlayerInteractEvent callPlayerInteractEvent(net.minecraft.world.entity.player.Player who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, boolean cancelledItem, InteractionHand hand, Vec3 targetPos) { ++ // Paper end - cancelledItem param Player player = (who == null) ? null : (Player) who.getBukkitEntity(); CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack); + @@ -0,0 +0,0 @@ public class CraftEventFactory { if (cancelledBlock) { event.setUseInteractedBlock(Event.Result.DENY); diff --git a/patches/server/Implement-API-to-expose-exact-interaction-point.patch b/patches/server/Implement-API-to-expose-exact-interaction-point.patch deleted file mode 100644 index 4812327eb8..0000000000 --- a/patches/server/Implement-API-to-expose-exact-interaction-point.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Madeline Miller -Date: Mon, 4 Jan 2021 16:40:27 +1000 -Subject: [PATCH] Implement API to expose exact interaction point - - -diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -0,0 +0,0 @@ public class ServerPlayerGameMode { - cancelledBlock = true; - } - -- PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, blockposition, hitResult.getDirection(), stack, cancelledBlock, hand); -+ PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(player, Action.RIGHT_CLICK_BLOCK, blockposition, hitResult.getDirection(), stack, cancelledBlock, hand, hitResult.getLocation()); // Paper - this.firedInteract = true; - this.interactResult = event.useItemInHand() == Event.Result.DENY; - this.interactPosition = blockposition.immutable(); -diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -0,0 +0,0 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParams; - import net.minecraft.world.phys.BlockHitResult; - import net.minecraft.world.phys.EntityHitResult; - import net.minecraft.world.phys.HitResult; -+import net.minecraft.world.phys.Vec3; - import org.bukkit.Bukkit; -+import org.bukkit.Location; // Paper - import org.bukkit.Material; - import org.bukkit.NamespacedKey; - import org.bukkit.Server; -@@ -0,0 +0,0 @@ public class CraftEventFactory { - return CraftEventFactory.callPlayerInteractEvent(who, action, position, direction, itemstack, false, hand); - } - -+ // Paper start - Add interactionPoint - public static PlayerInteractEvent callPlayerInteractEvent(net.minecraft.world.entity.player.Player who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, InteractionHand hand) { -+ return callPlayerInteractEvent(who, action, position, direction, itemstack, cancelledBlock, hand, null); -+ } -+ -+ public static PlayerInteractEvent callPlayerInteractEvent(net.minecraft.world.entity.player.Player who, Action action, BlockPos position, Direction direction, ItemStack itemstack, boolean cancelledBlock, InteractionHand hand, Vec3 hitVec) { -+ // Paper end - Player player = (who == null) ? null : (Player) who.getBukkitEntity(); - CraftItemStack itemInHand = CraftItemStack.asCraftMirror(itemstack); - -@@ -0,0 +0,0 @@ public class CraftEventFactory { - itemInHand = null; - } - -- PlayerInteractEvent event = new PlayerInteractEvent(player, action, itemInHand, blockClicked, blockFace, (hand == null) ? null : ((hand == InteractionHand.OFF_HAND) ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND)); -+ // Paper start -+ Location interactionPoint = hitVec == null ? null : new Location(craftWorld, hitVec.x, hitVec.y, hitVec.z); -+ PlayerInteractEvent event = new PlayerInteractEvent(player, action, itemInHand, blockClicked, blockFace, (hand == null) ? null : ((hand == InteractionHand.OFF_HAND) ? EquipmentSlot.OFF_HAND : EquipmentSlot.HAND), interactionPoint); -+ // Paper end - if (cancelledBlock) { - event.setUseInteractedBlock(Event.Result.DENY); - } diff --git a/patches/server/Implement-Mob-Goal-API.patch b/patches/server/Implement-Mob-Goal-API.patch index 00b608e915..8f8ea1f9e2 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.9.10") - runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.10") + runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") + runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3") + testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test testImplementation("junit:junit:4.13.2") diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index 543a7f2459..7200d99d46 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -51,9 +51,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.0") + runtimeOnly("com.mysql:mysql-connector-j:8.0.33") + -+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.2") -+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10") -+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.10") ++ 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") + + testImplementation("junit:junit:4.13.2") + testImplementation("org.hamcrest:hamcrest-library:1.3") @@ -419,19 +419,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.apache.maven - maven-resolver-provider -- 3.9.2 +- 3.8.5 - runtime - - - org.apache.maven.resolver - maven-resolver-connector-basic -- 1.9.10 +- 1.7.3 - runtime - - - org.apache.maven.resolver - maven-resolver-transport-http -- 1.9.10 +- 1.7.3 - runtime - - diff --git a/patches/server/Support-components-in-ItemMeta.patch b/patches/server/Support-components-in-ItemMeta.patch index 2759fdd779..04a360c20c 100644 --- a/patches/server/Support-components-in-ItemMeta.patch +++ b/patches/server/Support-components-in-ItemMeta.patch @@ -79,5 +79,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } else + // Paper end if (!(object instanceof String)) { - Preconditions.checkArgument(object == null, "%s cannot contain non-string %s", addFrom, object.getClass().getName()); - + if (object != null) { + // SPIGOT-7399: Null check via if is important, 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 b5823b335b..5d27e7ca4b 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 @@ -14,8 +14,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 runtimeOnly("com.mysql:mysql-connector-j:8.0.33") + runtimeOnly("com.lmax:disruptor:3.4.4") // Paper - runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.2") - runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10") + runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5") + runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") 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 25303d9e99..833ee71203 100644 --- a/patches/server/Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/Use-Velocity-compression-and-cipher-natives.patch @@ -18,8 +18,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + // Paper end - runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.2") - runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.10") + runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5") + runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") 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/work/Bukkit b/work/Bukkit index be1f33449e..0c5d870919 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit be1f33449ea205e494a7bcf2e9322319c6166204 +Subproject commit 0c5d870919854258f5f51530a66d839fba20e288 diff --git a/work/CraftBukkit b/work/CraftBukkit index 3b557627cd..b6b514b7ec 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 3b557627cd8274a4a2b16375886c492964db38eb +Subproject commit b6b514b7ec49531dc334c4e7bfee2569cfe33398