Skip to content

Update codebase#19

Closed
BeakerThe1st wants to merge 31 commits into
PlaceholderAPI:masterfrom
BeakerThe1st:master
Closed

Update codebase#19
BeakerThe1st wants to merge 31 commits into
PlaceholderAPI:masterfrom
BeakerThe1st:master

Conversation

@BeakerThe1st
Copy link
Copy Markdown

Just a simple update to the codebase 👍

This PR also moves from the wrapper being used to the native WorldGuard API. Not sure if there's a reason that the wrapper is being used, but this seems much better :)

@Andre601
Copy link
Copy Markdown
Contributor

The WG Wrapper guarantees support for pre-7 versions.
If the API does have a version independant API now should this be okay

@BeakerThe1st
Copy link
Copy Markdown
Author

The WG Wrapper guarantees support for pre-7 versions.
If the API does have a version independant API now should this be okay

Ah, I thought it had something to do with backwards compatibility. However, WorldGuard's documentation mentions "without breaking a significant amount of backwards compatibility" so while I haven't tested it yet, fingers crossed that it is version independent 🤞

Comment on lines +247 to 260
private String getGroupsFromDomain(DefaultDomain domain) {
StringBuilder stringBuilder = new StringBuilder();
Iterator<String> groupsIterator = domain.getGroups().iterator();

while (groupsIterator.hasNext()) {
stringBuilder.append("*");
stringBuilder.append(groupsIterator.next());
if (groupsIterator.hasNext()) {
stringBuilder.append(", ");
}
}

return stringBuilder.toString();
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

if (highestRegions.size() == 1) {
return highestRegions.get(0);
} else if (highestRegions.size() > 1) {
Random rand = new Random();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Keep an instance at the top of the class instead of creating a new one every time this method is used.

@iGabyTM
Copy link
Copy Markdown
Member

iGabyTM commented Oct 1, 2022

Hey @BeakerThe1st are you going to finish this? 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants