mirror of
https://github.com/bloodmc/GriefDefender.git
synced 2024-11-25 12:45:48 +01:00
Don't add active contexts during getPermissionValue calls.
* Fix 'entity-spawn' flag lookups with wrong context.
This commit is contained in:
parent
cccb3c79d5
commit
8743c5fe96
@ -239,7 +239,7 @@ public Tristate getFinalPermission(Event event, Location location, Set<Context>
|
|||||||
|
|
||||||
if (flag == Flags.ENTITY_SPAWN) {
|
if (flag == Flags.ENTITY_SPAWN) {
|
||||||
// Check spawn limit
|
// Check spawn limit
|
||||||
final int spawnLimit = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Integer.class), GriefDefenderPlugin.DEFAULT_HOLDER, Options.SPAWN_LIMIT, claim, contexts);
|
final int spawnLimit = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Integer.class), GriefDefenderPlugin.DEFAULT_HOLDER, Options.SPAWN_LIMIT, claim, new HashSet<>(contexts));
|
||||||
if (spawnLimit > -1) {
|
if (spawnLimit > -1) {
|
||||||
if (target instanceof Entity) {
|
if (target instanceof Entity) {
|
||||||
final Entity entity = (Entity) target;
|
final Entity entity = (Entity) target;
|
||||||
|
@ -579,7 +579,6 @@ public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, Str
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts) {
|
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts) {
|
||||||
this.addActiveContexts(contexts, holder, null, claim);
|
|
||||||
this.checkServerContext(contexts);
|
this.checkServerContext(contexts);
|
||||||
ImmutableContextSet contextSet = this.getLPContexts(contexts).immutableCopy();
|
ImmutableContextSet contextSet = this.getLPContexts(contexts).immutableCopy();
|
||||||
return this.getPermissionValue(holder, permission, contextSet);
|
return this.getPermissionValue(holder, permission, contextSet);
|
||||||
@ -692,7 +691,6 @@ public Tristate getPermissionValueWithRequiredContexts(GDClaim claim, GDPermissi
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Tristate getPermissionValue(GDPermissionHolder holder, String permission, Set<Context> contexts) {
|
public Tristate getPermissionValue(GDPermissionHolder holder, String permission, Set<Context> contexts) {
|
||||||
this.addActiveContexts(contexts, holder, null, null);
|
|
||||||
this.checkServerContext(contexts);
|
this.checkServerContext(contexts);
|
||||||
ImmutableContextSet contextSet = this.getLPContexts(contexts).immutableCopy();
|
ImmutableContextSet contextSet = this.getLPContexts(contexts).immutableCopy();
|
||||||
return this.getPermissionValue(holder, permission, contextSet);
|
return this.getPermissionValue(holder, permission, contextSet);
|
||||||
|
@ -284,7 +284,7 @@ public Tristate getFinalPermission(Event event, Location<World> location, Set<Co
|
|||||||
|
|
||||||
if (flag == Flags.ENTITY_SPAWN) {
|
if (flag == Flags.ENTITY_SPAWN) {
|
||||||
// Check spawn limit
|
// Check spawn limit
|
||||||
final int spawnLimit = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Integer.class), GriefDefenderPlugin.DEFAULT_HOLDER, Options.SPAWN_LIMIT, claim, contexts);
|
final int spawnLimit = GDPermissionManager.getInstance().getInternalOptionValue(TypeToken.of(Integer.class), GriefDefenderPlugin.DEFAULT_HOLDER, Options.SPAWN_LIMIT, claim, new HashSet<>(contexts));
|
||||||
if (spawnLimit > -1) {
|
if (spawnLimit > -1) {
|
||||||
if (target instanceof Entity) {
|
if (target instanceof Entity) {
|
||||||
final Entity entity = (Entity) target;
|
final Entity entity = (Entity) target;
|
||||||
|
@ -575,7 +575,6 @@ public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, Str
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts) {
|
public Tristate getPermissionValue(GDClaim claim, GDPermissionHolder holder, String permission, Set<Context> contexts) {
|
||||||
this.addActiveContexts(contexts, holder, null, claim);
|
|
||||||
this.checkServerContext(contexts);
|
this.checkServerContext(contexts);
|
||||||
ImmutableContextSet contextSet = this.getLPContexts(contexts).immutableCopy();
|
ImmutableContextSet contextSet = this.getLPContexts(contexts).immutableCopy();
|
||||||
return this.getPermissionValue(holder, permission, contextSet);
|
return this.getPermissionValue(holder, permission, contextSet);
|
||||||
@ -688,7 +687,6 @@ public Tristate getPermissionValueWithRequiredContexts(GDClaim claim, GDPermissi
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Tristate getPermissionValue(GDPermissionHolder holder, String permission, Set<Context> contexts) {
|
public Tristate getPermissionValue(GDPermissionHolder holder, String permission, Set<Context> contexts) {
|
||||||
this.addActiveContexts(contexts, holder, null, null);
|
|
||||||
this.checkServerContext(contexts);
|
this.checkServerContext(contexts);
|
||||||
ImmutableContextSet contextSet = this.getLPContexts(contexts).immutableCopy();
|
ImmutableContextSet contextSet = this.getLPContexts(contexts).immutableCopy();
|
||||||
return this.getPermissionValue(holder, permission, contextSet);
|
return this.getPermissionValue(holder, permission, contextSet);
|
||||||
|
Loading…
Reference in New Issue
Block a user