This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into light-updates
- Loading branch information
Showing
96 changed files
with
1,696 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: "Run TODO to Issue" | ||
on: ["push"] | ||
jobs: | ||
build: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: "actions/checkout@v3" | ||
- name: "TODO to Issue" | ||
uses: "alstr/todo-to-issue-action@v4" | ||
with: | ||
IDENTIFIERS: '[{"name": "TODO", "labels": []}, {"name": "FIXME", "labels": ["bug"]}]' | ||
ISSUE_TEMPLATE: "{{ title }}\n\n{{ body }}\n\n{{ url }}\n\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
minecraft-server-derive/Cargo.toml → minecraft-entities-derive/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[package] | ||
name = "minecraft-entities" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
minecraft-protocol = { path = "../minecraft-protocol" } | ||
minecraft-positions = { path = "../minecraft-positions" } | ||
minecraft-entities-derive = { path="../minecraft-entities-derive" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Axolotl { | ||
pub animal: Animal, | ||
pub variant: u8, | ||
pub playing_dead: bool, | ||
pub spawn_from_bucket: bool, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Bee { | ||
pub animal: Animal, | ||
pub flag: u8, | ||
pub anger_time: usize, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use super::*; | ||
|
||
#[inherit(TameableAnimal, Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Cat { | ||
pub tameable_animal: TameableAnimal, | ||
pub variant: u8, | ||
pub is_lying: bool, | ||
pub is_relaxed: bool, | ||
pub collar_color: u8, | ||
} | ||
|
||
impl Default for Cat { | ||
fn default() -> Self { | ||
Self { | ||
tameable_animal: Default::default(), | ||
variant: 0, | ||
is_lying: false, | ||
is_relaxed: false, | ||
collar_color: 14, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Chicken { | ||
pub animal: Animal, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inheritable] | ||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Cow { | ||
pub animal: Animal, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inherit(Cow, Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
|
||
pub struct Mooshroom { | ||
pub cow: Cow, | ||
pub variant: u8, // In the doc it is a string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inherit(ChestedHorse, AbstractHorse, Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Donkey { | ||
pub chested_horse: ChestedHorse, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inheritable] | ||
#[inherit(WaterAnimal, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct AbstractFish { | ||
pub water_animal: WaterAnimal, | ||
pub from_bucket: bool, | ||
} | ||
|
||
|
||
#[derive(Default)] | ||
#[inherit(AbstractFish, WaterAnimal, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Cod { | ||
pub abstract_fish: AbstractFish, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inherit(AbstractFish, WaterAnimal, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct PufferFish { | ||
pub abstract_fish: AbstractFish, | ||
pub puff_state: usize, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inherit(AbstractFish, WaterAnimal, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Salmon { | ||
pub abstract_fish: AbstractFish, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inherit(AbstractFish, WaterAnimal, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct TropicalFish { | ||
pub abstract_fish: AbstractFish, | ||
pub variant: usize, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inherit(AbstractFish, WaterAnimal, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Tadpole { | ||
pub abstract_fish: AbstractFish, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use minecraft_protocol::packets::UUID; | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Fox { | ||
pub animal: Animal, | ||
pub variant: u8, | ||
pub mask: u8, | ||
pub first_uuid: Option<UUID>, | ||
pub second_uuid: Option<UUID>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
use minecraft_protocol::packets::UUID; | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Frog { | ||
pub animal: Animal, | ||
pub variant: u8, | ||
pub tongue_target: Option<usize>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use super::*; | ||
|
||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Goat { | ||
pub animal: Animal, | ||
pub is_screaming: bool, | ||
pub has_left_horn: bool, | ||
pub has_right_horn: bool, | ||
} | ||
|
||
impl Default for Goat { | ||
fn default() -> Self { | ||
Self { | ||
animal: Animal::default(), | ||
is_screaming: false, | ||
has_left_horn: true, | ||
has_right_horn: true, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use minecraft_protocol::packets::UUID; | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Hoglin { | ||
pub animal: Animal, | ||
pub is_immune: bool, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inheritable] | ||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct AbstractHorse { | ||
pub animal: Animal, | ||
pub mask: u8, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inherit(AbstractHorse, Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Horse { | ||
pub abstract_horse: AbstractHorse, | ||
pub variant: usize, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inherit(AbstractHorse, Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct ZombieHorse { | ||
pub abstract_horse: AbstractHorse, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inherit(AbstractHorse, Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct SkeletonHorse { | ||
pub abstract_horse: AbstractHorse, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inherit(AbstractHorse, Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Camel { | ||
pub abstract_horse: AbstractHorse, | ||
pub is_dashing: bool, | ||
pub last_pose_change_tick: usize, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inheritable] | ||
#[inherit(AbstractHorse, Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct ChestedHorse { | ||
pub abstract_horse: AbstractHorse, | ||
pub has_chest: bool, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inheritable] | ||
#[inherit(ChestedHorse, AbstractHorse, Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Mule { | ||
pub chested_horse: ChestedHorse, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use super::*; | ||
|
||
#[inheritable] | ||
#[inherit(ChestedHorse, AbstractHorse, Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Llama { | ||
pub chested_horse: ChestedHorse, | ||
/// Strength (number of columns of 3 slots in the llama's inventory once a chest is equipped) | ||
pub stength: u8, | ||
/// Carpet color (a dye color, or -1 if no carpet equipped) | ||
pub carpet_color: i16, | ||
pub variant: u8, | ||
} | ||
|
||
impl Default for Llama { | ||
fn default() -> Self { | ||
Self { | ||
chested_horse: ChestedHorse::default(), | ||
stength: 0, | ||
carpet_color: -1, | ||
variant: 0, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Default)] | ||
#[inherit(Llama, ChestedHorse, AbstractHorse, Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct TraderLlama { | ||
pub llama: Llama, | ||
} | ||
|
||
|
||
#[derive(Default)] | ||
#[inherit(Entity)] | ||
pub struct LlamaSpit { | ||
pub entity: Entity, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
use super::*; | ||
|
||
mod sniffer; | ||
pub use sniffer::*; | ||
mod horses; | ||
pub use horses::*; | ||
mod donkey; | ||
pub use donkey::*; | ||
mod llama; | ||
pub use llama::*; | ||
mod axolotl; | ||
pub use axolotl::*; | ||
mod bee; | ||
pub use bee::*; | ||
mod fox; | ||
pub use fox::*; | ||
mod frog; | ||
pub use frog::*; | ||
mod ocelot; | ||
pub use ocelot::*; | ||
mod panda; | ||
pub use panda::*; | ||
mod pig; | ||
pub use pig::*; | ||
mod rabbit; | ||
pub use rabbit::*; | ||
mod turtle; | ||
pub use turtle::*; | ||
mod polar_bear; | ||
pub use polar_bear::*; | ||
mod chicken; | ||
pub use chicken::*; | ||
mod cow; | ||
pub use cow::*; | ||
mod hoglin; | ||
pub use hoglin::*; | ||
mod sheep; | ||
pub use sheep::*; | ||
mod strider; | ||
pub use strider::*; | ||
mod cat; | ||
pub use cat::*; | ||
mod wolf; | ||
pub use wolf::*; | ||
mod parrot; | ||
pub use parrot::*; | ||
mod goat; | ||
pub use goat::*; | ||
mod fishes; | ||
pub use fishes::*; | ||
mod water_animal; | ||
pub use water_animal::*; | ||
|
||
#[derive(Default)] | ||
#[inheritable] | ||
#[inherit(AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Animal { | ||
pub ageable_mob: AgeableMob, | ||
} | ||
|
||
#[derive(Default)] | ||
#[inheritable] | ||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct TameableAnimal { | ||
pub animal: Animal, | ||
pub action_mask: u8, | ||
pub owner: Option<UUID>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use minecraft_protocol::packets::UUID; | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Ocelot { | ||
pub animal: Animal, | ||
pub is_trusting: bool, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use minecraft_protocol::packets::UUID; | ||
use super::*; | ||
|
||
#[derive(Default)] | ||
#[inherit(Animal, AgeableMob, PathfinderMob, Mob, LivingEntity, Entity)] | ||
pub struct Panda { | ||
pub animal: Animal, | ||
pub breed_timer: u16, | ||
pub sneeze_timer: u16, | ||
pub eat_timer: u16, | ||
pub main_gene: u8, | ||
pub hidden_gene: u8, | ||
pub action_mask: u8, | ||
} |
Oops, something went wrong.