Removed PluginData functionality reliant on PlayerProfile OfflinePlayer

This commit is contained in:
Rsl1122 2018-04-02 18:37:16 +03:00
parent 28192ee5d5
commit 1f84cd556b
3 changed files with 13 additions and 11 deletions

View File

@ -40,7 +40,9 @@ public class KingdomAccordionCreator {
List<UUID> members = kingdom.getMembersList();
int residentsNum = members.size();
List<PlayerProfile> memberProfiles = players.stream().filter(p -> members.contains(p.getUniqueId())).collect(Collectors.toList());
List<PlayerProfile> memberProfiles = players.stream()
.filter(p -> members.contains(p.getUniqueId()))
.collect(Collectors.toList());
List<Session> sessions = memberProfiles.stream()
.map(PlayerProfile::getSessions)

View File

@ -4,7 +4,6 @@
*/
package com.djrapitops.pluginbridge.plan.vault;
import com.djrapitops.plan.data.PlayerProfile;
import com.djrapitops.plan.data.ServerProfile;
import com.djrapitops.plan.data.element.AnalysisContainer;
import com.djrapitops.plan.data.element.InspectContainer;
@ -53,17 +52,18 @@ public class VaultEcoData extends PluginData {
public AnalysisContainer getServerData(Collection<UUID> collection, AnalysisContainer analysisContainer) {
ServerProfile serverProfile = Analysis.getServerProfile();
List<PlayerProfile> profiles = collection.stream()
List<FakeOfflinePlayer> profiles = collection.stream()
.map(serverProfile::getPlayer)
.filter(Verify::notNull)
.map(profile -> new FakeOfflinePlayer(profile.getUuid(), profile.getName()))
.collect(Collectors.toList());
Map<UUID, String> balances = new HashMap<>();
double totalBalance = 0.0;
for (PlayerProfile profile : profiles) {
double bal = econ.getBalance(profile);
for (FakeOfflinePlayer p : profiles) {
double bal = econ.getBalance(p);
totalBalance += bal;
balances.put(profile.getUuid(), econ.format(bal));
balances.put(p.getUniqueId(), econ.format(bal));
}
analysisContainer.addValue(getWithIcon("Server Balance", "money", "green"), FormatUtils.cutDecimals(totalBalance));
analysisContainer.addPlayerTableValues(getWithIcon("Balance", "money"), balances);

View File

@ -4,7 +4,6 @@
*/
package com.djrapitops.pluginbridge.plan.vault;
import com.djrapitops.plan.data.PlayerProfile;
import com.djrapitops.plan.data.ServerProfile;
import com.djrapitops.plan.data.element.AnalysisContainer;
import com.djrapitops.plan.data.element.InspectContainer;
@ -53,15 +52,16 @@ public class VaultPermData extends PluginData {
public AnalysisContainer getServerData(Collection<UUID> collection, AnalysisContainer analysisContainer) {
ServerProfile serverProfile = Analysis.getServerProfile();
List<PlayerProfile> profiles = collection.stream()
List<FakeOfflinePlayer> profiles = collection.stream()
.map(serverProfile::getPlayer)
.filter(Verify::notNull)
.map(profile -> new FakeOfflinePlayer(profile.getUuid(), profile.getName()))
.collect(Collectors.toList());
Map<UUID, String> groups = new HashMap<>();
for (PlayerProfile profile : profiles) {
String group = StringUtils.capitalize(permSys.getPrimaryGroup(null, profile));
groups.put(profile.getUuid(), group);
for (FakeOfflinePlayer p : profiles) {
String group = StringUtils.capitalize(permSys.getPrimaryGroup(null, p));
groups.put(p.getUniqueId(), group);
}
analysisContainer.addPlayerTableValues(getWithIcon("Balance", "money"), groups);