Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue #574 "All torches place in a wall state" #618

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

lwalton101
Copy link

I have created a trait for blocks which either attach vertically to a wall or the ground. For example, a torch block can either be wall_torch or just torch.

The trait will place the standing torch if it is placed on the right face and if it places a wall attached torch it inverts the face so that the torch faces the correct way.

This issue was reported in Issue #574

Testing

2025-03-09_19 04 22

All 3 torch types are working

Please follow our Coding Guidelines

@lwalton101 lwalton101 marked this pull request as draft March 10, 2025 17:50
@lwalton101
Copy link
Author

marked as draft as the new block property stuff has partially fixed this

@OfficialKris
Copy link
Contributor

marked as draft as the new block property stuff has partially fixed this

Maybe it can be reworked using the new block property code?

@Snowiiii
Copy link
Collaborator

@lwalton101 The properties recently got reworked by @4lve. Can you please use the new system

@lwalton101 lwalton101 marked this pull request as ready for review March 16, 2025 18:59
}
}

return if possible_directions.contains(_player_direction) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_player_direction should be player_direction

}
}

return if possible_directions.contains(_player_direction) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_player_direction should be player_direction

}
}

return if possible_directions.contains(_player_direction) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_player_direction should be player_direction

@Snowiiii
Copy link
Collaborator

Also why you copied the same thing 3 times ?. You could just call one function

@Snowiiii Snowiiii requested a review from kralverde March 17, 2025 20:35
Copy link
Contributor

@kralverde kralverde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the ...LikeProperties should be type aliased into a definitive type, because although the changes are relatively low, a minecraft update can change those names. Type aliasing will make this easier to fix when breaking updates happen.

block_pos: &BlockPos,
face: &BlockDirection,
player_direction: &HorizontalFacing,
mut block_properties: Vec<(String, String)>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of serializing the block properties, you should mutate the LikeProperties struct itself, which contains enums of valid states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants