Paper/Spigot-Server-Patches/0096-Use-correct-item-in-arrow-pickup-event.patch
Zach Brown c02c01b2c5
Add rate limiting to PacketPlayInUseItem as well
Also removes our toggle for Spigot's option, I doubt anyone uses it.
2016-09-10 21:44:06 -05:00

32 lines
1.7 KiB
Diff

From 15e946b55fd9b5ac3de05556f9be1cd875ca480b Mon Sep 17 00:00:00 2001
From: Jedediah Smith <jedediah@silencegreys.com>
Date: Tue, 22 Mar 2016 16:00:16 -0400
Subject: [PATCH] Use correct item in arrow pickup event
diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java
index b7ac5f7..37cb17c 100644
--- a/src/main/java/net/minecraft/server/EntityArrow.java
+++ b/src/main/java/net/minecraft/server/EntityArrow.java
@@ -444,7 +444,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
public void d(EntityHuman entityhuman) {
if (!this.world.isClientSide && this.inGround && this.shake <= 0) {
// CraftBukkit start
- ItemStack itemstack = new ItemStack(Items.ARROW);
+ ItemStack itemstack = this.j(); // Paper - Use the correct item
if (this.fromPlayer == PickupStatus.ALLOWED && entityhuman.inventory.canHold(itemstack) > 0) {
EntityItem item = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack);
@@ -459,7 +459,7 @@ public abstract class EntityArrow extends Entity implements IProjectile {
// CraftBukkit end
boolean flag = this.fromPlayer == EntityArrow.PickupStatus.ALLOWED || this.fromPlayer == EntityArrow.PickupStatus.CREATIVE_ONLY && entityhuman.abilities.canInstantlyBuild;
- if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(this.j())) {
+ if (this.fromPlayer == EntityArrow.PickupStatus.ALLOWED && !entityhuman.inventory.pickup(itemstack)) { // Paper - Use event itemstack
flag = false;
}
--
2.10.0.windows.1