Skip to content
Permalink
Browse files

Fixed a bug with arc entity hit distance, Increased arc damage multip…

…lier
  • Loading branch information...
Ri5ux Ri5ux
Ri5ux authored and Ri5ux committed Jul 15, 2019
1 parent 1bedfcc commit 48a246b0398e157f7a9a904cec35f84eeb2b5209
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/main/java/org/avp/tile/TileEntityPowerline.java
@@ -68,18 +68,22 @@ public void update()
double y = this.pos.getY() + 0.5;
double z = this.pos.getZ() + 0.5;
Pos t = getNextGroundingPoint(new Pos(x, y + 1, z), this.world);
Entity target = Entities.getRandomEntityInCoordsRange(world, EntityLivingBase.class, new Pos(this), (int) Math.round(maxArcDist));
Entity target = Entities.getRandomEntityInCoordsRange(world, EntityLivingBase.class, new Pos(this), (int) Math.floor(maxArcDist));
double dist = y - t.y;
double arcWidth = MDXMath.map((double) this.voltage, 600D, 10000D, 0.05D, 0.5D);
float damageMult = (float) (arcWidth * 20F);
float damageMult = (float) (arcWidth * 100F);

if (target != null)
{
t = new Pos(target.getPosition()).add(target.width / 2, 0, target.width / 2);
m = 8F;
dist = target.getDistance(x, y, z);
target.attackEntityFrom(DamageSources.electricity, damageMult);
target.setFire(3);
dist = target.getDistanceSq(x, y, z);

if (dist <= maxArcDist)
{
target.attackEntityFrom(DamageSources.electricity, damageMult);
target.setFire(3);
}
}

if (dist <= maxArcDist)

0 comments on commit 48a246b

Please sign in to comment.
You can’t perform that action at this time.