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.
Identify the Bug
Iron and Gold generators don't drop the correct amount of items
For example if you set in config
amount: 3
then it will only drop 2 itemsand if you set in config
amount: 5
then it will only drop 3 itemsThis bug is caused by an extra line in OreGenerator class dropItem method
temp--;
We don't need that extra line because the loop's logic is flawed:
temp = amount
as the starting statement will set temp variable to the amount we wanttemp >= 0
as the ending condition will make it spawn an extra item because when temp variable is at zero, the loop still continues one more timeDescription of the Change
Set the loop's ending condition to
temp > 0
will make the loop stop when the correct amount of items have been spawned, so we don't need that extra line anymore