Changed electrocution damage of wires to be handled by calc-core CustomDamage class

This commit is contained in:
Robert S 2014-04-14 20:10:45 -04:00
parent ade00d97dc
commit 28897ac249

View file

@ -16,7 +16,6 @@ import net.minecraftforge.common.ForgeDirection;
import resonantinduction.core.MultipartUtility;
import resonantinduction.electrical.Electrical;
import universalelectricity.api.CompatibilityModule;
import universalelectricity.api.UniversalElectricity;
import universalelectricity.api.electricity.IElectricalNetwork;
import universalelectricity.api.energy.IConductor;
import calclavia.lib.prefab.CustomDamageSource;
@ -90,18 +89,7 @@ public abstract class PartAdvancedWire extends PartConductor
public void onEntityCollision(Entity entity)
{
if (!this.isInsulated() && this.getNetwork() instanceof IElectricalNetwork)
{
float damage = 0;
if (this.getNetwork().getRequest() > 0)
damage = ((IElectricalNetwork) this.getNetwork()).getVoltage() / UniversalElectricity.DEFAULT_VOLTAGE;
if (damage > 0)
{
entity.attackEntityFrom(CustomDamageSource.electrocution, Math.min(damage, 10));
this.getNetwork().setBuffer((long) Math.max(0, this.getNetwork().getBuffer() - damage * 100));
}
}
CustomDamageSource.handleElectrocution(entity, this, (IElectricalNetwork) this.getNetwork(), 1);
}
@Override