use of net.minecraft.network.play.server.SPacketBlockBreakAnim in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class ValkyrienWarfareWorldEventListener method sendBlockBreakProgress.
@Override
public void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress) {
if (!worldObj.isRemote) {
for (EntityPlayer entityplayermp : worldObj.playerEntities) {
if (entityplayermp != null && entityplayermp.getEntityId() != breakerId) {
Vector posVector = new Vector(pos.getX(), pos.getY(), pos.getZ());
PhysicsWrapperEntity wrapper = ValkyrienWarfareMod.physicsManager.getObjectManagingPos(worldObj, pos);
if (wrapper != null) {
RotationMatrices.applyTransform(wrapper.wrapping.coordTransform.lToWTransform, posVector);
}
double d0 = posVector.X - entityplayermp.posX;
double d1 = posVector.Y - entityplayermp.posY;
double d2 = posVector.Z - entityplayermp.posZ;
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
((EntityPlayerMP) entityplayermp).connection.sendPacket(new SPacketBlockBreakAnim(breakerId, pos, progress));
}
}
}
}
}
Aggregations