public void setEntityDead(Entity var1) {
        if (var1.riddenByEntity != null) {
            var1.riddenByEntity.mountEntity((Entity) null);
        }

        if (var1.ridingEntity != null) {
            var1.mountEntity((Entity) null);
        }

        var1.setEntityDead();
        if (var1 instanceof EntityPlayer) {
            this.playerEntities.remove((EntityPlayer) var1);
            this.updateAllPlayersSleepingFlag();
        }

    }