Skip to content

Commit

Permalink
update block shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Sep 29, 2023
1 parent 0bf8291 commit fd63adc
Show file tree
Hide file tree
Showing 4 changed files with 5,124 additions and 5,095 deletions.
18 changes: 17 additions & 1 deletion azalea-block/src/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3080,46 +3080,60 @@ make_block_states! {
powered: false,
},
skeleton_skull => BlockBehavior::new().strength(1.0, 1.0), {
powered: false,
rotation: SkeletonSkullRotation::_0,
},
skeleton_wall_skull => BlockBehavior::new().strength(1.0, 1.0), {
facing: FacingCardinal::North,
powered: false,
},
wither_skeleton_skull => BlockBehavior::new().strength(1.0, 1.0), {
powered: false,
rotation: WitherSkeletonSkullRotation::_0,
},
wither_skeleton_wall_skull => BlockBehavior::new().strength(1.0, 1.0), {
facing: FacingCardinal::North,
powered: false,
},
zombie_head => BlockBehavior::new().strength(1.0, 1.0), {
powered: false,
rotation: ZombieHeadRotation::_0,
},
zombie_wall_head => BlockBehavior::new().strength(1.0, 1.0), {
facing: FacingCardinal::North,
powered: false,
},
player_head => BlockBehavior::new().strength(1.0, 1.0), {
powered: false,
rotation: PlayerHeadRotation::_0,
},
player_wall_head => BlockBehavior::new().strength(1.0, 1.0), {
facing: FacingCardinal::North,
powered: false,
},
creeper_head => BlockBehavior::new().strength(1.0, 1.0), {
powered: false,
rotation: CreeperHeadRotation::_0,
},
creeper_wall_head => BlockBehavior::new().strength(1.0, 1.0), {
facing: FacingCardinal::North,
powered: false,
},
dragon_head => BlockBehavior::new().strength(1.0, 1.0), {
powered: false,
rotation: DragonHeadRotation::_0,
},
dragon_wall_head => BlockBehavior::new().strength(1.0, 1.0), {
facing: FacingCardinal::North,
powered: false,
},
piglin_head => BlockBehavior::new().strength(1.0, 1.0), {
powered: false,
rotation: PiglinHeadRotation::_0,
},
piglin_wall_head => BlockBehavior::new().strength(1.0, 1.0), {
facing: FacingCardinal::North,
powered: false,
},
anvil => BlockBehavior::new().requires_correct_tool_for_drops().strength(5.0, 1200.0), {
facing: FacingCardinal::North,
Expand Down Expand Up @@ -3341,7 +3355,9 @@ make_block_states! {
waterlogged: false,
},
slime_block => BlockBehavior::new().friction(0.8), {},
barrier => BlockBehavior::new().strength(-1.0, 3600000.8), {},
barrier => BlockBehavior::new().strength(-1.0, 3600000.8), {
waterlogged: false,
},
light => BlockBehavior::new().strength(-1.0, 3600000.8), {
level: LightLevel::_15,
waterlogged: false,
Expand Down
10 changes: 9 additions & 1 deletion azalea-client/src/packet_handling/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ pub fn process_packet_events(ecs: &mut World) {

// per-client id index
entity_id_index.insert(entity_id, ecs_entity);

debug!("added to LoadedBy of entity {ecs_entity:?} with id {entity_id:?}");
continue;
};

Expand All @@ -698,7 +700,8 @@ pub fn process_packet_events(ecs: &mut World) {
let bundle = p.as_entity_bundle((**instance_name).clone());
let mut spawned =
commands.spawn((entity_id, LoadedBy(HashSet::from([player_entity])), bundle));
let ecs_entity = spawned.id();
let ecs_entity: Entity = spawned.id();
debug!("spawned entity {ecs_entity:?} with id {entity_id:?}");

azalea_entity::indexing::add_entity_to_indexes(
entity_id,
Expand Down Expand Up @@ -946,8 +949,13 @@ pub fn process_packet_events(ecs: &mut World) {
);
continue;
};

// the [`remove_despawned_entities_from_indexes`] system will despawn the entity
// if it's not loaded by anything anymore

// also we can't just ecs.despawn because if we're in a swarm then the entity
// might still be loaded by another client

loaded_by.remove(&player_entity);
}
}
Expand Down
Loading

0 comments on commit fd63adc

Please sign in to comment.