Fix claim context calculators.

This commit is contained in:
bloodshot 2020-01-09 14:18:46 -05:00
parent eca403bf1d
commit ebe0e49745
3 changed files with 4 additions and 0 deletions

View File

@ -54,6 +54,7 @@ public void calculate(@NonNull Player player, @NonNull ContextConsumer contextSe
} else {
contextSet.accept(sourceClaim.getContext().getKey(), sourceClaim.getContext().getValue());
}
contextSet.accept("server", GriefDefenderPlugin.getInstance().getPermissionProvider().getServerName());
}
}
}

View File

@ -38,6 +38,7 @@
import com.griefdefender.api.permission.flag.Flag;
import com.griefdefender.api.permission.option.Option;
import com.griefdefender.cache.PermissionHolderCache;
import com.griefdefender.claim.ClaimContextCalculator;
import com.griefdefender.claim.GDClaim;
import com.griefdefender.permission.GDPermissionHolder;
import com.griefdefender.permission.GDPermissionResult;
@ -110,6 +111,7 @@ public int compare(Set<Context> s1, Set<Context> s2) {
public LuckPermsProvider() {
this.luckPermsApi = Bukkit.getServicesManager().getRegistration(LuckPerms.class).getProvider();
this.luckPermsApi.getContextManager().registerCalculator(new ClaimContextCalculator());
}
public LuckPerms getApi() {

View File

@ -60,6 +60,7 @@ public void accumulateContexts(Subject calculable, Set<Context> accumulator) {
} else {
accumulator.add(sourceClaim.getSpongeContext());
}
accumulator.add(new Context("server", GriefDefenderPlugin.getInstance().getPermissionProvider().getServerName()));
}
}