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

[BLOCKING] Claims failing to fully load with specific API usages #273

Open
Sir-Will opened this issue Sep 2, 2020 · 6 comments
Open

[BLOCKING] Claims failing to fully load with specific API usages #273

Sir-Will opened this issue Sep 2, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@Sir-Will
Copy link

Sir-Will commented Sep 2, 2020

If a plugin calls the following method for all worlds GD fails to fully load all claims resulting in no active protection and visualization tools not working.

@Listener
public void onServerStart(GameStartedServerEvent event) {
    for (WorldProperties world : Sponge.getServer().getAllWorldProperties()) {
	    Set<Claim> claims = GriefDefender.getCore().getClaimManager(world.getUniqueId()).getWorldClaims();
	}
}

After some more testing this seems to happen when calling getClaimManager() on an unloaded or not existing world.

@Sir-Will
Copy link
Author

Sir-Will commented Sep 2, 2020

The easiest way to reproduce the issue is to just call GriefDefender.getCore().getClaimManager(UUID.randomUUID());

@bloodmc
Copy link
Owner

bloodmc commented Sep 6, 2020

GD does not support claims in unloaded worlds. You should be using

https://github.com/SpongePowered/SpongeAPI/blob/stable-7/src/main/java/org/spongepowered/api/Server.java#L92

@bloodmc bloodmc closed this as completed Sep 6, 2020
@Sir-Will
Copy link
Author

Sir-Will commented Sep 8, 2020

GD does not support claims in unloaded worlds.

This is still a big issue, you are expecting everyone who is using the API to check if the world is loaded before calling getClaimManager(). With worlds being loaded and unloaded frequently, this will most likely cause the protection to fail at some point.

You should be using

That's what I'm using as workaround but I need to handle claims of unloaded worlds too.

@bloodmc
Copy link
Owner

bloodmc commented Sep 8, 2020

OK, I'll label this as enhancement.

@bloodmc bloodmc reopened this Sep 8, 2020
@bloodmc bloodmc added the enhancement New feature or request label Sep 8, 2020
@bloodmc
Copy link
Owner

bloodmc commented Dec 28, 2020

Please provide a use case of accessing unloaded world claims. Currently, GD only loads claims when a world loads.

@Sir-Will
Copy link
Author

Checking the owners activity of all claims on startup to remove and handle inactive ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants