mirror of
https://github.com/GTNewHorizons/Baubles-Expanded.git
synced 2026-11-22 04:52:28 +00:00
Compatibility fix
Change "LivingDeathEvent" to "PlayerDropsEvent". It will be called at Player death instead of when it reach 0 health points. This changes requires for "Gravestone mod" to trigger its event first.
This commit is contained in:
1 parent
3a2a1d183d
commit
9c1e5eda02
1 file changed
+2
-2
@@ -1,7 +1,7 @@
|
||||
package baubles.common.event;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerDropsEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import baubles.api.IBauble;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
@@ -29,7 +29,7 @@ public class EventHandlerEntity {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void playerDeath(LivingDeathEvent event) {
|
||||
public void playerDeath(PlayerDropsEvent event) {
|
||||
if (event.entity instanceof EntityPlayer && !event.entity.worldObj.isRemote && !event.entity.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) {
|
||||
EntityPlayer player = (EntityPlayer)event.entity;
|
||||
PlayerHandler.getPlayerBaubles(player).dropItems(player);
|
||||
|
||||
Reference in new issue
Block a user