Fix redundant imports on rustc 0.35.0. Fixes #175
This commit is contained in:
parent
0fbcb192d8
commit
19948ff397
|
@ -9,6 +9,8 @@ use crate::resources;
|
|||
use crate::model;
|
||||
use crate::types::bit::Set;
|
||||
use crate::shared::Direction;
|
||||
use rand::{self, SeedableRng, Rng};
|
||||
use rand_xorshift;
|
||||
|
||||
const NUM_WORKERS: usize = 8;
|
||||
|
||||
|
@ -109,8 +111,6 @@ struct BuildReply {
|
|||
}
|
||||
|
||||
fn build_func(id: usize, models: Arc<RwLock<model::Factory>>, work_recv: mpsc::Receiver<BuildReq>, built_send: mpsc::Sender<(usize, BuildReply)>) {
|
||||
use rand::{self, SeedableRng, Rng};
|
||||
use rand_xorshift;
|
||||
loop {
|
||||
let BuildReq {
|
||||
snapshot,
|
||||
|
|
|
@ -22,6 +22,7 @@ use serde_json;
|
|||
use std_or_web::fs;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
use reqwest;
|
||||
use hex;
|
||||
|
||||
pub mod mojang;
|
||||
pub mod forge;
|
||||
|
@ -409,7 +410,6 @@ pub struct UUID(u64, u64);
|
|||
|
||||
impl UUID {
|
||||
pub fn from_str(s: &str) -> UUID {
|
||||
use hex;
|
||||
// TODO: Panics aren't the best idea here
|
||||
if s.len() != 36 {
|
||||
panic!("Invalid UUID format");
|
||||
|
|
|
@ -40,6 +40,9 @@ use std::sync::atomic::{AtomicIsize, Ordering};
|
|||
use std::thread;
|
||||
use std::sync::mpsc;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
use reqwest;
|
||||
|
||||
const ATLAS_SIZE: usize = 1024;
|
||||
|
||||
// TEMP
|
||||
|
@ -843,7 +846,6 @@ impl TextureManager {
|
|||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
fn process_skins(recv: mpsc::Receiver<String>, reply: mpsc::Sender<(String, Option<image::DynamicImage>)>) {
|
||||
use reqwest;
|
||||
let client = reqwest::Client::new();
|
||||
loop {
|
||||
let hash = match recv.recv() {
|
||||
|
|
|
@ -33,6 +33,8 @@ use crate::shared::{Axis, Position};
|
|||
use crate::format;
|
||||
use rsa_public_encrypt_pkcs1;
|
||||
use log::{error, debug, warn};
|
||||
use base64;
|
||||
use serde_json;
|
||||
|
||||
mod sun;
|
||||
pub mod plugin_messages;
|
||||
|
@ -1072,7 +1074,6 @@ impl Server {
|
|||
},
|
||||
Some(nbt) => {
|
||||
if block_update.action == 9 {
|
||||
use crate::format;
|
||||
let line1 = format::Component::from_string(nbt.1.get("Text1").unwrap().as_str().unwrap());
|
||||
let line2 = format::Component::from_string(nbt.1.get("Text2").unwrap().as_str().unwrap());
|
||||
let line3 = format::Component::from_string(nbt.1.get("Text3").unwrap().as_str().unwrap());
|
||||
|
@ -1094,7 +1095,6 @@ impl Server {
|
|||
}
|
||||
|
||||
fn on_sign_update(&mut self, mut update_sign: packet::play::clientbound::UpdateSign) {
|
||||
use crate::format;
|
||||
format::convert_legacy(&mut update_sign.line1);
|
||||
format::convert_legacy(&mut update_sign.line2);
|
||||
format::convert_legacy(&mut update_sign.line3);
|
||||
|
@ -1109,7 +1109,6 @@ impl Server {
|
|||
}
|
||||
|
||||
fn on_sign_update_u16(&mut self, mut update_sign: packet::play::clientbound::UpdateSign_u16) {
|
||||
use crate::format;
|
||||
format::convert_legacy(&mut update_sign.line1);
|
||||
format::convert_legacy(&mut update_sign.line2);
|
||||
format::convert_legacy(&mut update_sign.line3);
|
||||
|
@ -1130,8 +1129,6 @@ impl Server {
|
|||
|
||||
fn on_player_info(&mut self, player_info: packet::play::clientbound::PlayerInfo) {
|
||||
use crate::protocol::packet::PlayerDetail::*;
|
||||
use base64;
|
||||
use serde_json;
|
||||
for detail in player_info.inner.players {
|
||||
match detail {
|
||||
Add { name, uuid, properties, display, gamemode, ping} => {
|
||||
|
|
|
@ -327,8 +327,6 @@ impl World {
|
|||
}
|
||||
|
||||
pub fn compute_render_list(&mut self, renderer: &mut render::Renderer) {
|
||||
use crate::chunk_builder;
|
||||
use std::collections::VecDeque;
|
||||
self.render_list.clear();
|
||||
|
||||
let mut valid_dirs = [false; 6];
|
||||
|
@ -587,7 +585,6 @@ impl World {
|
|||
}
|
||||
|
||||
pub fn load_chunk18(&mut self, x: i32, z: i32, new: bool, _skylight: bool, mask: u16, data: &mut std::io::Cursor<Vec<u8>>) -> Result<(), protocol::Error> {
|
||||
use std::io::Read;
|
||||
use byteorder::ReadBytesExt;
|
||||
|
||||
let cpos = CPos(x, z);
|
||||
|
@ -705,9 +702,6 @@ impl World {
|
|||
}
|
||||
|
||||
fn load_uncompressed_chunk17(&mut self, x: i32, z: i32, new: bool, skylight: bool, mask: u16, mask_add: u16, data: &mut std::io::Cursor<Vec<u8>>) -> Result<(), protocol::Error> {
|
||||
use std::io::Read;
|
||||
use crate::types::nibble;
|
||||
|
||||
let cpos = CPos(x, z);
|
||||
{
|
||||
let chunk = if new {
|
||||
|
@ -836,7 +830,7 @@ impl World {
|
|||
}
|
||||
|
||||
pub fn load_chunk19(&mut self, x: i32, z: i32, new: bool, mask: u16, data: Vec<u8>) -> Result<(), protocol::Error> {
|
||||
use std::io::{Cursor, Read};
|
||||
use std::io::Cursor;
|
||||
use byteorder::ReadBytesExt;
|
||||
use crate::protocol::{VarInt, Serializable, LenPrefixed};
|
||||
|
||||
|
|
Loading…
Reference in New Issue