geforkt von Mirrors/Paper
SPIGOT-4823: Crash picking up arrows
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
abedca6a94
Commit
1596138194
@ -52,7 +52,7 @@
|
|||||||
+ ItemStack itemstack = this.getItemStack();
|
+ ItemStack itemstack = this.getItemStack();
|
||||||
+ if (this.fromPlayer == PickupStatus.ALLOWED && !itemstack.isEmpty() && entityhuman.inventory.canHold(itemstack) > 0) {
|
+ if (this.fromPlayer == PickupStatus.ALLOWED && !itemstack.isEmpty() && entityhuman.inventory.canHold(itemstack) > 0) {
|
||||||
+ EntityItem item = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack);
|
+ EntityItem item = new EntityItem(this.world, this.locX, this.locY, this.locZ, itemstack);
|
||||||
+ PlayerPickupArrowEvent event = new PlayerPickupArrowEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), new org.bukkit.craftbukkit.entity.CraftItem(this.world.getServer(), this, item), (org.bukkit.entity.Arrow) this.getBukkitEntity());
|
+ PlayerPickupArrowEvent event = new PlayerPickupArrowEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), new org.bukkit.craftbukkit.entity.CraftItem(this.world.getServer(), this, item), (org.bukkit.entity.AbstractArrow) this.getBukkitEntity());
|
||||||
+ // event.setCancelled(!entityhuman.canPickUpLoot); TODO
|
+ // event.setCancelled(!entityhuman.canPickUpLoot); TODO
|
||||||
+ this.world.getServer().getPluginManager().callEvent(event);
|
+ this.world.getServer().getPluginManager().callEvent(event);
|
||||||
+
|
+
|
||||||
|
@ -235,12 +235,6 @@ public class Commodore
|
|||||||
super.visitMethodInsn( opcode, owner, name, "(I)Lorg/bukkit/map/MapView;", itf );
|
super.visitMethodInsn( opcode, owner, name, "(I)Lorg/bukkit/map/MapView;", itf );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( owner.equals( "org/bukkit/World" ) && name.equals( "spawnArrow" ) )
|
|
||||||
{
|
|
||||||
// Should be same size on stack so just call other method
|
|
||||||
super.visitMethodInsn( opcode, owner, name, desc.replace( "Lorg/bukkit/entity/Arrow;", "Lorg/bukkit/entity/AbstractArrow;" ), itf );
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( modern )
|
if ( modern )
|
||||||
{
|
{
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren