Updated Upstream (Bukkit/CraftBukkit)

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

Bukkit Changes:
0c5d8709 SPIGOT-7400: Downgrade maven-resolver due to issues resolving certain depends
255c4fdb SPIGOT-7380: Add PlayerInteractEvent#getClickedPosition and ChiseledBookshelf#getSlot

CraftBukkit Changes:
b6b514b7e SPIGOT-7400: Downgrade maven-resolver due to issues resolving certain depends
fcff84de9 SPIGOT-7399: Revert null check in CraftMetaItem#safelyAdd
44a4b5649 SPIGOT-7380: Add PlayerInteractEvent#getClickedPosition and ChiseledBookshelf#getSlot
676969d01 SPIGOT-7389: Handle setting null items in ChiseledBookshelf Inventory
This commit is contained in:
Nassim Jahnke 2023-06-18 13:03:18 +02:00
parent 873533b129
commit 275173e538
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
475 changed files with 191 additions and 268 deletions

View File

@ -27,7 +27,7 @@ index 11038da2e071699d6561a331565db0c8d7850d0e..317acfec5894101294a55abff6181943
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..73bc33e7a498f8eca2d68c4588b04de4eaf8fc7a
index 0000000000000000000000000000000000000000..232cc8fafb1d7d9730cf2f58777e8977995ec28b
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,85 @@
@ -51,9 +51,9 @@ index 0000000000000000000000000000000000000000..73bc33e7a498f8eca2d68c4588b04de4
+ 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)
@ -118,7 +118,7 @@ index 0000000000000000000000000000000000000000..73bc33e7a498f8eca2d68c4588b04de4
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index e6d48b5fdc484ed2443ddf1d60079a13ea2c9677..0000000000000000000000000000000000000000
index d3b75bb8b9cb0623ed9e13226ced09c5fa7c3f2c..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,270 +0,0 @@
@ -193,19 +193,19 @@ index e6d48b5fdc484ed2443ddf1d60079a13ea2c9677..00000000000000000000000000000000
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-resolver-provider</artifactId>
- <version>3.9.2</version>
- <version>3.8.5</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.resolver</groupId>
- <artifactId>maven-resolver-connector-basic</artifactId>
- <version>1.9.10</version>
- <version>1.7.3</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.resolver</groupId>
- <artifactId>maven-resolver-transport-http</artifactId>
- <version>1.9.10</version>
- <version>1.7.3</version>
- <scope>provided</scope>
- </dependency>
- <!-- annotations -->

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
index 73bc33e7a498f8eca2d68c4588b04de4eaf8fc7a..34117c1178e04885ff9be5b73c7c2547e77ed4d5 100644
index 232cc8fafb1d7d9730cf2f58777e8977995ec28b..3faf250d59eeefb8477a6e1454914bdd88ff11d6 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -17,15 +17,27 @@ dependencies {
@ -18,9 +18,9 @@ index 73bc33e7a498f8eca2d68c4588b04de4eaf8fc7a..34117c1178e04885ff9be5b73c7c2547
+ }
+ // 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"

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add FastUtil to Bukkit
Doesn't expose to plugins, just allows Paper-API to use it for optimization
diff --git a/build.gradle.kts b/build.gradle.kts
index c174d9d6534382ae9d002b883bde929d46e32789..3e571743e76b26167e329dbd0a4c04ffd6427572 100644
index 4a5f1737910c1c87838baf01366f20c814a39a8f..3dec6ab39000edd3e90d1bf734d24cc779ce0e3b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -21,6 +21,7 @@ dependencies {
@ -16,4 +16,4 @@ index c174d9d6534382ae9d002b883bde929d46e32789..3e571743e76b26167e329dbd0a4c04ff
+ 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")

View File

@ -7,7 +7,7 @@ Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index 3e571743e76b26167e329dbd0a4c04ffd6427572..7671b795188adfea56daea2d957e173c8d07c086 100644
index 3dec6ab39000edd3e90d1bf734d24cc779ce0e3b..cbab63d2f3b045f6193f5a3422ae4b5509d3003b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,13 +8,26 @@ java {
@ -51,7 +51,7 @@ index 3e571743e76b26167e329dbd0a4c04ffd6427572..7671b795188adfea56daea2d957e173c
+ 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")
@@ -82,10 +102,26 @@ tasks.withType<Javadoc> {
"https://guava.dev/releases/31.1-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/2.0/",

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods.
diff --git a/build.gradle.kts b/build.gradle.kts
index a6001fec6b8ff6a0d41336802d202e005ad2db81..a626bbad85f8d1b348d4e67f328f4b0141b267c1 100644
index cbab63d2f3b045f6193f5a3422ae4b5509d3003b..ba6f0a70ba2442dbe60ed6cc92e4fb91a48d9f3b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -42,6 +42,9 @@ dependencies {
@ -18,7 +18,7 @@ index a6001fec6b8ff6a0d41336802d202e005ad2db81..a626bbad85f8d1b348d4e67f328f4b01
+ 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..5b28e9b1daba7834af67dbc193dd656bedd9a994

View File

@ -5,17 +5,17 @@ Subject: [PATCH] Paper Plugins
diff --git a/build.gradle.kts b/build.gradle.kts
index a626bbad85f8d1b348d4e67f328f4b0141b267c1..b0ca0ddffce2524e82d891c7a4d69d3ef9f2c097 100644
index ba6f0a70ba2442dbe60ed6cc92e4fb91a48d9f3b..22b65c3ad4ed6e19b88a51a2e001f0e5846d9ae6 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -47,7 +47,7 @@ dependencies {
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

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add API to get exact interaction point in PlayerInteractEvent
diff --git a/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java b/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java
index 1208e1f8c2163d83c5b12bbb9b7ac044c72380e0..a01f86e6aba8b66ecc713da0787cd861e2930a2a 100644
index ed72095b5cf669d9f25852e8ef772a710c54012a..ddea08e4de2198a0a7565e2fd7a05571ed48f27b 100644
--- a/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerInteractEvent.java
@@ -1,5 +1,6 @@
@ -15,39 +15,17 @@ index 1208e1f8c2163d83c5b12bbb9b7ac044c72380e0..a01f86e6aba8b66ecc713da0787cd861
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
@@ -34,22 +35,30 @@ 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
@@ -221,6 +230,18 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
return hand;
@@ -234,13 +235,30 @@ public class PlayerInteractEvent extends PlayerEvent implements Cancellable {
* <p>
* 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 1208e1f8c2163d83c5b12bbb9b7ac044c72380e0..a01f86e6aba8b66ecc713da0787cd861
+ */
+ @Nullable
+ public Location getInteractionPoint() {
+ return interactionPoint;
+ if (this.blockClicked == null || this.clickedPosistion == null) {
+ return null;
+ }
+ return this.blockClicked.getLocation().add(this.clickedPosistion);
+ }
+ // Paper end
+

View File

@ -28,7 +28,7 @@ index 3df8c60ab5cd1454660980883f80668d535b742b..37c3a00659ce21623be07317f4f6a45b
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..9a355bbbe57629d0b66f8260ecf461e3bf1a539b
index 0000000000000000000000000000000000000000..f7d5f785f659aa905000d974f573e43f841e7fc0
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,138 @@
@ -51,9 +51,9 @@ index 0000000000000000000000000000000000000000..9a355bbbe57629d0b66f8260ecf461e3
+ 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")
@ -172,7 +172,7 @@ index 0000000000000000000000000000000000000000..9a355bbbe57629d0b66f8260ecf461e3
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index ccb57a056138549ec39ddaef2f09590b1fddd127..0000000000000000000000000000000000000000
index 76dce1e84f5f8f61a866eb3bbdc3e23cc8cc7a5a..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,587 +0,0 @@
@ -419,19 +419,19 @@ index ccb57a056138549ec39ddaef2f09590b1fddd127..00000000000000000000000000000000
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-resolver-provider</artifactId>
- <version>3.9.2</version>
- <version>3.8.5</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.resolver</groupId>
- <artifactId>maven-resolver-connector-basic</artifactId>
- <version>1.9.10</version>
- <version>1.7.3</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.maven.resolver</groupId>
- <artifactId>maven-resolver-transport-http</artifactId>
- <version>1.9.10</version>
- <version>1.7.3</version>
- <scope>runtime</scope>
- </dependency>
- <!-- annotations -->

View File

@ -2387,7 +2387,7 @@ index ba89c0d7ae99e53350249365d0e035e6f14e1c5f..dc87e56cfcd59bc1505f5b3c0363038e
// CraftBukkit end
this.chatVisibility = packet.chatVisibility();
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a7b85cf4fbdb04747e46f49293a2e63c744cdc5e..fa3d02895d57c17416e742d2ea1e51253bce4fad 100644
index c77e561ab7598846cb3de2aaee3e59e34d48215f..9e47f748ff6ccdb5791828ac8c41684ba2682fbd 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -187,6 +187,8 @@ import net.minecraft.world.phys.shapes.VoxelShape;
@ -3653,7 +3653,7 @@ index 446fdca49a5a6999626a7ee3a1d5c168b15a09dd..f9863e138994f6c7a7975a852f106faa
public boolean isOp() {
return true;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 39a6c870c08ae5847dc5859316b1b616b3a0fa5b..41ec9e0adb2a17f8cab4fb1f1735d8b2679f92d0 100644
index 02b62fa3b5a472728c5f2daaa15b2595c8f01864..a513bef2e9b9329f129cc2d5028815e2a0b1b14b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -286,14 +286,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -4148,10 +4148,10 @@ index 2becf197a5c2d94f23f72a9b20cb2cd05a0807df..99096c1e3f045e4a99335faedfb8e77e
@Override
public int getLineWidth() {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 5f994a64bf29545a528b91604c1f2e19bcfd9b2f..e0bb58d92e47516138261a673b56c5f8ce68a59c 100644
index eb2b9aa73913ef6dde8e0909dbd4064f0147ead0..551fd24885cee87a3ca579f2f4bf0a18b9505e79 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -838,9 +838,9 @@ public class CraftEventFactory {
@@ -846,9 +846,9 @@ public class CraftEventFactory {
return event;
}
@ -4163,7 +4163,7 @@ index 5f994a64bf29545a528b91604c1f2e19bcfd9b2f..e0bb58d92e47516138261a673b56c5f8
event.setKeepInventory(keepInventory);
event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel
org.bukkit.World world = entity.getWorld();
@@ -865,7 +865,7 @@ public class CraftEventFactory {
@@ -873,7 +873,7 @@ public class CraftEventFactory {
* Server methods
*/
public static ServerListPingEvent callServerListPingEvent(Server craftServer, InetAddress address, String motd, int numPlayers, int maxPlayers) {
@ -4570,7 +4570,7 @@ index 507fa96a3fb904b74429df5756c9a6378ec8c5b7..abb9e88abc74135284b941e040d40586
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 02856de529023f4d63440e2f2cef28e41f2103a7..b01c268d179591a0113e4bfb46f3d6d22933efaf 100644
index 03e5058810553be884c87f9f7b793cb5fadb7284..44244166ec4e8ac070404101219efbc0e5f1d168 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -749,6 +749,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {

View File

@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the
ItemMeta API equivalents, and should deprecate the old API's.
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 2e948330c4951e3df7091fa870573f163d2af286..4b19057fba6c6645dc79f6572a3fb01cb2c4c26c 100644
index 6758e72177c0a407cf6c392b10263f095e4d06e8..369f7d470fc6f7235fc5bd6b67e16c4182d5ed36 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -156,6 +156,23 @@ public final class ItemStack {
@ -168,7 +168,7 @@ index 34a54a99e7484b2934e1d174c1b55f0472ff3812..7fd9a3a7f4cb98d89b7c4cbfda756d58
static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) {
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index b01c268d179591a0113e4bfb46f3d6d22933efaf..bfd5661d55a6ed767cb3bed2d9bb24535c1f7335 100644
index 44244166ec4e8ac070404101219efbc0e5f1d168..092695d4b45205fe2290f8f4375e881aaf89817d 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList;
@ -280,7 +280,7 @@ index b01c268d179591a0113e4bfb46f3d6d22933efaf..bfd5661d55a6ed767cb3bed2d9bb2453
}
if (this.hasAttributeModifiers()) {
clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers);
@@ -1464,4 +1467,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1469,4 +1472,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
return CraftMetaItem.HANDLED_TAGS;
}
}

View File

@ -28,10 +28,10 @@ index f9704b20e71564ac721a24655b2792c689edf6ba..e04f3f1159c5d5fa2e3956a36e95f8af
entitywitch.finalizeSpawn(world, world.getCurrentDifficultyAt(entitywitch.blockPosition()), MobSpawnType.CONVERSION, (SpawnGroupData) null, (CompoundTag) null);
entitywitch.setNoAi(this.isNoAi());
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e0bb58d92e47516138261a673b56c5f8ce68a59c..d3584001c92593d4471eeb473b345d30d4dc960e 100644
index 551fd24885cee87a3ca579f2f4bf0a18b9505e79..a6fa9f85835ca2ced58a0564b8f31527698885bb 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1193,6 +1193,14 @@ public class CraftEventFactory {
@@ -1201,6 +1201,14 @@ public class CraftEventFactory {
return event;
}

View File

@ -18,10 +18,10 @@ index 93c83cfedc7d3a169ad0504aa6e63f600873501b..9dffdfe5bbd0517e9a2c6a6770eea07b
--this.count;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index d3584001c92593d4471eeb473b345d30d4dc960e..192d48ed576b2918d7cce9a4969bcf2db17da9d7 100644
index a6fa9f85835ca2ced58a0564b8f31527698885bb..e9094e0d5b84f9427353ab903da15c748e14a2c1 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1152,6 +1152,17 @@ public class CraftEventFactory {
@@ -1160,6 +1160,17 @@ public class CraftEventFactory {
return event;
}

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Add ProjectileCollideEvent
Deprecated now and replaced with ProjectileHitEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 192d48ed576b2918d7cce9a4969bcf2db17da9d7..f882b007756edc2f25e913393b7e8b400ccbe50e 100644
index e9094e0d5b84f9427353ab903da15c748e14a2c1..8e8401dec4d3157a05216b790db5481ec8e0495a 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1296,6 +1296,17 @@ public class CraftEventFactory {
@@ -1304,6 +1304,17 @@ public class CraftEventFactory {
return CraftItemStack.asNMSCopy(bitem);
}
@ -27,7 +27,7 @@ index 192d48ed576b2918d7cce9a4969bcf2db17da9d7..f882b007756edc2f25e913393b7e8b40
public static ProjectileLaunchEvent callProjectileLaunchEvent(Entity entity) {
Projectile bukkitEntity = (Projectile) entity.getBukkitEntity();
ProjectileLaunchEvent event = new ProjectileLaunchEvent(bukkitEntity);
@@ -1320,8 +1331,15 @@ public class CraftEventFactory {
@@ -1328,8 +1339,15 @@ public class CraftEventFactory {
if (position.getType() == HitResult.Type.ENTITY) {
hitEntity = ((EntityHitResult) position).getEntity().getBukkitEntity();
}

View File

@ -255,10 +255,10 @@ index 4017933f2244fca32cf9d39444f3a4f550e8af01..e721517ce7b52a1aa10d039aa9f309eb
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index bfd5661d55a6ed767cb3bed2d9bb24535c1f7335..01e09dfc00b2ae9ecd39bea37f229ad826de121c 100644
index 092695d4b45205fe2290f8f4375e881aaf89817d..8ada3a7c5539293d4e2c1a5b83e00fc2542f10ff 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -1457,6 +1457,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1462,6 +1462,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CraftMetaCrossbow.CHARGED.NBT,
CraftMetaCrossbow.CHARGED_PROJECTILES.NBT,
CraftMetaSuspiciousStew.EFFECTS.NBT,

View File

@ -75,7 +75,7 @@ index dda3b911fcaa294ec7b8e9d696880fcb8325f69c..8e2340ca473c8cacfe9d888091834986
this.doCloseContainer();
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 391295bf6898320421272ad5dfb14e4c5e2d2be0..92d359cfbe6fc5ae6be4931754cdf48ccd92ba13 100644
index 5cac531de81a38fa79826e65477c5e31f9af35cd..925ef9f0f8b6d65a206c1b301f39a2571d3d4c82 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -220,6 +220,7 @@ import org.bukkit.event.inventory.ClickType;
@ -173,7 +173,7 @@ index f59733b6918dcbbb2190f76d8b8841a2d8818cdf..ba6105a970381d642cd7955754cc4713
@Override
public boolean isBlocking() {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 70b499e4c6d50cb55219033fd67356295239316a..dceea046eb4becbfa7be8bd91459f7aabea27914 100644
index 2072778d96fc5616ec6e6b85b29585fbb43775bb..0561e8cf242d9da126779d3beba46cbc7d59a7a0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1182,7 +1182,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -186,10 +186,10 @@ index 70b499e4c6d50cb55219033fd67356295239316a..dceea046eb4becbfa7be8bd91459f7aa
// Check if the fromWorld and toWorld are the same.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index f882b007756edc2f25e913393b7e8b400ccbe50e..1a0a4f2d94b65179426d7b5715847e5ed19489b5 100644
index 8e8401dec4d3157a05216b790db5481ec8e0495a..6cf79ea58448853a6e8f26609b1b8987d30588a6 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1265,7 +1265,7 @@ public class CraftEventFactory {
@@ -1273,7 +1273,7 @@ public class CraftEventFactory {
public static AbstractContainerMenu callInventoryOpenEvent(ServerPlayer player, AbstractContainerMenu container, boolean cancelled) {
if (player.containerMenu != player.inventoryMenu) { // fire INVENTORY_CLOSE if one already open
@ -198,7 +198,7 @@ index f882b007756edc2f25e913393b7e8b400ccbe50e..1a0a4f2d94b65179426d7b5715847e5e
}
CraftServer server = player.level().getCraftServer();
@@ -1439,8 +1439,18 @@ public class CraftEventFactory {
@@ -1447,8 +1447,18 @@ public class CraftEventFactory {
return event;
}

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread
diff --git a/build.gradle.kts b/build.gradle.kts
index 588d5370a10de25f80022d64abb8af0f16ce943b..de1586eb07570ab7daf1775550522bb911699d0e 100644
index a06b75a78ab96229a6e9b97de913df9050325c04..d5602e9020ff233b93987140d143ff5d00154b1c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -30,6 +30,7 @@ dependencies {
@ -14,8 +14,8 @@ index 588d5370a10de25f80022d64abb8af0f16ce943b..de1586eb07570ab7daf1775550522bb9
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 88957220d5574e5590e8a545605d76c0c7b0a10e..ea4e2161c0bd43884055cc6b8d70b2139f70e720 100644
--- a/src/main/resources/log4j2.xml

View File

@ -89,10 +89,10 @@ index 1beff41c02fb4c22b5474da7c514be2f50f16055..8a53284a5846b25864352e18a5e6b2de
public boolean isClientSide() {
return this.isClientSide;
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 1a0a4f2d94b65179426d7b5715847e5ed19489b5..2bb2c3ae7584d45ab9e32f1b9d0fa848e8667fc0 100644
index 6cf79ea58448853a6e8f26609b1b8987d30588a6..dff2623112aa09a585d5110e9039c2034b5f0928 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1302,6 +1302,14 @@ public class CraftEventFactory {
@@ -1310,6 +1310,14 @@ public class CraftEventFactory {
Projectile projectile = (Projectile) entity.getBukkitEntity();
org.bukkit.entity.Entity collided = position.getEntity().getBukkitEntity();
com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = new com.destroystokyo.paper.event.entity.ProjectileCollideEvent(projectile, collided);

View File

@ -357,7 +357,7 @@ index 719f68f96e58ddcdd3592131c691d21263c81915..4413b609f1250cf9477fcb3fecd7b67a
this.gameEvent(GameEvent.ENTITY_DIE);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 91b858ef2ef063b5f91dc017836d37e19b329101..e572dbdbd02e6b7307172e0b6f80d9b6e7fbce60 100644
index 56b7d7fb2a317a1a7a7f461ddb6667e01117ec90..dc0802c35836009d2411135d91a25de0746e64e6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2248,7 +2248,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@ -377,10 +377,10 @@ index 91b858ef2ef063b5f91dc017836d37e19b329101..e572dbdbd02e6b7307172e0b6f80d9b6
public void injectScaledMaxHealth(Collection<AttributeInstance> collection, boolean force) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 2bb2c3ae7584d45ab9e32f1b9d0fa848e8667fc0..e8783b2c7083c847770e9f08e796b58e9f8ea6ec 100644
index dff2623112aa09a585d5110e9039c2034b5f0928..3ab9346bfd4efc27abdaed69fba365c3fa262d47 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -824,9 +824,16 @@ public class CraftEventFactory {
@@ -832,9 +832,16 @@ public class CraftEventFactory {
public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List<org.bukkit.inventory.ItemStack> drops) {
CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity();
EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward());
@ -397,7 +397,7 @@ index 2bb2c3ae7584d45ab9e32f1b9d0fa848e8667fc0..e8783b2c7083c847770e9f08e796b58e
victim.expToDrop = event.getDroppedExp();
for (org.bukkit.inventory.ItemStack stack : event.getDrops()) {
@@ -843,8 +850,15 @@ public class CraftEventFactory {
@@ -851,8 +858,15 @@ public class CraftEventFactory {
PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage, stringDeathMessage); // Paper - Adventure
event.setKeepInventory(keepInventory);
event.setKeepLevel(victim.keepLevel); // SPIGOT-2222: pre-set keepLevel
@ -413,7 +413,7 @@ index 2bb2c3ae7584d45ab9e32f1b9d0fa848e8667fc0..e8783b2c7083c847770e9f08e796b58e
victim.keepLevel = event.getKeepLevel();
victim.newLevel = event.getNewLevel();
@@ -861,6 +875,31 @@ public class CraftEventFactory {
@@ -869,6 +883,31 @@ public class CraftEventFactory {
return event;
}

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee765ecefb8 100644
index 8ada3a7c5539293d4e2c1a5b83e00fc2542f10ff..d7102d83bb781b6cf296cf9c637f8270f4ee8b14 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -83,6 +83,12 @@ import org.bukkit.persistence.PersistentDataContainer;
@ -244,7 +244,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7
final Map<String, Tag> internalTags = new HashMap<String, Tag>(this.unhandledTags);
this.serializeInternal(internalTags);
if (!internalTags.isEmpty()) {
@@ -1464,6 +1605,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1469,6 +1610,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
CraftMetaArmorStand.SHOW_ARMS.NBT,
CraftMetaArmorStand.SMALL.NBT,
CraftMetaArmorStand.MARKER.NBT,
@ -253,7 +253,7 @@ index 01e09dfc00b2ae9ecd39bea37f229ad826de121c..7c803a928f41938c03b0239cf04e2ee7
// Paper end
CraftMetaCompass.LODESTONE_DIMENSION.NBT,
CraftMetaCompass.LODESTONE_POS.NBT,
@@ -1493,4 +1636,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@@ -1498,4 +1641,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
}
// Paper end

View File

@ -5,10 +5,10 @@ Subject: [PATCH] add hand to BlockMultiPlaceEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e8783b2c7083c847770e9f08e796b58e9f8ea6ec..8fbe5a10ba6eeff70c9b4907717c281b6f30a454 100644
index 3ab9346bfd4efc27abdaed69fba365c3fa262d47..7b46cf7f39f77d593bbf1a4abe500077ab580166 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -366,13 +366,18 @@ public class CraftEventFactory {
@@ -369,13 +369,18 @@ public class CraftEventFactory {
}
org.bukkit.inventory.ItemStack item;

View File

@ -135,10 +135,10 @@ index 4413b609f1250cf9477fcb3fecd7b67afee0b896..101e3a1f0f52b67b55c99c2619cc4329
}
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 8fbe5a10ba6eeff70c9b4907717c281b6f30a454..f9f9292a99bf35d49916e1380781cc9bc0e19842 100644
index 7b46cf7f39f77d593bbf1a4abe500077ab580166..a6b0433b36c9b21871166384cee734a9c0dfbe82 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -827,6 +827,11 @@ public class CraftEventFactory {
@@ -835,6 +835,11 @@ public class CraftEventFactory {
}
public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List<org.bukkit.inventory.ItemStack> drops) {
@ -150,7 +150,7 @@ index 8fbe5a10ba6eeff70c9b4907717c281b6f30a454..f9f9292a99bf35d49916e1380781cc9b
CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity();
EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward());
populateFields(victim, event); // Paper - make cancellable
@@ -840,11 +845,13 @@ public class CraftEventFactory {
@@ -848,11 +853,13 @@ public class CraftEventFactory {
playDeathSound(victim, event);
// Paper end
victim.expToDrop = event.getDroppedExp();

View File

@ -5,12 +5,12 @@ Subject: [PATCH] Implement Mob Goal API
diff --git a/build.gradle.kts b/build.gradle.kts
index 4162d6a040a20a4ef8e1adb90f215a8d80fb48a3..d63f6a46244b9dd133f12e9cfae16c8cf3b394da 100644
index 24cc85285f221cee63eb6feb2aabc3e193d76dd7..e3e6318e0c83ae6f6ff699918ab0faff9f84c63d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -38,6 +38,7 @@ 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")

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Option for maximum exp value when merging orbs
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index f9f9292a99bf35d49916e1380781cc9bc0e19842..e8532d35f8c3bf10e5c9c17839dbce2bf927ec77 100644
index a6b0433b36c9b21871166384cee734a9c0dfbe82..c3a524da52b9588746a13f2107bfbef2af1a5d50 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -648,16 +648,30 @@ public class CraftEventFactory {
@@ -656,16 +656,30 @@ public class CraftEventFactory {
net.minecraft.world.entity.ExperienceOrb xp = (net.minecraft.world.entity.ExperienceOrb) entity;
double radius = world.spigotConfig.expMerge;
if (radius > 0) {

View File

@ -9,10 +9,10 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor
metadata such as spawn reason, or conditionally move data from source to target.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e8532d35f8c3bf10e5c9c17839dbce2bf927ec77..f35cba8f45f96cd9504ccce73fea592532c36702 100644
index c3a524da52b9588746a13f2107bfbef2af1a5d50..7d1c551e92b6f2eb183bbb206bd3b19af907c31b 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -658,7 +658,7 @@ public class CraftEventFactory {
@@ -666,7 +666,7 @@ public class CraftEventFactory {
if (e instanceof net.minecraft.world.entity.ExperienceOrb) {
net.minecraft.world.entity.ExperienceOrb loopItem = (net.minecraft.world.entity.ExperienceOrb) e;
// Paper start

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Support components in ItemMeta
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 3d500e8be2478840669b236421c6908f8d288014..fa94030ac80c8c68ee429e6b7350395208e4348f 100644
index d1f21b5f5600dba41a93378853aadacd24f4a1f3..b34f364f8580ae900e25ef3f31f58f4e8fee88e0 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -877,11 +877,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
@ -79,5 +79,5 @@ index 3d500e8be2478840669b236421c6908f8d288014..fa94030ac80c8c68ee429e6b73503952
+ } 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,

View File

@ -94,10 +94,10 @@ index 8734a129244271b370f965fcbf488a14ce04684a..00f01ab2eff69c18b50ec07b7623af66
private void setupRecipeList(Container input, ItemStack stack) {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index f35cba8f45f96cd9504ccce73fea592532c36702..019a486f40256771341358509a5abe0b1284d248 100644
index 7d1c551e92b6f2eb183bbb206bd3b19af907c31b..5d5b1c2ec06680516fd6058a1b22ba7169dd50d4 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1628,26 +1628,53 @@ public class CraftEventFactory {
@@ -1636,26 +1636,53 @@ public class CraftEventFactory {
return event;
}

View File

@ -7,10 +7,10 @@ Add a new event, BellRingEvent, to trigger whenever a player rings a
village bell. Passes along the bell block and the player who rang it.
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 019a486f40256771341358509a5abe0b1284d248..9761302bb1ca66242ae46d26001837dd881cb9fa 100644
index 5d5b1c2ec06680516fd6058a1b22ba7169dd50d4..6ea51428a8abfdceff1eb0ae1469ef05c88803ee 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -332,10 +332,11 @@ public class CraftEventFactory {
@@ -335,10 +335,11 @@ public class CraftEventFactory {
return tradeSelectEvent;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add OBSTRUCTED reason to BedEnterResult
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 9761302bb1ca66242ae46d26001837dd881cb9fa..0c177a3165ea61bf31f030111084920a3a048256 100644
index 6ea51428a8abfdceff1eb0ae1469ef05c88803ee..98db6ecab2ae7adf24d415e743c78731d9cd03f7 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -267,6 +267,10 @@ public class CraftEventFactory {
@@ -270,6 +270,10 @@ public class CraftEventFactory {
return BedEnterResult.TOO_FAR_AWAY;
case NOT_SAFE:
return BedEnterResult.NOT_SAFE;

View File

@ -32,10 +32,10 @@ index 1415ad60163f6584619cc7caa61f1848d6ebaa93..801c4c120e98584bcf218a4ef9bd66d7
} else {
ItemStack itemstack = tileentitydispenser.getItem(i);
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 0c177a3165ea61bf31f030111084920a3a048256..edd27b8e2535b520c4f6e6309269ab84799f2a3a 100644
index 98db6ecab2ae7adf24d415e743c78731d9cd03f7..acc292bd5f22e0d20279f5abcb4f12eae84649e0 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1920,4 +1920,12 @@ public class CraftEventFactory {
@@ -1928,4 +1928,12 @@ public class CraftEventFactory {
return !event.isCancelled();
}

View File

@ -1,59 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Madeline Miller <mnmiller1@me.com>
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 180dc7ec0202fd6c24682631dedc066976f17fa4..43221bf57fb4eeb70823c12b48f4df0bb817eb0b 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -517,7 +517,7 @@ 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 edd27b8e2535b520c4f6e6309269ab84799f2a3a..3799eec69ef45c77e032faee91ce45205dcd3675 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -58,7 +58,9 @@ 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;
@@ -492,7 +494,13 @@ 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);
@@ -518,7 +526,10 @@ 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);
}

View File

@ -32,7 +32,7 @@ index 13e2fb9e48ed8722b68b2ce2994d9d84bb22cee4..600bb44d97b477960108ea8cd84a8e73
public boolean isWhiteListed(GameProfile profile) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index e163daf31a1e3318f9127920e5ef0d36af2f6664..0906de2fb92cbdcc47ed1b2393430a7ac33ae920 100644
index 94c3fe30679be2004b92b542b4be9766c0e77b9d..aa14be1871aa069b45004829912392e9fbf27990 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -631,6 +631,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -17,10 +17,10 @@ index 9ec043ff2cd38e589066a3eb7f42834e4e7592cf..4720b884e1e311f44a012f1219fe648a
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 3799eec69ef45c77e032faee91ce45205dcd3675..2567c229eb14a8bf54cd99e852a4c31fde86646d 100644
index acc292bd5f22e0d20279f5abcb4f12eae84649e0..f37ec9043069bc683485a2c766168a1c1979e208 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1938,5 +1938,11 @@ public class CraftEventFactory {
@@ -1935,5 +1935,11 @@ public class CraftEventFactory {
io.papermc.paper.event.block.BlockFailedDispenseEvent event = new io.papermc.paper.event.block.BlockFailedDispenseEvent(block);
return event.callEvent();
}

View File

@ -122,10 +122,10 @@ index 16784fcc853e23689a854e7dc6c03ed8182a164e..4eb97572a97a8d98af37c4223f42fc63
flag1 = true;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 2567c229eb14a8bf54cd99e852a4c31fde86646d..2dc961eedf4da8175bad709fbb9f0fcce7d23330 100644
index f37ec9043069bc683485a2c766168a1c1979e208..381ff70e1b5af9dbe084292bc44d0f4d9d077702 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1562,8 +1562,10 @@ public class CraftEventFactory {
@@ -1559,8 +1559,10 @@ public class CraftEventFactory {
return itemInHand;
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Allow adding items to BlockDropItemEvent
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 2dc961eedf4da8175bad709fbb9f0fcce7d23330..64e1e46bd6c4b225fe9b86c4cf632b9bb1c4af09 100644
index 381ff70e1b5af9dbe084292bc44d0f4d9d077702..440edfe374b44e6da34975398db1ece28b7a0afc 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -418,13 +418,30 @@ public class CraftEventFactory {
@@ -419,13 +419,30 @@ public class CraftEventFactory {
}
public static void handleBlockDropItemEvent(Block block, BlockState state, ServerPlayer player, List<ItemEntity> items) {

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Allow using signs inside spawn protection
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 4a20980ee00b52ee12537ad9cd9095ba3da39166..f893d9f8dc5f087a63efa91338ad4118f9d67d47 100644
index 6e96f75f16636d5f117d00d5f0aff4bb7f24f23b..40e7a897033bd66ffe07a5bf875dc66a478591fd 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1829,7 +1829,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Don't ignore result of PlayerEditBookEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f893d9f8dc5f087a63efa91338ad4118f9d67d47..f2e5bffd43e36b47af51e516409830fa5a5acbbe 100644
index 40e7a897033bd66ffe07a5bf875dc66a478591fd..a06eaaa38406ad8c7ec46a0283a340990b157002 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1290,7 +1290,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic

View File

@ -5,7 +5,7 @@ Subject: [PATCH] fix PlayerItemHeldEvent firing twice
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index f2e5bffd43e36b47af51e516409830fa5a5acbbe..1067ff8cb82f44ef3f67b4db5ee7697aabae22a8 100644
index a06eaaa38406ad8c7ec46a0283a340990b157002..073be5bda93aa32613f0f4994e5e266a3e7872a4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2043,6 +2043,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic

View File

@ -5,7 +5,7 @@ Subject: [PATCH] add RespawnFlags to PlayerRespawnEvent
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 1067ff8cb82f44ef3f67b4db5ee7697aabae22a8..84c49a70c32c07580748d9a55f24902ce5be8c5b 100644
index 073be5bda93aa32613f0f4994e5e266a3e7872a4..1375e48ed01bdd627c204938fed816e9e6b437c4 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2783,7 +2783,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic

Some files were not shown because too many files have changed in this diff Show More