-
-
Notifications
You must be signed in to change notification settings - Fork 101
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 inaccurate block stacks #879
base: master
Are you sure you want to change the base?
Fix inaccurate block stacks #879
Conversation
I made a lot of changes with how the code looks; I can change it back to how it looked before for consistency idk |
} | ||
|
||
private void processBlock(int x, int y, int z, @NotNull Chunk chunk, @NotNull ChunkSnapshot chunkSnapshot, @NotNull Map<XMaterial, Integer> teamBlocks) { | ||
Block block = chunk.getBlock(x, y, z); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this thread safe? Remember this is running async
teamBlocks.merge(material, amount, Integer::sum); | ||
} | ||
|
||
public boolean isBlockStacked(Block block) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? getStackAmount defaults to 1 if its not present anyway?
Stacked Blocks always have one more than the actual amount, since we count the placed block as well as the amount of blocks inside the "stack"
5d8f694
to
ce50469
Compare
Stacked Blocks always have one more than the actual amount, since we count the placed block as well as the amount of blocks inside the "stack"