mirror of
https://github.com/geekfrog/PermissionsTime.git
synced 2024-11-22 07:28:47 +00:00
修复路径BUG 更换统计
This commit is contained in:
parent
6953d1b5dd
commit
b94799dcea
27
pom.xml
27
pom.xml
@ -1,9 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>gg.frog.mc</groupId>
|
<groupId>gg.frog.mc</groupId>
|
||||||
<artifactId>permissionstime</artifactId>
|
<artifactId>permissionstime</artifactId>
|
||||||
<version>0.2.3-SNAPSHOT</version>
|
<version>0.2.4-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>PermissionsTime</name>
|
<name>PermissionsTime</name>
|
||||||
<description>支持跨服的权限限时插件</description>
|
<description>支持跨服的权限限时插件</description>
|
||||||
@ -30,23 +31,22 @@
|
|||||||
<url>http://nexus.hc.to/content/repositories/pub_releases/</url>
|
<url>http://nexus.hc.to/content/repositories/pub_releases/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>Plugin Metrics</id>
|
<id>bstats-repo</id>
|
||||||
<url>http://repo.mcstats.org/content/repositories/public</url>
|
<url>http://repo.bstats.org/content/repositories/releases/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>1.8-R0.1-SNAPSHOT</version>
|
<version>1.9-R0.1-SNAPSHOT</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mcstats.bukkit</groupId>
|
<groupId>org.bstats</groupId>
|
||||||
<artifactId>metrics</artifactId>
|
<artifactId>bstats-bukkit</artifactId>
|
||||||
<version>R8-SNAPSHOT</version>
|
<version>1.2</version>
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.milkbowl.vault</groupId>
|
<groupId>net.milkbowl.vault</groupId>
|
||||||
@ -103,9 +103,16 @@
|
|||||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
<artifactSet>
|
<artifactSet>
|
||||||
<includes>
|
<includes>
|
||||||
<include>org.mcstats.*:*</include>
|
<include>org.bstats:*</include>
|
||||||
</includes>
|
</includes>
|
||||||
</artifactSet>
|
</artifactSet>
|
||||||
|
<relocations>
|
||||||
|
<relocation>
|
||||||
|
<pattern>org.bstats</pattern>
|
||||||
|
<!-- Replace this with your package! -->
|
||||||
|
<shadedPattern>gg.frog.mc.permissionstime</shadedPattern>
|
||||||
|
</relocation>
|
||||||
|
</relocations>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
|
@ -5,6 +5,7 @@ import java.util.Locale;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import org.bstats.bukkit.Metrics;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
@ -41,7 +42,6 @@ public class PluginMain extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
super.onEnable();
|
|
||||||
pm = this;
|
pm = this;
|
||||||
cm = new ConfigManager(pm);
|
cm = new ConfigManager(pm);
|
||||||
getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "==============================="));
|
getServer().getConsoleSender().sendMessage(StrUtil.messageFormat(PluginCfg.PLUGIN_PREFIX + "==============================="));
|
||||||
@ -64,8 +64,8 @@ public class PluginMain extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
if (PluginCfg.IS_METRICS) {
|
if (PluginCfg.IS_METRICS) {
|
||||||
try {
|
try {
|
||||||
org.mcstats.Metrics mcstats = new org.mcstats.Metrics(pm);
|
Metrics metrics = new Metrics(pm);
|
||||||
mcstats.start();
|
// metrics.addCustomChart(new Metrics.SimplePie("chart_id", () -> "My value"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -132,7 +132,6 @@ public class PluginMain extends JavaPlugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
super.onDisable();
|
|
||||||
getServer().getServicesManager().unregisterAll(pm);
|
getServer().getServicesManager().unregisterAll(pm);
|
||||||
Bukkit.getScheduler().cancelTasks(pm);
|
Bukkit.getScheduler().cancelTasks(pm);
|
||||||
try {
|
try {
|
||||||
|
@ -4,6 +4,8 @@ import java.io.File;
|
|||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.jar.JarEntry;
|
import java.util.jar.JarEntry;
|
||||||
import java.util.jar.JarFile;
|
import java.util.jar.JarFile;
|
||||||
@ -12,6 +14,7 @@ public class FileUtil {
|
|||||||
|
|
||||||
public interface FindFilesDo {
|
public interface FindFilesDo {
|
||||||
boolean isProcess(String fileName);
|
boolean isProcess(String fileName);
|
||||||
|
|
||||||
void process(String fileName, InputStream is);
|
void process(String fileName, InputStream is);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -19,6 +22,7 @@ public class FileUtil {
|
|||||||
JarFile jarFile = null;
|
JarFile jarFile = null;
|
||||||
try {
|
try {
|
||||||
String jarFilePath = jarClazz.getProtectionDomain().getCodeSource().getLocation().getFile();
|
String jarFilePath = jarClazz.getProtectionDomain().getCodeSource().getLocation().getFile();
|
||||||
|
jarFilePath = URLDecoder.decode(jarFilePath, Charset.defaultCharset().name());
|
||||||
jarFile = new JarFile(jarFilePath);
|
jarFile = new JarFile(jarFilePath);
|
||||||
Enumeration<JarEntry> entries = jarFile.entries();
|
Enumeration<JarEntry> entries = jarFile.entries();
|
||||||
while (entries.hasMoreElements()) {
|
while (entries.hasMoreElements()) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: PermissionsTime
|
name: PermissionsTime
|
||||||
version: 0.2.3-SNAPSHOT
|
version: 0.2.4-SNAPSHOT
|
||||||
main: gg.frog.mc.permissionstime.PluginMain
|
main: gg.frog.mc.permissionstime.PluginMain
|
||||||
author: GeekFrog
|
author: GeekFrog
|
||||||
softdepend:
|
softdepend:
|
||||||
|
Loading…
Reference in New Issue
Block a user