aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEightFactorial <murphkev000@gmail.com>2023-02-21 10:13:06 -0800
committerGitHub <noreply@github.com>2023-02-21 12:13:06 -0600
commitd88ca2d86530e48f60fc1ff275de15a96e2a1779 (patch)
tree4eabf98a6a3e20228bca36ff1984626a6191b62c
parent71308ee0a3c2068bd135cd6731feae75710c58f2 (diff)
downloadazalea-drasl-d88ca2d86530e48f60fc1ff275de15a96e2a1779.tar.xz
Make things public (#71)
* Make struct data pub * Add derives * Rename packet fields * Make Palette structs pub
-rwxr-xr-xazalea-core/src/block_hit_result.rs1
-rwxr-xr-xazalea-core/src/difficulty.rs2
-rw-r--r--azalea-core/src/game_type.rs2
-rwxr-xr-xazalea-protocol/src/packets/game/clientbound_update_tags_packet.rs2
-rwxr-xr-xazalea-protocol/src/packets/game/serverbound_chat_ack_packet.rs2
-rwxr-xr-xazalea-protocol/src/packets/game/serverbound_chat_packet.rs2
-rw-r--r--azalea-world/src/lib.rs4
7 files changed, 8 insertions, 7 deletions
diff --git a/azalea-core/src/block_hit_result.rs b/azalea-core/src/block_hit_result.rs
index 80c9b8fc..420d4408 100755
--- a/azalea-core/src/block_hit_result.rs
+++ b/azalea-core/src/block_hit_result.rs
@@ -1,5 +1,6 @@
use crate::{BlockPos, Direction, Vec3};
+#[derive(Debug, Clone, Copy)]
pub struct BlockHitResult {
pub location: Vec3,
pub direction: Direction,
diff --git a/azalea-core/src/difficulty.rs b/azalea-core/src/difficulty.rs
index 9d504307..750cfe1f 100755
--- a/azalea-core/src/difficulty.rs
+++ b/azalea-core/src/difficulty.rs
@@ -5,7 +5,7 @@ use std::{
use azalea_buf::{BufReadError, McBufReadable, McBufWritable};
-#[derive(Hash, Clone, Debug, PartialEq, Eq)]
+#[derive(Hash, Clone, Copy, Debug, PartialEq, Eq)]
pub enum Difficulty {
PEACEFUL = 0,
EASY = 1,
diff --git a/azalea-core/src/game_type.rs b/azalea-core/src/game_type.rs
index a4930c5d..f99a5805 100644
--- a/azalea-core/src/game_type.rs
+++ b/azalea-core/src/game_type.rs
@@ -97,7 +97,7 @@ impl McBufWritable for GameType {
/// Rust doesn't let us `impl McBufReadable for Option<GameType>` so we have to
/// make a new type :(
#[derive(Hash, Copy, Clone, Debug)]
-pub struct OptionalGameType(Option<GameType>);
+pub struct OptionalGameType(pub Option<GameType>);
impl From<Option<GameType>> for OptionalGameType {
fn from(game_type: Option<GameType>) -> Self {
diff --git a/azalea-protocol/src/packets/game/clientbound_update_tags_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_tags_packet.rs
index d09768c7..7cf507b4 100755
--- a/azalea-protocol/src/packets/game/clientbound_update_tags_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_update_tags_packet.rs
@@ -18,7 +18,7 @@ pub struct Tags {
}
#[derive(Clone, Debug)]
-pub struct TagMap(HashMap<ResourceLocation, Vec<Tags>>);
+pub struct TagMap(pub HashMap<ResourceLocation, Vec<Tags>>);
impl McBufReadable for TagMap {
fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> {
diff --git a/azalea-protocol/src/packets/game/serverbound_chat_ack_packet.rs b/azalea-protocol/src/packets/game/serverbound_chat_ack_packet.rs
index 998e96d2..eaf285cb 100755
--- a/azalea-protocol/src/packets/game/serverbound_chat_ack_packet.rs
+++ b/azalea-protocol/src/packets/game/serverbound_chat_ack_packet.rs
@@ -4,5 +4,5 @@ use azalea_protocol_macros::ServerboundGamePacket;
#[derive(Clone, Debug, McBuf, ServerboundGamePacket)]
pub struct ServerboundChatAckPacket {
#[var]
- pub offset: u32,
+ pub messages: u32,
}
diff --git a/azalea-protocol/src/packets/game/serverbound_chat_packet.rs b/azalea-protocol/src/packets/game/serverbound_chat_packet.rs
index 1912d6a0..a19a9aa7 100755
--- a/azalea-protocol/src/packets/game/serverbound_chat_packet.rs
+++ b/azalea-protocol/src/packets/game/serverbound_chat_packet.rs
@@ -15,6 +15,6 @@ pub struct ServerboundChatPacket {
#[derive(Clone, Debug, McBuf, Default)]
pub struct LastSeenMessagesUpdate {
#[var]
- pub offset: u32,
+ pub messages: u32,
pub acknowledged: FixedBitSet<20>,
}
diff --git a/azalea-world/src/lib.rs b/azalea-world/src/lib.rs
index f0fd5387..1a419c3a 100644
--- a/azalea-world/src/lib.rs
+++ b/azalea-world/src/lib.rs
@@ -7,13 +7,13 @@ mod bit_storage;
mod chunk_storage;
mod container;
pub mod entity;
-mod palette;
+pub mod palette;
mod world;
use std::backtrace::Backtrace;
pub use bit_storage::BitStorage;
-pub use chunk_storage::{Chunk, ChunkStorage, PartialChunkStorage};
+pub use chunk_storage::{Chunk, ChunkStorage, PartialChunkStorage, Section};
pub use container::*;
use thiserror::Error;
pub use world::*;