Skip to content

Commit 961540b

Browse files
committed
Remove a ton of dead code
1 parent d81f835 commit 961540b

File tree

13 files changed

+22
-505
lines changed

13 files changed

+22
-505
lines changed

API/src/main/java/me/innectic/permissify/api/database/DatabaseHandler.java

Lines changed: 15 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import lombok.Getter;
2828
import me.innectic.permissify.api.group.Permission;
2929
import me.innectic.permissify.api.group.group.PermissionGroup;
30-
import me.innectic.permissify.api.group.ladder.AbstractLadder;
3130
import me.innectic.permissify.api.profile.PermissifyProfile;
3231

3332
import java.util.*;
@@ -43,12 +42,8 @@ public abstract class DatabaseHandler {
4342
@Getter protected Map<UUID, List<Permission>> cachedPermissions = new HashMap<>();
4443
@Getter protected Map<String, PermissionGroup> cachedGroups = new HashMap<>();
4544
@Getter protected Optional<PermissionGroup> defaultGroup = Optional.empty();
46-
@Getter protected Map<String, AbstractLadder> cachedLadders = new HashMap<>();
4745
@Getter protected final Optional<ConnectionInformation> connectionInformation;
4846
@Getter protected List<UUID> superAdmins = new ArrayList<>();
49-
// Revisit: Maybe different default formatters?
50-
protected String chatFormat = "{group} {username}: {message}";
51-
protected String whisperFormat = "{senderGroup} {username} > {receiverGroup} {to}: {message}";
5247

5348
public DatabaseHandler(ConnectionInformation connectionInformation) {
5449
this.connectionInformation = Optional.ofNullable(connectionInformation);
@@ -78,11 +73,6 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
7873
*/
7974
protected abstract void loadGroups();
8075

81-
/**
82-
* Load all ladders
83-
*/
84-
protected abstract void loadLadders();
85-
8676
/**
8777
* Load all super admins
8878
*/
@@ -121,7 +111,7 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
121111
*
122112
* @param uuid the uuid of the player to check
123113
* @param permission the permission to check
124-
* @return if the player has the permission, regardless of the granted status
114+
* @return if the player has the permission, regardless of the granted status
125115
*/
126116
public abstract boolean hasPermission(UUID uuid, String permission);
127117

@@ -130,15 +120,15 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
130120
*
131121
* @param uuid the uuid of the player to check
132122
* @param permission the permission to check for
133-
* @return if the player has the permission
123+
* @return if the player has the permission
134124
*/
135125
public abstract boolean isGrantedPermission(UUID uuid, String permission);
136126

137127
/**
138128
* Get the permissions of a uuid
139129
*
140130
* @param uuid the uuid to get the permissions of
141-
* @return the permissions the uuid has
131+
* @return the permissions the uuid has
142132
*/
143133
public abstract List<Permission> getPermissions(UUID uuid);
144134

@@ -150,7 +140,7 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
150140
* @param prefix the prefix of the name
151141
* @param suffix the suffix of the name
152142
* @param chatColor the color of the chat message
153-
* @return if the group was created
143+
* @return if the group was created
154144
*/
155145
public abstract boolean createGroup(String name, String displayName, String prefix, String suffix, String chatColor);
156146

@@ -165,7 +155,7 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
165155
* Get the permission group from name.
166156
*
167157
* @param name the name of the group.
168-
* @return fulfilled if exists, empty otherwise
158+
* @return fulfilled if exists, empty otherwise
169159
*/
170160
public abstract Optional<PermissionGroup> getGroup(String name);
171161

@@ -174,7 +164,7 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
174164
*
175165
* @param uuid the uuid of the player
176166
* @param group the group to add them to
177-
* @return if they were added
167+
* @return if they were added
178168
*/
179169
public abstract boolean addPlayerToGroup(UUID uuid, PermissionGroup group);
180170

@@ -183,7 +173,7 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
183173
*
184174
* @param uuid the player to remove
185175
* @param group the group to remove from
186-
* @return if the player was removed
176+
* @return if the player was removed
187177
*/
188178
public abstract boolean removePlayerFromGroup(UUID uuid, PermissionGroup group);
189179

@@ -198,7 +188,7 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
198188
* Get all permission groups a player is in.
199189
*
200190
* @param uuid the uuid of the player
201-
* @return the groups the player is in
191+
* @return the groups the player is in
202192
*/
203193
public abstract List<PermissionGroup> getGroups(UUID uuid);
204194

@@ -214,7 +204,7 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
214204
* Get the primary group of a player.
215205
*
216206
* @param uuid the uuid of the player to get
217-
* @return the primary group of the player
207+
* @return the primary group of the player
218208
*/
219209
public abstract Optional<PermissionGroup> getPrimaryGroup(UUID uuid);
220210

@@ -230,7 +220,7 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
230220
*
231221
* @param group the group to add to
232222
* @param permissions the permissions to add
233-
* @return if it was added or not
223+
* @return if it was added or not
234224
*/
235225
public abstract boolean addGroupPermission(String group, String... permissions);
236226

@@ -239,7 +229,7 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
239229
*
240230
* @param group the group to remove from
241231
* @param permissions the permissions to remove
242-
* @return if the permissions were removed
232+
* @return if the permissions were removed
243233
*/
244234
public abstract boolean removeGroupPermission(String group, String... permissions);
245235

@@ -248,7 +238,7 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
248238
*
249239
* @param group the group to check
250240
* @param permission the permission to check
251-
* @return if the group has the permission
241+
* @return if the group has the permission
252242
*/
253243
public abstract boolean hasGroupPermission(String group, String permission);
254244

@@ -274,55 +264,9 @@ public DatabaseHandler(ConnectionInformation connectionInformation) {
274264
public abstract void removeSuperAdmin(UUID uuid);
275265

276266
/**
277-
* Set the format for chat messages
278-
*
279-
* @param format the format for chat.
280-
*/
281-
public abstract void setChatFormat(String format);
282-
283-
/**
284-
* Get the format for public chat messages
267+
* Set the default group players are in when they join for the first time
285268
*
286-
* @param skipCache should the cache be skipped? Forces getting from the database
287-
* @return the format
288-
*/
289-
public abstract String getChatFormat(boolean skipCache);
290-
291-
/**
292-
* Set the format of whispers
293-
*
294-
* @param format the format for whispers.
295-
*/
296-
public abstract void setWhisperFormat(String format);
297-
298-
/**
299-
* Get the format for whispers.
300-
*
301-
* @param skipCache should the cache be skipped? Forces getting from the database
302-
* @return the format
303-
*/
304-
public abstract String getWhisperFormat(boolean skipCache);
305-
306-
/**
307-
* Set the default permission group to the one provided.
308-
*
309-
* @param group the new group to become the default.
269+
* @param group the default group
310270
*/
311271
public abstract void setDefaultGroup(PermissionGroup group);
312-
313-
/**
314-
* Set the ladder of a group.
315-
*
316-
* @param group the name of the group
317-
* @param ladder the ladder to add to the group
318-
*/
319-
public abstract void setGroupLadder(String group, AbstractLadder ladder);
320-
321-
/**
322-
* Get the current ladder of a group.
323-
*
324-
* @param group the name of the group to get the ladder from
325-
* @return the ladder, if present.
326-
*/
327-
public abstract Optional<AbstractLadder> getGroupLadder(String group);
328-
}
272+
}

0 commit comments

Comments
 (0)