mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-27 15:33:18 +00:00
Call Looting Event on player death and loot table drops (#3275)
* Call Looting Event on player death and loot table drops * Simplify patches * More code cleanup: Replace old usage with compact forgehooks implementation
This commit is contained in:
1 parent
858056c089
commit
5f9034d95b
6 files changed
+64
-13
No files matched your search
@@ -21,9 +21,9 @@ package net.minecraftforge.event.entity.player;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.fml.common.eventhandler.Cancelable;
|
||||
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.DamageSource;
|
||||
@@ -48,10 +48,7 @@ public class PlayerDropsEvent extends LivingDropsEvent
|
||||
*/
|
||||
public PlayerDropsEvent(EntityPlayer entity, DamageSource source, List<EntityItem> drops, boolean recentlyHit)
|
||||
{
|
||||
super(entity, source, drops,
|
||||
(source.getEntity() instanceof EntityPlayer) ?
|
||||
EnchantmentHelper.getLootingModifier(((EntityPlayer)source.getEntity())) : 0,
|
||||
recentlyHit);
|
||||
super(entity, source, drops, ForgeHooks.getLootingLevel(entity, source.getEntity(), source), recentlyHit);
|
||||
|
||||
this.entityPlayer = entity;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user