mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-12-24 20:07:34 +01:00
Optimised future WorldGuard integration
This commit is contained in:
parent
ef1901d6c6
commit
7b9fca999d
@ -52,7 +52,13 @@ public class WorldguardManager {
|
||||
if (REGISTERED.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
return REGISTERED.stream().anyMatch(worldguardWrapper -> worldguardWrapper.enabledForPlayer(enchant, (Player) player, player.getLocation()));
|
||||
|
||||
for (WorldguardWrapper worldguardWrapper : REGISTERED) {
|
||||
if (worldguardWrapper.enabledForPlayer(enchant, (Player) player, player.getLocation())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -72,6 +78,12 @@ public class WorldguardManager {
|
||||
if (REGISTERED.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
return REGISTERED.stream().anyMatch(worldguardWrapper -> worldguardWrapper.enabledForPlayer(enchant, (Player) player, location));
|
||||
|
||||
for (WorldguardWrapper worldguardWrapper : REGISTERED) {
|
||||
if (worldguardWrapper.enabledForPlayer(enchant, (Player) player, location)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user