mirror of
https://github.com/GTNewHorizons/Avaritia.git
synced 2026-11-20 12:19:39 +00:00
EVERYTHING
This commit is contained in:
1 parent
774852d26e
commit
78e9a65ff2
1 file changed
+12
@@ -21,6 +21,7 @@ import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
@@ -181,6 +182,17 @@ public class LudicrousEvents {
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onDeath(LivingDeathEvent event){
|
||||
if(event.entityLiving instanceof EntityPlayer){
|
||||
EntityPlayer player = (EntityPlayer)event.entityLiving;
|
||||
if(LudicrousItems.isInfinite(player) && !event.source.getDamageType().equals("infinity")){
|
||||
event.setCanceled(true);
|
||||
player.setHealth(player.getMaxHealth());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addDrop(LivingDropsEvent event, ItemStack drop) {
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, drop);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
|
||||
Reference in new issue
Block a user