Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Item Placement with Signs #902
This PR aims to fix the block placement interaction involving both sign materials, SIGN_POST and WALL_SIGN.
Observed Behavior: While holding items only pertaining to BlockType, the player can place these materials around and on top of the sign. When placing the blocks, the player's target block will be a variation of the sign and the face will be either North, East, South, West, or Up. The same output occurs when attempting to place a sign onto another variation of the sign.
Expected Behavior: With Vanilla Minecraft, a player cannot place a block or sign onto a placed SIGN_POST or WALL_SIGN unless the player is sneaking while right clicking on the target.
The implementation uses a private variable, pertaining to all BlockTypes, that will be set once a player attempts to right click and place a block. This approach allows for all BlockTypes to check this condition without passing the instance of the player as another argument in canPlaceAt. While compiling BlockNeedsAttached.java, checkstyle produced an error pertaining to javadocs, therefore documentation was given for canAttachTo. In BlockSign.java, canPlaceAt is overrided to provide a different implementation from that of BlockNeedsAttached.
The following changes take into consideration of the relevant player by considering if the instance of the
Also, when determining the target material, would it be best to place this in a method within
Thank you for your valuable contributions to the project so far
In addition, we'd like to invite you to join our Discord server, where you'll be granted the Developer role. Thanks!