Don't use client-side-only vector-based AxisAlignedBB constructor, fixes #306

This commit is contained in:
Electroblob77
2019-12-16 12:14:01 +00:00
parent 01cea3df06
commit eddcb2402d
@@ -29,9 +29,9 @@ public class EntityIceSpike extends EntityMagicConstruct {
this.setRotation(-facing.getHorizontalAngle(), WizardryUtilities.getPitch(facing)); this.setRotation(-facing.getHorizontalAngle(), WizardryUtilities.getPitch(facing));
float yaw = (-facing.getHorizontalAngle()) * (float)Math.PI/180; float yaw = (-facing.getHorizontalAngle()) * (float)Math.PI/180;
float pitch = (WizardryUtilities.getPitch(facing) - 90) * (float)Math.PI/180; float pitch = (WizardryUtilities.getPitch(facing) - 90) * (float)Math.PI/180;
Vec3d min = new Vec3d(-width/2, 0, -width/2).rotatePitch(pitch).rotateYaw(yaw); Vec3d min = this.getPositionVector().add(new Vec3d(-width/2, 0, -width/2).rotatePitch(pitch).rotateYaw(yaw));
Vec3d max = new Vec3d(width/2, height, width/2).rotatePitch(pitch).rotateYaw(yaw); Vec3d max = this.getPositionVector().add(new Vec3d(width/2, height, width/2).rotatePitch(pitch).rotateYaw(yaw));
this.setEntityBoundingBox(new AxisAlignedBB(this.getPositionVector().add(min), this.getPositionVector().add(max))); this.setEntityBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z);
} }
public EnumFacing getFacing(){ public EnumFacing getFacing(){