mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
Fix for the EntityItemPickupEvent having 0 count item when event is fired. (#4549)
This commit is contained in:
1 parent
b215d90589
commit
ccc44956fd
4 files changed
+71
-10
No files matched your search
@@ -583,9 +583,9 @@ public class FMLCommonHandler
|
||||
bus().post(new PlayerEvent.PlayerRespawnEvent(player, endConquered));
|
||||
}
|
||||
|
||||
public void firePlayerItemPickupEvent(EntityPlayer player, EntityItem item)
|
||||
public void firePlayerItemPickupEvent(EntityPlayer player, EntityItem item, ItemStack clone)
|
||||
{
|
||||
bus().post(new PlayerEvent.ItemPickupEvent(player, item));
|
||||
bus().post(new PlayerEvent.ItemPickupEvent(player, item, clone));
|
||||
}
|
||||
|
||||
public void firePlayerCraftingEvent(EntityPlayer player, ItemStack crafted, IInventory craftMatrix)
|
||||
|
||||
@@ -35,11 +35,27 @@ public class PlayerEvent extends Event {
|
||||
}
|
||||
|
||||
public static class ItemPickupEvent extends PlayerEvent {
|
||||
public final EntityItem pickedUp;
|
||||
public ItemPickupEvent(EntityPlayer player, EntityItem pickedUp)
|
||||
/**
|
||||
* Original EntityItem with current remaining stack size
|
||||
*/
|
||||
private final EntityItem originalEntity;
|
||||
/**
|
||||
* Clone item stack, containing the item and amount picked up
|
||||
*/
|
||||
private final ItemStack stack;
|
||||
public ItemPickupEvent(EntityPlayer player, EntityItem entPickedUp, ItemStack stack)
|
||||
{
|
||||
super(player);
|
||||
this.pickedUp = pickedUp;
|
||||
originalEntity = entPickedUp;
|
||||
this.stack = stack;
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
return stack;
|
||||
}
|
||||
|
||||
public EntityItem getOriginalEntity() {
|
||||
return originalEntity;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user