mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-18 19:39:12 +00:00
Split more files into parts
This commit is contained in:
1 parent
e2f0558b6f
commit
5a87c102ea
61 files changed
+1365
-1499
No files matched your search
@@ -0,0 +1,59 @@
|
||||
package tconstruct.armor;
|
||||
|
||||
import net.minecraft.entity.boss.EntityDragon;
|
||||
import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityGhast;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.monster.IMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
import tconstruct.TConstruct;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
import tconstruct.tools.TinkerTools;
|
||||
import tconstruct.util.ItemHelper;
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
import tconstruct.world.entity.BlueSlime;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
public class TinkerArmorEvents
|
||||
{
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingDrop (LivingDropsEvent event)
|
||||
{
|
||||
if (event.entityLiving == null)
|
||||
return;
|
||||
|
||||
if (TConstruct.random.nextInt(200) == 0 && event.entityLiving instanceof IMob && event.source.damageType.equals("player"))
|
||||
{
|
||||
if (event.entityLiving instanceof BlueSlime)
|
||||
{
|
||||
BlueSlime slime = (BlueSlime) event.entityLiving;
|
||||
if (slime.getSlimeSize() < 8)
|
||||
return;
|
||||
}
|
||||
int count = event.entityLiving instanceof EntityDragon ? 5 : 1;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
ItemStack dropStack = new ItemStack(TinkerArmor.heartCanister, 1, 1);
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
}
|
||||
}
|
||||
|
||||
if (event.entityLiving instanceof IBossDisplayData)
|
||||
{
|
||||
ItemStack dropStack = new ItemStack(TinkerArmor.heartCanister, 1, 3);
|
||||
EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, dropStack);
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
event.drops.add(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user