From 9f66d0db278979c03fd3654d6daa6b9464dca05b Mon Sep 17 00:00:00 2001 From: Aurora Lahtela <24460436+AuroraLS3@users.noreply.github.com> Date: Sat, 18 Jun 2022 11:40:19 +0300 Subject: [PATCH] Delete some Deprecated Plan API / implementation parts - ServerKeys - Deprecated PlayerKeys - PlayerDeath --- .../com/djrapitops/plan/api/CommonAPI.java | 4 +- .../plan/api/data/ServerContainer.java | 11 +--- .../domain/container/ServerContainer.java | 26 -------- .../plan/delivery/domain/keys/CommonKeys.java | 21 ++----- .../delivery/domain/keys/PerServerKeys.java | 12 +--- .../plan/delivery/domain/keys/PlayerKeys.java | 5 +- .../plan/delivery/domain/keys/ServerKeys.java | 63 ------------------- .../domain/mutators/PlayersMutator.java | 6 -- .../delivery/domain/mutators/TPSMutator.java | 6 -- .../plan/gathering/domain/PlayerDeath.java | 57 ----------------- 10 files changed, 15 insertions(+), 196 deletions(-) delete mode 100644 Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/container/ServerContainer.java delete mode 100644 Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/ServerKeys.java delete mode 100644 Plan/common/src/main/java/com/djrapitops/plan/gathering/domain/PlayerDeath.java diff --git a/Plan/common/src/main/java/com/djrapitops/plan/api/CommonAPI.java b/Plan/common/src/main/java/com/djrapitops/plan/api/CommonAPI.java index 02ce3ee30..6d8c68a9d 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/api/CommonAPI.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/api/CommonAPI.java @@ -46,7 +46,7 @@ import java.util.stream.Collectors; * @deprecated Plan API v4 has been deprecated, use the APIv5 instead (https://github.com/plan-player-analytics/Plan/wiki/APIv5). */ @Singleton -@Deprecated +@Deprecated(forRemoval = true, since = "5.0") public class CommonAPI implements PlanAPI { private final DBSystem dbSystem; @@ -107,7 +107,7 @@ public class CommonAPI implements PlanAPI { @Override public ServerContainer fetchServerContainer(UUID serverUUID) { - return new ServerContainer(new com.djrapitops.plan.delivery.domain.container.ServerContainer()); + return new ServerContainer(); } @Override diff --git a/Plan/common/src/main/java/com/djrapitops/plan/api/data/ServerContainer.java b/Plan/common/src/main/java/com/djrapitops/plan/api/data/ServerContainer.java index 90f3f92d3..1c93f364f 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/api/data/ServerContainer.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/api/data/ServerContainer.java @@ -24,23 +24,18 @@ import java.util.Optional; * Wrapper for a ServerContainer. *

* The actual object is wrapped to avoid exposing too much API that might change. - * See {@link com.djrapitops.plan.delivery.domain.keys.ServerKeys} for Key objects. *

* The Keys might change in the future, but the Optional API should help dealing with those cases. * * @author AuroraLS3 * @deprecated Plan API v4 has been deprecated, use the APIv5 instead (https://github.com/plan-player-analytics/Plan/wiki/APIv5). */ -@Deprecated +@Deprecated(forRemoval = true, since = "5.0") public class ServerContainer { - private final com.djrapitops.plan.delivery.domain.container.ServerContainer container; - - public ServerContainer(com.djrapitops.plan.delivery.domain.container.ServerContainer container) { - this.container = container; - } + public ServerContainer() {/*Empty constructor, no-op derpecated api class*/} public Optional getValue(Key key) { - return container.getValue(key); + return Optional.empty(); } } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/container/ServerContainer.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/container/ServerContainer.java deleted file mode 100644 index 686f83097..000000000 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/container/ServerContainer.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file is part of Player Analytics (Plan). - * - * Plan is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License v3 as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Plan is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Plan. If not, see . - */ -package com.djrapitops.plan.delivery.domain.container; - -/** - * DataContainer for a single server. - * - * @author AuroraLS3 - * @see com.djrapitops.plan.delivery.domain.keys.ServerKeys For Key objects. - */ -public class ServerContainer extends DynamicDataContainer { -} \ No newline at end of file diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/CommonKeys.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/CommonKeys.java index 47a1a375b..ce2548980 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/CommonKeys.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/CommonKeys.java @@ -16,12 +16,13 @@ */ package com.djrapitops.plan.delivery.domain.keys; -import com.djrapitops.plan.delivery.domain.mutators.PlayersMutator; -import com.djrapitops.plan.delivery.domain.mutators.SessionsMutator; -import com.djrapitops.plan.delivery.domain.mutators.TPSMutator; -import com.djrapitops.plan.gathering.domain.*; +import com.djrapitops.plan.gathering.domain.FinishedSession; +import com.djrapitops.plan.gathering.domain.Ping; +import com.djrapitops.plan.gathering.domain.PlayerKill; +import com.djrapitops.plan.gathering.domain.WorldTimes; -import java.util.*; +import java.util.List; +import java.util.UUID; /** * Class holding Key objects that are commonly used across multiple DataContainers. @@ -44,23 +45,13 @@ public class CommonKeys { public static final Key WORLD_TIMES = new Key<>(WorldTimes.class, "world_times"); public static final PlaceholderKey LAST_SEEN = new PlaceholderKey<>(Long.class, "lastSeen"); - @Deprecated(forRemoval = true, since = "5.0") - public static final Key> PLAYER_DEATHS = new Key<>(new Type<>() {}, "player_deaths"); public static final Key> PLAYER_KILLS = new Key<>(new Type<>() {}, "player_kills"); public static final Key PLAYER_KILL_COUNT = new Key<>(Integer.class, "player_kill_count"); - public static final Key PLAYER_DEATH_COUNT = new Key<>(Integer.class, "player_death_count"); public static final Key MOB_KILL_COUNT = new Key<>(Integer.class, "mob_kill_count"); - public static final Key MOB_DEATH_COUNT = new Key<>(Integer.class, "mob_death_count"); public static final Key DEATH_COUNT = new Key<>(Integer.class, "death_count"); public static final Key BANNED = new Key<>(Boolean.class, "banned"); public static final Key OPERATOR = new Key<>(Boolean.class, "operator"); public static final Key JOIN_ADDRESS = new Key<>(String.class, "join_address"); - public static final Key SESSIONS_MUTATOR = new Key<>(SessionsMutator.class, "SESSIONS_MUTATOR"); - public static final Key TPS_MUTATOR = new Key<>(TPSMutator.class, "TPS_MUTATOR"); - public static final Key PLAYERS_MUTATOR = new Key<>(PlayersMutator.class, "PLAYERS_MUTATOR"); - - public static final Key>>> ACTIVITY_DATA = new Key<>(new Type<>() {}, "ACTIVITY_DATA"); - } \ No newline at end of file diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/PerServerKeys.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/PerServerKeys.java index 7ff77e672..e3c0bd4e4 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/PerServerKeys.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/PerServerKeys.java @@ -17,7 +17,9 @@ package com.djrapitops.plan.delivery.domain.keys; import com.djrapitops.plan.delivery.domain.container.PerServerContainer; -import com.djrapitops.plan.gathering.domain.*; +import com.djrapitops.plan.gathering.domain.FinishedSession; +import com.djrapitops.plan.gathering.domain.Ping; +import com.djrapitops.plan.gathering.domain.WorldTimes; import java.util.List; @@ -40,16 +42,8 @@ public class PerServerKeys { public static final Key> SESSIONS = CommonKeys.SESSIONS; public static final Key WORLD_TIMES = CommonKeys.WORLD_TIMES; - @Deprecated - public static final Key> PLAYER_KILLS = CommonKeys.PLAYER_KILLS; - @Deprecated - public static final Key> PLAYER_DEATHS = CommonKeys.PLAYER_DEATHS; public static final Key PLAYER_KILL_COUNT = CommonKeys.PLAYER_KILL_COUNT; - @Deprecated - public static final Key PLAYER_DEATH_COUNT = CommonKeys.PLAYER_DEATH_COUNT; public static final Key MOB_KILL_COUNT = CommonKeys.MOB_KILL_COUNT; - @Deprecated - public static final Key MOB_DEATH_COUNT = CommonKeys.MOB_DEATH_COUNT; public static final Key DEATH_COUNT = CommonKeys.DEATH_COUNT; public static final Key LAST_SEEN = CommonKeys.LAST_SEEN; diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/PlayerKeys.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/PlayerKeys.java index a23899f86..62ea425eb 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/PlayerKeys.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/PlayerKeys.java @@ -51,10 +51,7 @@ public class PlayerKeys { public static final Key WORLD_TIMES = CommonKeys.WORLD_TIMES; public static final Key> PLAYER_KILLS = CommonKeys.PLAYER_KILLS; - public static final Key> PLAYER_DEATHS_KILLS = new Key<>(new Type<>() { - }, "player_deaths_kills"); - @Deprecated(forRemoval = true, since = "5.0") - public static final Key> PLAYER_DEATHS = CommonKeys.PLAYER_DEATHS; + public static final Key> PLAYER_DEATHS_KILLS = new Key<>(new Type<>() {}, "player_deaths_kills"); public static final Key PLAYER_KILL_COUNT = CommonKeys.PLAYER_KILL_COUNT; public static final Key MOB_KILL_COUNT = CommonKeys.MOB_KILL_COUNT; public static final Key DEATH_COUNT = CommonKeys.DEATH_COUNT; diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/ServerKeys.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/ServerKeys.java deleted file mode 100644 index 5c068fb05..000000000 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/keys/ServerKeys.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of Player Analytics (Plan). - * - * Plan is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License v3 as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Plan is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Plan. If not, see . - */ -package com.djrapitops.plan.delivery.domain.keys; - -import com.djrapitops.plan.delivery.domain.DateObj; -import com.djrapitops.plan.delivery.domain.container.PlayerContainer; -import com.djrapitops.plan.delivery.domain.container.ServerContainer; -import com.djrapitops.plan.extension.implementation.results.ExtensionData; -import com.djrapitops.plan.gathering.domain.*; - -import java.util.List; -import java.util.Map; -import java.util.UUID; - -/** - * Keys for the ServerContainer. - * - * @author AuroraLS3 - * @see ServerContainer For DataContainer. - */ -public class ServerKeys { - - private ServerKeys() { - /* Static variable class */ - } - - public static final Key SERVER_UUID = CommonKeys.SERVER_UUID; - public static final Key NAME = CommonKeys.NAME; - - public static final Key> PLAYERS = new Key<>(new Type<>() {}, "players"); - public static final Key> OPERATORS = new Key<>(new Type<>() {}, "operators"); - public static final Key PLAYER_COUNT = new Key<>(Integer.class, "player_count"); - - public static final Key> SESSIONS = CommonKeys.SESSIONS; - public static final Key> PING = CommonKeys.PING; - public static final Key WORLD_TIMES = CommonKeys.WORLD_TIMES; - - public static final Key> PLAYER_KILLS = CommonKeys.PLAYER_KILLS; - public static final Key PLAYER_KILL_COUNT = CommonKeys.PLAYER_KILL_COUNT; - public static final Key MOB_KILL_COUNT = CommonKeys.MOB_KILL_COUNT; - public static final Key DEATH_COUNT = CommonKeys.DEATH_COUNT; - - public static final Key> TPS = new Key<>(new Type<>() {}, "tps"); - public static final Key> ALL_TIME_PEAK_PLAYERS = new Key<>(new Type<>() {}, "all_time_peak_players"); - public static final Key> RECENT_PEAK_PLAYERS = new Key<>(new Type<>() {}, "recent_peak_players"); - @Deprecated - public static final Key> COMMAND_USAGE = new Key<>(new Type<>() {}, "command_usage"); - public static final Key> EXTENSION_DATA = new Key<>(new Type<>() {}, "extension_data"); -} \ No newline at end of file diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/mutators/PlayersMutator.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/mutators/PlayersMutator.java index 19a5f5b22..3a8cc1e51 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/mutators/PlayersMutator.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/mutators/PlayersMutator.java @@ -17,10 +17,8 @@ package com.djrapitops.plan.delivery.domain.mutators; import com.djrapitops.plan.delivery.domain.DateObj; -import com.djrapitops.plan.delivery.domain.container.DataContainer; import com.djrapitops.plan.delivery.domain.container.PlayerContainer; import com.djrapitops.plan.delivery.domain.keys.PlayerKeys; -import com.djrapitops.plan.delivery.domain.keys.ServerKeys; import com.djrapitops.plan.gathering.domain.FinishedSession; import com.djrapitops.plan.gathering.domain.GeoInfo; import com.djrapitops.plan.gathering.domain.Ping; @@ -51,10 +49,6 @@ public class PlayersMutator { return new PlayersMutator(new ArrayList<>(mutator.players)); } - public static PlayersMutator forContainer(DataContainer container) { - return new PlayersMutator(container.getValue(ServerKeys.PLAYERS).orElse(new ArrayList<>())); - } - public > PlayersMutator filterBy(T by) { return new PlayersMutator(Lists.filter(players, by)); } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/mutators/TPSMutator.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/mutators/TPSMutator.java index c362877c0..3b153178f 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/mutators/TPSMutator.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/domain/mutators/TPSMutator.java @@ -16,8 +16,6 @@ */ package com.djrapitops.plan.delivery.domain.mutators; -import com.djrapitops.plan.delivery.domain.container.DataContainer; -import com.djrapitops.plan.delivery.domain.keys.ServerKeys; import com.djrapitops.plan.delivery.rendering.json.graphs.line.LineGraph; import com.djrapitops.plan.delivery.rendering.json.graphs.line.Point; import com.djrapitops.plan.gathering.domain.TPS; @@ -47,10 +45,6 @@ public class TPSMutator { this.tpsData = tpsData; } - public static TPSMutator forContainer(DataContainer container) { - return new TPSMutator(container.getValue(ServerKeys.TPS).orElse(new ArrayList<>())); - } - public static TPSMutator copyOf(TPSMutator mutator) { return new TPSMutator(new ArrayList<>(mutator.tpsData)); } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/gathering/domain/PlayerDeath.java b/Plan/common/src/main/java/com/djrapitops/plan/gathering/domain/PlayerDeath.java deleted file mode 100644 index 33102528d..000000000 --- a/Plan/common/src/main/java/com/djrapitops/plan/gathering/domain/PlayerDeath.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of Player Analytics (Plan). - * - * Plan is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License v3 as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Plan is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Plan. If not, see . - */ -package com.djrapitops.plan.gathering.domain; - -import com.djrapitops.plan.delivery.domain.DateHolder; - -import java.util.UUID; - -/** - * @deprecated Use {@link PlayerKill} instead. - */ -@Deprecated -public class PlayerDeath implements DateHolder { - - private final UUID killer; - private final String killerName; - private final long date; - private final String weapon; - - public PlayerDeath(UUID killer, String killerName, String weapon, long date) { - this.killer = killer; - this.killerName = killerName; - this.date = date; - this.weapon = weapon; - } - - public UUID getKiller() { - return killer; - } - - public String getKillerName() { - return killerName; - } - - @Override - public long getDate() { - return date; - } - - public String getWeapon() { - return weapon; - } -}