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

Add mob spawner ranges changes and API #9102

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

Conversation

DavidTs93
Copy link

  • Add vertical range to mob spawners
  • Add Paper settings for default mob spawner ranges (in paper-global.yml)
  • Add API for mob spawner's vertical range
  • Change the existing mob spawner range API's details to represent the change

@DavidTs93 DavidTs93 requested a review from a team as a code owner April 7, 2023 17:53
Copy link
Member

@Machine-Maker Machine-Maker left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution!

Just have a couple minor suggestions.

@DavidTs93
Copy link
Author

Thanks for the contribution!

Just have a couple minor suggestions.

I agree with these, but how do I make those changes and add them to this PR? I'm new to this whole thing...

@Machine-Maker
Copy link
Member

I agree with these, but how do I make those changes and add them to this PR? I'm new to this whole thing...

So what you want to do is edit the patches by ammending to the commits you created in Paper-Server and Paper-API. Since your patches are the newest patches, just doing git commit --amend --no-edit once you've staged changes inside the -Server and -API directories will merge them into the commit. Then you can ./gradlew rebuildPatches to rebuild the patches.

@DavidTs93
Copy link
Author

I agree with these, but how do I make those changes and add them to this PR? I'm new to this whole thing...

So what you want to do is edit the patches by ammending to the commits you created in Paper-Server and Paper-API. Since your patches are the newest patches, just doing git commit --amend --no-edit once you've staged changes inside the -Server and -API directories will merge them into the commit. Then you can ./gradlew rebuildPatches to rebuild the patches.

I've added them - hopefully I did it correctly 😁

@DavidTs93
Copy link
Author

@Machine-Maker do I need to do something now or am I just waiting for this to be approved?

@DavidTs93
Copy link
Author

@Machine-Maker everything changed, anything else needs to be done before this can be merged?
Also thx for all the help!

@kennytv kennytv force-pushed the add-mob-spawner-ranges-changes-and-api branch from 9d81ca5 to 8e97256 Compare August 21, 2023 12:23
}
+
+ // Paper start
+ if (nbt.contains(SPAWN_RANGE_VERTICAL_TAG, 99)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use the Tag.TAG_ANY_NUMERIC constant

import java.util.Optional;
import java.util.function.Function;
import javax.annotation.Nullable;
+
Copy link
Contributor

Choose a reason for hiding this comment

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

This newline is not needed

+
+ /**
+ * Set the new vertical spawn range.
+ * <br>
Copy link
Contributor

Choose a reason for hiding this comment

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

This newline is not needed

Comment on lines +16 to +26
+ public DefaultMobSpawnerValues defaultMobSpawnerValues;
+
+ public class DefaultMobSpawnerValues extends ConfigurationPart {
+ public Range range;
+
+ public class Range extends ConfigurationPart {
+ public int horizontal = 4;
+ public int vertical = 1;
+ }
+ }
+
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be in the config patch (0005-Paper-config-files.patch)

Copy link
Member

@Machine-Maker Machine-Maker left a comment

Choose a reason for hiding this comment

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

I'm not sold on the usefulness or virtue of having the global defaults. They won't apply retroactively to any already-generated spawners because the NBT is already set to 4. I think adding a default for the height is better, but they are already controllable via a plugin.

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

Successfully merging this pull request may close these issues.

4 participants