Fix: Place multiblock gates with proper initial states in the presence of adjacent redstone#14
Closed
hugeblank wants to merge 1 commit into
Closed
Conversation
Contributor
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When setting up the signals before placing down an adder, and then placing it down, the input states appear incorrectly:


This PR fixes that, and changes a few subjective things, mostly to do with the adders:
BLOCK_PARTstate names (and their respective multiblock model/texture file names/paths) fromtop/bottomtoleft/right. The names are derived from the direction the output is pointed, which is the opposite of thefacingblock state field. This means that if the center has afacingofnorth, to get to the therightblock part you have to usepos.offset(state.get(FACING).rotateYCounterclockwise())(to the left). I did this to make it more clear what the state parameter is, but it only really makes sense when looking at the f3 debug screen. Depending on input I'm wiling to change this so that it matches the developers perspective.POWEREDproperty fromAbstractSimpleLogicGatewith a static import.updateTargetto take a direction as a parameter. It used to use a state, but all it needed was thefacingdirection. There's a couple other methods that still use states that only evaluate the direction in the multiblocks that should also probably be changed around.getSideInput/getCarryInputwere able to be made static. Static method calls are free performance for the record, so if it can be helped, tackstaticonto it.Last thing, Java class naming schemes follow
PascalCase, where the first letter of each 'word' in the class is capitalized. You'll see this in the game code too. The file names of this project are all over the place, some are pascal case, some (the blocks) are a hybrid of pascal andsnake_case, and one is screaming at me in snake case (BLOCK_PART). I'd advise for readability and consistency all file/class names be moved to pascal case. If you're feeling lazy feel free to just comment that you're okay with me going through and renaming them, and I'll PR it.