Skip to content

Commit 85ab4cf

Browse files
committed
Restore deprecated Inventory alias for backwards compatibility
1 parent 3e79c2d commit 85ab4cf

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,7 @@ target/
8181

8282
# Java Pack
8383
java-pack.manifest.json
84-
redhat-java.vsix
84+
redhat-java.vsix
85+
86+
# Other
87+
.factorypath

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<groupId>com.griefprevention</groupId>
1010
<artifactId>GriefPrevention</artifactId>
11-
<version>17.1.7</version>
11+
<version>17.1.8</version>
1212

1313
<name>GriefPrevention</name>
1414
<description>The official self-service anti-griefing Bukkit plugin for Minecraft servers since 2011.</description>

src/main/java/me/ryanhamshire/GriefPrevention/ClaimPermission.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ public enum ClaimPermission
4343
* ClaimPermission that allows users to grant ClaimPermissions. Uses a separate track from normal
4444
* permissions and does not grant any other permissions.
4545
*/
46-
Manage(Messages.NoPermissionTrust);
46+
Manage(Messages.NoPermissionTrust),
47+
48+
/**
49+
* @deprecated Use {@link #Container} instead. This alias exists for backward compatibility only.
50+
*/
51+
@Deprecated(forRemoval = true)
52+
Inventory(Messages.NoContainersPermission);
4753

4854
private final Messages denialMessage;
4955

@@ -69,8 +75,9 @@ public Messages getDenialMessage()
6975
public boolean isGrantedBy(ClaimPermission other)
7076
{
7177
if (other == Manage || this == Manage) return other == this || other == Edit;
72-
// This uses declaration order to compare! If trust levels are reordered this method must be rewritten.
73-
return other != null && other.ordinal() <= this.ordinal();
78+
ClaimPermission thisNormalized = this == Inventory ? Container : this;
79+
ClaimPermission otherNormalized = other == Inventory ? Container : other;
80+
return otherNormalized != null && otherNormalized.ordinal() <= thisNormalized.ordinal();
7481
}
7582

7683
}

0 commit comments

Comments
 (0)