mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-27 18:41:40 +01:00
Fixed #572 GP Data erasure (Removed calls & Added delays)
Addresses https://github.com/TechFortress/GriefPrevention/issues/279
This commit is contained in:
parent
efb3c6ef86
commit
ecd56a1bf7
@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.djrapitops</groupId>
|
<groupId>com.djrapitops</groupId>
|
||||||
<artifactId>Plan</artifactId>
|
<artifactId>Plan</artifactId>
|
||||||
<version>4.2.0-SNAPSHOT</version>
|
<version>4.3.0-SNAPSHOT</version>
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
|
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
|
||||||
<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
|
<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
|
||||||
@ -174,11 +174,11 @@
|
|||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>asm</artifactId>
|
<artifactId>asm</artifactId>
|
||||||
<groupId>org.ow2.asm</groupId>
|
<groupId>org.ow2.asm</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>asm-commons</artifactId>
|
<artifactId>asm-commons</artifactId>
|
||||||
<groupId>org.ow2.asm</groupId>
|
<groupId>org.ow2.asm</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
@ -325,10 +325,10 @@
|
|||||||
<artifactId>jsr305</artifactId>
|
<artifactId>jsr305</artifactId>
|
||||||
<groupId>com.google.code.findbugs</groupId>
|
<groupId>com.google.code.findbugs</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>asm</artifactId>
|
<artifactId>asm</artifactId>
|
||||||
<groupId>org.ow2.asm</groupId>
|
<groupId>org.ow2.asm</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.djrapitops</groupId>
|
<groupId>com.djrapitops</groupId>
|
||||||
<artifactId>Plan</artifactId>
|
<artifactId>Plan</artifactId>
|
||||||
<version>4.2.0-SNAPSHOT</version>
|
<version>4.3.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
@ -35,7 +35,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.djrapitops</groupId>
|
<groupId>com.djrapitops</groupId>
|
||||||
<artifactId>PlanPluginBridge</artifactId>
|
<artifactId>PlanPluginBridge</artifactId>
|
||||||
<version>4.2.0-SNAPSHOT</version>
|
<version>4.3.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Paper API -->
|
<!-- Paper API -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -2,6 +2,9 @@ package com.djrapitops.plan.system.processing.processors.info;
|
|||||||
|
|
||||||
import com.djrapitops.plan.system.info.InfoSystem;
|
import com.djrapitops.plan.system.info.InfoSystem;
|
||||||
import com.djrapitops.plan.system.info.connection.WebExceptionLogger;
|
import com.djrapitops.plan.system.info.connection.WebExceptionLogger;
|
||||||
|
import com.djrapitops.plugin.api.TimeAmount;
|
||||||
|
import com.djrapitops.plugin.task.AbsRunnable;
|
||||||
|
import com.djrapitops.plugin.task.RunnableFactory;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@ -15,8 +18,17 @@ public class PlayerPageUpdateProcessor implements Runnable {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
WebExceptionLogger.logIfOccurs(this.getClass(),
|
RunnableFactory.createNew("Generate Inspect page: " + uuid, new AbsRunnable() {
|
||||||
() -> InfoSystem.getInstance().generateAndCachePlayerPage(uuid)
|
@Override
|
||||||
);
|
public void run() {
|
||||||
|
try {
|
||||||
|
WebExceptionLogger.logIfOccurs(PlayerPageUpdateProcessor.class,
|
||||||
|
() -> InfoSystem.getInstance().generateAndCachePlayerPage(uuid)
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).runTaskLaterAsynchronously(TimeAmount.SECOND.ticks() * 20);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.djrapitops</groupId>
|
<groupId>com.djrapitops</groupId>
|
||||||
<artifactId>PlanPluginBridge</artifactId>
|
<artifactId>PlanPluginBridge</artifactId>
|
||||||
<version>4.2.0-SNAPSHOT</version>
|
<version>4.3.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>${project.groupId}:${project.artifactId}</name>
|
<name>${project.groupId}:${project.artifactId}</name>
|
||||||
@ -75,7 +75,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.djrapitops</groupId>
|
<groupId>com.djrapitops</groupId>
|
||||||
<artifactId>Plan</artifactId>
|
<artifactId>Plan</artifactId>
|
||||||
<version>4.2.0-SNAPSHOT</version>
|
<version>4.3.0-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Paper API -->
|
<!-- Paper API -->
|
||||||
|
@ -13,7 +13,6 @@ import com.djrapitops.plan.utilities.analysis.MathUtils;
|
|||||||
import com.djrapitops.plugin.utilities.FormatUtils;
|
import com.djrapitops.plugin.utilities.FormatUtils;
|
||||||
import me.ryanhamshire.GriefPrevention.Claim;
|
import me.ryanhamshire.GriefPrevention.Claim;
|
||||||
import me.ryanhamshire.GriefPrevention.DataStore;
|
import me.ryanhamshire.GriefPrevention.DataStore;
|
||||||
import me.ryanhamshire.GriefPrevention.PlayerData;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -43,15 +42,12 @@ public class GriefPreventionData extends PluginData {
|
|||||||
claim -> FormatUtils.formatLocation(claim.getGreaterBoundaryCorner()),
|
claim -> FormatUtils.formatLocation(claim.getGreaterBoundaryCorner()),
|
||||||
Claim::getArea)
|
Claim::getArea)
|
||||||
);
|
);
|
||||||
PlayerData data = dataStore.getPlayerData(uuid);
|
|
||||||
int blocks = data.getAccruedClaimBlocks() + data.getBonusClaimBlocks() + dataStore.getGroupBonusBlocks(uuid);
|
|
||||||
String softMuted = dataStore.isSoftMuted(uuid) ? "Yes" : "No";
|
String softMuted = dataStore.isSoftMuted(uuid) ? "Yes" : "No";
|
||||||
long totalArea = MathUtils.sumLong(claims.values().stream().map(i -> (long) i));
|
long totalArea = MathUtils.sumLong(claims.values().stream().map(i -> (long) i));
|
||||||
|
|
||||||
inspectContainer.addValue(getWithIcon("SoftMuted", "bell-slash-o", "deep-orange"), softMuted);
|
inspectContainer.addValue(getWithIcon("SoftMuted", "bell-slash-o", "deep-orange"), softMuted);
|
||||||
inspectContainer.addValue(getWithIcon("Claims", "map-marker", "blue-grey"), claims.size());
|
inspectContainer.addValue(getWithIcon("Claims", "map-marker", "blue-grey"), claims.size());
|
||||||
inspectContainer.addValue(getWithIcon("Claimed Area", "map-o", "light-green"), totalArea);
|
inspectContainer.addValue(getWithIcon("Claimed Area", "map-o", "light-green"), totalArea);
|
||||||
inspectContainer.addValue(getWithIcon("Claim Blocks Available", "map-o", "light-green"), blocks);
|
|
||||||
|
|
||||||
TableContainer claimsTable = new TableContainer(getWithIcon("Claim", "map-marker"), getWithIcon("Area", "map-o"));
|
TableContainer claimsTable = new TableContainer(getWithIcon("Claim", "map-marker"), getWithIcon("Area", "map-o"));
|
||||||
claimsTable.setColor("blue-grey");
|
claimsTable.setColor("blue-grey");
|
||||||
|
@ -13,7 +13,6 @@ import com.djrapitops.plan.utilities.analysis.MathUtils;
|
|||||||
import com.djrapitops.plugin.utilities.FormatUtils;
|
import com.djrapitops.plugin.utilities.FormatUtils;
|
||||||
import net.kaikk.mc.gpp.Claim;
|
import net.kaikk.mc.gpp.Claim;
|
||||||
import net.kaikk.mc.gpp.DataStore;
|
import net.kaikk.mc.gpp.DataStore;
|
||||||
import net.kaikk.mc.gpp.PlayerData;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -43,13 +42,10 @@ public class GriefPreventionPlusData extends PluginData {
|
|||||||
claim -> FormatUtils.formatLocation(claim.getGreaterBoundaryCorner()),
|
claim -> FormatUtils.formatLocation(claim.getGreaterBoundaryCorner()),
|
||||||
Claim::getArea)
|
Claim::getArea)
|
||||||
);
|
);
|
||||||
PlayerData data = dataStore.getPlayerData(uuid);
|
|
||||||
int blocks = data.getAccruedClaimBlocks() + data.getBonusClaimBlocks();
|
|
||||||
long totalArea = MathUtils.sumLong(claims.values().stream().map(i -> (long) i));
|
long totalArea = MathUtils.sumLong(claims.values().stream().map(i -> (long) i));
|
||||||
|
|
||||||
inspectContainer.addValue(getWithIcon("Claims", "map-marker", "blue-grey"), claims.size());
|
inspectContainer.addValue(getWithIcon("Claims", "map-marker", "blue-grey"), claims.size());
|
||||||
inspectContainer.addValue(getWithIcon("Claimed Area", "map-o", "light-green"), totalArea);
|
inspectContainer.addValue(getWithIcon("Claimed Area", "map-o", "light-green"), totalArea);
|
||||||
inspectContainer.addValue(getWithIcon("Claim Blocks Available", "map-o", "light-green"), blocks);
|
|
||||||
|
|
||||||
TableContainer claimsTable = new TableContainer(getWithIcon("Claim", "map-marker"), getWithIcon("Area", "map-o"));
|
TableContainer claimsTable = new TableContainer(getWithIcon("Claim", "map-marker"), getWithIcon("Area", "map-o"));
|
||||||
claimsTable.setColor("blue-grey");
|
claimsTable.setColor("blue-grey");
|
||||||
|
Loading…
Reference in New Issue
Block a user