Update to Minecraft 1.11 (Fixes #63)

This commit is contained in:
Techcable 2016-12-09 07:32:02 -07:00 committed by Matthew Collins
parent 5e0c041a71
commit 1e8c3582ed
7 changed files with 31 additions and 17 deletions

4
.gitignore vendored
View File

@ -2,6 +2,10 @@ target/
.rust/
working/
# IntelliJ
.idea
*.iml
# Steven Data
conf.cfg
index

View File

@ -8,7 +8,7 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2 ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install openssl ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo chown root:wheel /usr/local/bin/brew ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo brew link sdl2 ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew link sdl2 ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y libsdl2-dev libsdl2-mixer-dev libssl-dev gcc ; fi
script:

View File

@ -3,6 +3,12 @@ name = "steven"
version = "0.0.1"
authors = [ "Thinkofdeath <thinkofdeath@spigotmc.org>" ]
[profile.dev]
# Steven runs horrendously slow with no optimizations, and often freezes.
# However, building with full -O3 optimizations takes too long for a debug build.
# Use an -O1 optimization level strikes a good compromise between build and program performance.
opt-level = 1
[dependencies]
sdl2 = "0.16.1"
byteorder = "0.5.0"

View File

@ -34,7 +34,7 @@ use flate2;
use time;
use shared::Position;
pub const SUPPORTED_PROTOCOL: i32 = 210;
pub const SUPPORTED_PROTOCOL: i32 = 315;
/// Helper macro for defining packets
@ -200,7 +200,9 @@ impl <T> Serializable for Option<T> where T : Serializable {
impl Serializable for String {
fn read_from<R: io::Read>(buf: &mut R) -> Result<String, Error> {
let len = try!(VarInt::read_from(buf)).0;
let len = VarInt::read_from(buf)?.0;
debug_assert!(len >= 0, "Negative string length: {}", len);
debug_assert!(len <= 65536, "String length too big: {}", len);
let mut ret = String::new();
try!(buf.take(len as u64).read_to_string(&mut ret));
Result::Ok(ret)

View File

@ -231,9 +231,9 @@ state_packets!(
field location: Position =,
field face: VarInt =,
field hand: VarInt =,
field cursor_x: u8 =,
field cursor_y: u8 =,
field cursor_z: u8 =,
field cursor_x: f32 =,
field cursor_y: f32 =,
field cursor_z: f32 =,
}
/// UseItem is sent when the client tries to use an item.
packet UseItem {
@ -281,7 +281,7 @@ state_packets!(
packet SpawnMob {
field entity_id: VarInt =,
field uuid: UUID =,
field ty: u8 =,
field ty: VarInt =,
field x: f64 =,
field y: f64 =,
field z: f64 =,
@ -780,9 +780,10 @@ state_packets!(
field action: VarInt =,
field title: Option<format::Component> = when(|p: &Title| p.action.0 == 0),
field sub_title: Option<format::Component> = when(|p: &Title| p.action.0 == 1),
field fade_in: Option<i32> = when(|p: &Title| p.action.0 == 2),
field fade_stay: Option<i32> = when(|p: &Title| p.action.0 == 2),
field fade_out: Option<i32> = when(|p: &Title| p.action.0 == 2),
field action_bar_text: Option<String> = when(|p: &Title| p.action.0 == 2),
field fade_in: Option<i32> = when(|p: &Title| p.action.0 == 3),
field fade_stay: Option<i32> = when(|p: &Title| p.action.0 == 3),
field fade_out: Option<i32> = when(|p: &Title| p.action.0 == 3),
}
/// SoundEffect plays the named sound at the target location.
packet SoundEffect {
@ -804,6 +805,7 @@ state_packets!(
packet CollectItem {
field collected_entity_id: VarInt =,
field collector_entity_id: VarInt =,
field number_of_items: VarInt =,
}
/// EntityTeleport teleports the entity to the target location. This is
/// sent if the entity moves further than EntityMove allows.

View File

@ -30,10 +30,10 @@ use zip;
use types::hash::FNVHash;
use ui;
const RESOURCES_VERSION: &'static str = "1.10.2";
const VANILLA_CLIENT_URL: &'static str = "https://launcher.mojang.com/mc/game/1.10.2/client/dc8e75ac7274ff6af462b0dcec43c307de668e40/client.jar";
const ASSET_VERSION: &'static str = "1.10.2";
const ASSET_INDEX_URL: &'static str = "https://launchermeta.mojang.com/mc/assets/1.10/d3bfc4ffba1ea334c725dd91eaf4ecd402d641f7/1.10.json";
const RESOURCES_VERSION: &'static str = "1.11";
const VANILLA_CLIENT_URL: &'static str = "https://launcher.mojang.com/mc/game/1.11/client/780e46b3a96091a7f42c028c615af45974629072/client.jar";
const ASSET_VERSION: &'static str = "1.11";
const ASSET_INDEX_URL: &'static str = "https://launchermeta.mojang.com/mc/assets/1.11/e02b8fba4390e173057895c56ecc91e3ce3bbd40/1.11.json";
pub trait Pack: Sync + Send {
fn open(&self, name: &str) -> Option<Box<io::Read>>;

View File

@ -522,9 +522,9 @@ impl Server {
_ => unreachable!(),
}),
hand: protocol::VarInt(0),
cursor_x: (at.x * 16.0) as u8,
cursor_y: (at.y * 16.0) as u8,
cursor_z: (at.z * 16.0) as u8,
cursor_x: at.x as f32,
cursor_y: at.y as f32,
cursor_z: at.z as f32
});
}
}