Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

update branch #49

Merged
merged 116 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
b39360d
Add ZombieHorse
DimitriTimoz Nov 3, 2023
66a5a0d
Add Horse
DimitriTimoz Nov 3, 2023
c9fc888
Add SkeletonHorse
DimitriTimoz Nov 3, 2023
4db0e4e
Add Camel
DimitriTimoz Nov 3, 2023
f40f542
Add ChestedHorse
DimitriTimoz Nov 3, 2023
abe851e
Add Donkey
DimitriTimoz Nov 3, 2023
20ea7d9
Add Llama
DimitriTimoz Nov 3, 2023
ab50e70
Add Trader Llama
DimitriTimoz Nov 3, 2023
93f4f37
Add Mule
DimitriTimoz Nov 3, 2023
83e758b
Add axolot
DimitriTimoz Nov 3, 2023
57590c5
Add bee
DimitriTimoz Nov 3, 2023
dc5062f
Add Fox
DimitriTimoz Nov 3, 2023
c449488
Frog
DimitriTimoz Nov 3, 2023
a5e7092
Add Ocelot
DimitriTimoz Nov 3, 2023
77cdf1b
Add Panda
DimitriTimoz Nov 3, 2023
dd1948d
Add Pig
DimitriTimoz Nov 3, 2023
2f73aaf
Add Rabit
DimitriTimoz Nov 3, 2023
96d7173
Add Turtle
DimitriTimoz Nov 3, 2023
8c0148a
Add Default derive to BlockPosition
DimitriTimoz Nov 3, 2023
9d82351
Add PolarBear
DimitriTimoz Nov 3, 2023
12ff0c7
Add Cow & Chicken
DimitriTimoz Nov 3, 2023
9ede508
Add Hoglin
DimitriTimoz Nov 3, 2023
8bf3df8
Add Mooshroom
DimitriTimoz Nov 3, 2023
c48e413
Add Sheep
DimitriTimoz Nov 3, 2023
6f73aad
Add Strider
DimitriTimoz Nov 3, 2023
b2cd164
Add TameableAnimal
DimitriTimoz Nov 3, 2023
2694373
Add Cat
DimitriTimoz Nov 3, 2023
c463fa3
Remove Default derive for Cat
DimitriTimoz Nov 3, 2023
2b1317f
Add Wolf
DimitriTimoz Nov 3, 2023
0353f37
Add Parrot
DimitriTimoz Nov 3, 2023
6f19e26
Add Villager & AbstractVillager
DimitriTimoz Nov 3, 2023
06eef03
Add WanderingTrader
DimitriTimoz Nov 3, 2023
6254dca
Add AbstractGolem
DimitriTimoz Nov 3, 2023
f1f6999
Add IronGolem
DimitriTimoz Nov 3, 2023
09cc590
Add SnowGolem
DimitriTimoz Nov 3, 2023
9b450ca
Add Shulker
DimitriTimoz Nov 3, 2023
c7f9652
Add Monster
DimitriTimoz Nov 3, 2023
17b4f32
Add BasePiglin
DimitriTimoz Nov 3, 2023
a23e048
Add Piglin & PiglinBrute
DimitriTimoz Nov 3, 2023
02d7f6c
Add Blaze
DimitriTimoz Nov 3, 2023
cd5f003
Add Creeper
DimitriTimoz Nov 3, 2023
37f7276
Add Endermite & fix Creeper default
DimitriTimoz Nov 3, 2023
ce6952c
Add Giant
DimitriTimoz Nov 3, 2023
77578d4
move animals into a module
DimitriTimoz Nov 3, 2023
2ba91a9
rename to plurial
DimitriTimoz Nov 3, 2023
eda91c6
line feed
DimitriTimoz Nov 3, 2023
8a6e04f
line feed
DimitriTimoz Nov 3, 2023
fe8d7c2
Add goat
DimitriTimoz Nov 3, 2023
ae15197
Add Guardian
DimitriTimoz Nov 3, 2023
02b25b0
Add ElderGuardian
DimitriTimoz Nov 3, 2023
7eaf45c
Add Silverfish
DimitriTimoz Nov 3, 2023
87f5aa8
Fix Silverfish
DimitriTimoz Nov 3, 2023
78453e9
Add Raider
DimitriTimoz Nov 3, 2023
fb01f51
Add AbstractIllager
DimitriTimoz Nov 3, 2023
cdf6729
Add Pillager
DimitriTimoz Nov 3, 2023
608f48c
Fix grammar Axolotl
DimitriTimoz Nov 8, 2023
3427b47
Add SpellcasterIllager
DimitriTimoz Nov 8, 2023
9484b12
Add Evoker
DimitriTimoz Nov 8, 2023
2f7ab86
Add Illusioner
DimitriTimoz Nov 8, 2023
d664b71
Add Ravager
DimitriTimoz Nov 8, 2023
86a3d56
Add Witch
DimitriTimoz Nov 8, 2023
b94aaf7
Add EvokerFangs
DimitriTimoz Nov 8, 2023
5c88e4d
Add Vex
DimitriTimoz Nov 8, 2023
9c82f24
Add entity getters and setters
Mubelotix Nov 3, 2023
4cb2322
Add Skeleton
DimitriTimoz Nov 8, 2023
09ac73e
Add Skeleton
DimitriTimoz Nov 8, 2023
84237bb
Add Stray & WitherSkeleton
DimitriTimoz Nov 8, 2023
3b3999b
Add Spider
DimitriTimoz Nov 8, 2023
990cb5a
Add Warden
DimitriTimoz Nov 8, 2023
3217fc5
Add Wither
DimitriTimoz Nov 8, 2023
c2fbc75
Add Zoglin
DimitriTimoz Nov 8, 2023
317b5f4
Add Zombie base
DimitriTimoz Nov 8, 2023
cc27ee5
Add some Zombies
DimitriTimoz Nov 8, 2023
c5beda4
Add Enderman
DimitriTimoz Nov 8, 2023
d54a5b8
Add EnderDragon
DimitriTimoz Nov 8, 2023
559aa1d
Add Flying mobs
DimitriTimoz Nov 8, 2023
71d4d02
Add Slime
DimitriTimoz Nov 8, 2023
10f10d9
Add LlamaSpit
DimitriTimoz Nov 8, 2023
9e110d7
Add EyeOfEnder
DimitriTimoz Nov 8, 2023
d654a92
Add FallingBlock
DimitriTimoz Nov 8, 2023
892a409
Add AreaEffectCloud
DimitriTimoz Nov 8, 2023
4c7d118
Add FishingHook
DimitriTimoz Nov 8, 2023
37f95d0
Add EndCrystal
DimitriTimoz Nov 8, 2023
5ce166a
Add DragonFireball
DimitriTimoz Nov 8, 2023
1d06dc6
Add Fireballs
DimitriTimoz Nov 8, 2023
9b0d1e2
Add WitherSkull
DimitriTimoz Nov 8, 2023
7b3bc45
Add FireworkRocket
DimitriTimoz Nov 8, 2023
e3e8765
Add ItemFrame
DimitriTimoz Nov 8, 2023
187de42
Add GlowingItemFrame
DimitriTimoz Nov 8, 2023
0f05640
Remove #[inheritable] attribute from
DimitriTimoz Nov 8, 2023
212cb40
Add Painting
DimitriTimoz Nov 8, 2023
6d1f69b
Add ItemEntity
DimitriTimoz Nov 8, 2023
be16aff
Add ArmorStand
DimitriTimoz Nov 8, 2023
a8b3f37
Add Dolphin
DimitriTimoz Nov 8, 2023
6aef87f
Add fishes
DimitriTimoz Nov 8, 2023
12ce895
Fix compilation
DimitriTimoz Nov 8, 2023
8fe945d
Add new entities to AnyEntity enum.
DimitriTimoz Nov 8, 2023
7c2c059
fix Axolott typo
DimitriTimoz Nov 8, 2023
1bc2c6c
with previous commit
DimitriTimoz Nov 8, 2023
5488995
Merge branch 'poo_experiment' into entities-d
DimitriTimoz Nov 8, 2023
1495c95
Merge pull request #12 from Mubelotix/entities-d
DimitriTimoz Nov 8, 2023
f5e5aca
Group mobs
Mubelotix Nov 8, 2023
cf556fa
Group animals
Mubelotix Nov 8, 2023
1240608
Move files around
Mubelotix Nov 8, 2023
9da8083
Rename minecraft-server-derive to minecraft-entities-derive
Mubelotix Nov 8, 2023
4748f73
Merge pull request #11 from Mubelotix/poo_experiment
Mubelotix Nov 8, 2023
5ea9f42
Update minecraft-server/src/player_handler/play.rs
Mubelotix Nov 8, 2023
98297cd
Merge branch 'main' into world
Mubelotix Nov 8, 2023
abbd6ff
Split world.rs into multiple files
Mubelotix Nov 8, 2023
cfdafa2
Remove entry when empty
Mubelotix Nov 8, 2023
14ffec1
Add test_world_loading_manager
Mubelotix Nov 8, 2023
214aac0
Add test_world_notifications
Mubelotix Nov 8, 2023
9e6c5f8
Merge pull request #13 from Mubelotix/world
Mubelotix Nov 8, 2023
93a4231
Todos
Mubelotix Nov 11, 2023
3843457
Add template
Mubelotix Nov 12, 2023
4bf53ad
Edit issue template
Mubelotix Nov 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/todo.yml
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"
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ members = [
"minecraft-protocol",
"minecraft-protocol-derive",
"minecraft-server",
"minecraft-entities",
"minecraft-positions",
"tags-macros"
]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "minecraft-server-derive"
name = "minecraft-entities-derive"
version = "0.1.0"
edition = "2021"

