Merge pull request #19 from caelunshun/refactor · feather-rs/feather@f55d9a8 · GitHub
Skip to content

Commit f55d9a8

Browse files
authored
Merge pull request #19 from caelunshun/refactor
Refactor the entire codebase to use Specs instead of a homebrew ECS. Doing so allows for more modularity, easier testing, and significantly higher scalability thanks to Specs's parallelism.
2 parents 946523f + b5dfb33 commit f55d9a8

24 files changed

Lines changed: 2660 additions & 1422 deletions

.codecov.yml

Lines changed: 1 addition & 1 deletion

Cargo.lock

Lines changed: 10 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "feather_core"
3-
version = "0.1.0"
3+
version = "0.3.0"
44
authors = ["caelunshun <caelum12321@gmail.com>"]
55
edition = "2018"
66

core/src/network/mctypes.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::bytebuf::{BufMutAlloc, ByteBuf};
1+
use crate::bytebuf::{BufMutAlloc, BufResulted, ByteBuf};
22
use crate::prelude::*;
33
use crate::world::BlockPosition;
44
use bytes::Buf;
@@ -110,7 +110,7 @@ impl<T: Buf + Read> McTypeRead for T {
110110
if self.remaining() == 0 {
111111
return Err(());
112112
}
113-
let read = self.get_u8();
113+
let read = self.read_u8()?;
114114
let value = read & 0b01111111;
115115
result |= (value as i32) << (7 * num_read);
116116

@@ -149,7 +149,7 @@ impl<T: Buf + Read> McTypeRead for T {
149149
if self.remaining() < 8 {
150150
return Err(());
151151
}
152-
let val = self.get_u64_be();
152+
let val = self.read_i64_be()?;
153153
let x = val >> 38;
154154
let y = (val >> 26) & 0xFFF;
155155
let z = val << 38 >> 38;
@@ -158,7 +158,7 @@ impl<T: Buf + Read> McTypeRead for T {
158158
}
159159

160160
fn read_bool(&mut self) -> Result<bool, ()> {
161-
let byte = self.get_u8();
161+
let byte = self.read_u8()?;
162162
match byte {
163163
0 => Ok(false),
164164
1 => Ok(true),

core/src/network/packet/implementation.rs

Lines changed: 2 additions & 4 deletions

0 commit comments

Comments
 (0)