Skip to content

Conversation

@nivcoo
Copy link
Contributor

@nivcoo nivcoo commented Sep 14, 2025

Hello,

I implemented worldguard support, it works, i don't test it without worldguard and idk if i do that correctly with your : "compileOnlyPlugin" etc, let me know if i've to change something else, thanks you

@nivcoo nivcoo mentioned this pull request Sep 14, 2025
2 tasks
@nivcoo
Copy link
Contributor Author

nivcoo commented Oct 13, 2025

Hello, i fixed 2 others bugs too, i used it actually on my servers

@Krakenied Krakenied self-assigned this Nov 28, 2025
@Krakenied
Copy link
Collaborator

Krakenied commented Nov 28, 2025

It's a highly inefficient solution (at least not sufficiently efficient to be accepted in current form). I will take a look into introducing such a feature though.

@Krakenied Krakenied added the status: needs investigating Bug report / feature request needs investigating and triage label Nov 28, 2025
@nivcoo
Copy link
Contributor Author

nivcoo commented Nov 28, 2025

Hello I don’t understand ? I used it since I publish this PR and everything working well

@Krakenied
Copy link
Collaborator

Krakenied commented Jan 21, 2026

Hello I don’t understand ? I used it since I publish this PR and everything working well

It's inefficient. Your code, completely unnecessarily, performs region query for each quest and task started:

for (Task task : quest.getTasksOfType(type.getType())) {
if (constraintSet.contains(TaskConstraint.WORLD)) {
if (!TaskUtils.validateWorld(player, task)) {
continue;
}
}
if (constraintSet.contains(TaskConstraint.REGION)) {
if (!TaskUtils.validateRegion(player, task)) {

Take a look at how biome key check is implemented. It computes the biome only once per the entire method call. With current implementation, for example, 1000 3-task quests with region requirement in each, the method would need to perform 3000 region queries instead of just one (and these are probably considered heavy).

Another issue I can see with that implementation is that it would be preferred to use appropriate location depending on task type (for example for mining it should check mined block location and for mobkilling the mob death location), however the issue is already a thing when it comes to the biome check, so not really a big deal.

Also, probably the WorldGuard integration should be separated into a dedicated hook (like Essentials/CoreProtect are), so there is no need for these ugly checks and linkage error handling in TaskUtils class.

Oh, I also don't really understand the need for these checks, as BlockBreakEvent definitely shouldn't be called for air. Shouldn't it be fixed on other plugin side?

public void onBlockBreak(BlockBreakEvent event) {
Block block = event.getBlock();
if (block.getType().isAir())
return;

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

Labels

status: needs investigating Bug report / feature request needs investigating and triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants