Moved damage prefabs to core

This commit is contained in:
Robert S 2014-03-25 14:41:34 -04:00
parent 5cf5b41dc1
commit 9b86de1bce
2 changed files with 0 additions and 88 deletions

View file

@ -1,36 +0,0 @@
package resonantinduction.core.damage;
import net.minecraft.entity.Entity;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.util.EntityDamageSource;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
public class LaserEntityDamageSource extends EntityDamageSource
{
public LaserEntityDamageSource(Entity par2Entity)
{
super("Laser", par2Entity);
}
@ForgeSubscribe
public void LivingDeathEvent(LivingDeathEvent event)
{
if (event.entity instanceof EntityCreeper)
{
if (!event.entity.worldObj.isRemote && event.source instanceof LaserEntityDamageSource)
{
boolean flag = event.entity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing");
if (((EntityCreeper) event.entity).getPowered())
{
event.entity.worldObj.createExplosion(event.entity, event.entity.posX, event.entity.posY, event.entity.posZ, 3 * 2, flag);
}
else
{
event.entity.worldObj.createExplosion(event.entity, event.entity.posX, event.entity.posY, event.entity.posZ, 3, flag);
}
}
}
}
}

View file

@ -1,52 +0,0 @@
package resonantinduction.core.damage;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.DamageSource;
public class OtherDamageSource extends DamageSource
{
protected Object damageSource;
public OtherDamageSource(String damageName, Object attacker)
{
super(damageName);
this.damageSource = attacker;
}
@Override
public Entity getEntity()
{
return damageSource instanceof Entity ? ((Entity) damageSource) : null;
}
public TileEntity getTileEntity()
{
return damageSource instanceof TileEntity ? ((TileEntity) damageSource) : null;
}
@Override
public boolean isDifficultyScaled()
{
return this.damageSource != null && this.damageSource instanceof EntityLiving && !(this.damageSource instanceof EntityPlayer);
}
@Override
public OtherDamageSource setProjectile()
{
super.setProjectile();
return this;
}
public static OtherDamageSource doBulletDamage(Object object)
{
return new OtherDamageSource("Bullets", object).setProjectile();
}
public static OtherDamageSource doLaserDamage(Object object)
{
return new OtherDamageSource("Laser", object).setProjectile();
}
}