Skip to content

Commit 1f2f708

Browse files
committed
Add CHEST FactionPermType
1 parent 8e6c7ee commit 1f2f708

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/main/java/io/github/aquerr/eaglefactions/api/entities/FactionPermType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
public enum FactionPermType
44
{
5-
USE, PLACE, DESTROY, CLAIM, ATTACK, INVITE,
5+
USE, PLACE, DESTROY, CLAIM, ATTACK, INVITE, CHEST
66
}

src/main/java/io/github/aquerr/eaglefactions/api/managers/PermsManager.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ public interface PermsManager
6565
*/
6666
boolean canInvite(final UUID playerUUID, final Faction playerFaction);
6767

68+
/**
69+
* Checks if a player with the given UUID has permission for opening faction's chest.
70+
* @param playerUUID the UUID of the player.
71+
* @param playerFaction player's faction.
72+
* @return <tt>true</tt> if player can open faction's chest, <tt>false</tt> if not.
73+
*/
74+
boolean canUseChest(final UUID playerUUID, final Faction playerFaction);
75+
6876
static Map<FactionMemberType, Map<FactionPermType, Boolean>> getDefaultFactionPerms()
6977
{
7078
Map<FactionMemberType, Map<FactionPermType, Boolean>> map = new LinkedHashMap<>();
@@ -80,20 +88,23 @@ static Map<FactionMemberType, Map<FactionPermType, Boolean>> getDefaultFactionPe
8088
officerMap.put(FactionPermType.CLAIM, true);
8189
officerMap.put(FactionPermType.ATTACK, true);
8290
officerMap.put(FactionPermType.INVITE, true);
91+
officerMap.put(FactionPermType.CHEST, true);
8392

8493
membersMap.put(FactionPermType.USE, true);
8594
membersMap.put(FactionPermType.PLACE, true);
8695
membersMap.put(FactionPermType.DESTROY, true);
8796
membersMap.put(FactionPermType.CLAIM, false);
8897
membersMap.put(FactionPermType.ATTACK, false);
8998
membersMap.put(FactionPermType.INVITE, true);
99+
membersMap.put(FactionPermType.CHEST, true);
90100

91101
recruitsMap.put(FactionPermType.USE, true);
92102
recruitsMap.put(FactionPermType.PLACE, true);
93103
recruitsMap.put(FactionPermType.DESTROY, true);
94104
recruitsMap.put(FactionPermType.CLAIM, false);
95105
recruitsMap.put(FactionPermType.ATTACK, false);
96106
recruitsMap.put(FactionPermType.INVITE, false);
107+
recruitsMap.put(FactionPermType.CHEST, false);
97108

98109
truceMap.put(FactionPermType.USE, true);
99110
truceMap.put(FactionPermType.PLACE, false);

0 commit comments

Comments
 (0)