Expand Down
11 changes: 11 additions & 0 deletions minecraft-entities/Cargo.toml
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" }
10 changes: 10 additions & 0 deletions minecraft-entities/src/animals/axolotl.rs
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,
}
9 changes: 9 additions & 0 deletions minecraft-entities/src/animals/bee.rs
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,
}
22 changes: 22 additions & 0 deletions minecraft-entities/src/animals/cat.rs
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,
}
}
}
7 changes: 7 additions & 0 deletions minecraft-entities/src/animals/chicken.rs
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,
}
16 changes: 16 additions & 0 deletions minecraft-entities/src/animals/cow.rs
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
}
7 changes: 7 additions & 0 deletions minecraft-entities/src/animals/donkey.rs
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,
}
42 changes: 42 additions & 0 deletions minecraft-entities/src/animals/fishes.rs
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,
}
12 changes: 12 additions & 0 deletions minecraft-entities/src/animals/fox.rs
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>,
}
10 changes: 10 additions & 0 deletions minecraft-entities/src/animals/frog.rs
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>,
}
20 changes: 20 additions & 0 deletions minecraft-entities/src/animals/goat.rs
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,
}
}
}
9 changes: 9 additions & 0 deletions minecraft-entities/src/animals/hoglin.rs
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,
}
51 changes: 51 additions & 0 deletions minecraft-entities/src/animals/horses.rs
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,
}
36 changes: 36 additions & 0 deletions minecraft-entities/src/animals/llama.rs
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,
}
68 changes: 68 additions & 0 deletions minecraft-entities/src/animals/mod.rs
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>,
}
9 changes: 9 additions & 0 deletions minecraft-entities/src/animals/ocelot.rs
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,
}
14 changes: 14 additions & 0 deletions minecraft-entities/src/animals/panda.rs
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,
}
Loading