Added bStats

This commit is contained in:
Matthew Miller 2018-09-20 22:59:42 +10:00
parent 568643d08a
commit 02c6f11bb9
5 changed files with 63 additions and 40 deletions

View File

@ -38,6 +38,7 @@
<subpackage name="bukkit"> <subpackage name="bukkit">
<allow pkg="org.bukkit"/> <allow pkg="org.bukkit"/>
<allow pkg="org.bstats.bukkit"/>
<allow pkg="net.minecraft.server"/> <allow pkg="net.minecraft.server"/>
</subpackage> </subpackage>
@ -58,6 +59,7 @@
<allow pkg="com.flowpowered.math" /> <allow pkg="com.flowpowered.math" />
<allow pkg="org.spongepowered.api" /> <allow pkg="org.spongepowered.api" />
<allow pkg="org.slf4j" /> <allow pkg="org.slf4j" />
<allow pkg="org.bstats.sponge"/>
<allow pkg="ninja.leaping.configurate" /> <allow pkg="ninja.leaping.configurate" />
</subpackage> </subpackage>
</subpackage> </subpackage>

View File

@ -1,40 +1,45 @@
apply plugin: 'eclipse' apply plugin: 'eclipse'
apply plugin: 'idea' apply plugin: 'idea'
apply plugin: 'maven' apply plugin: 'maven'
repositories { repositories {
maven { url "https://hub.spigotmc.org/nexus/content/groups/public" } maven { url "https://hub.spigotmc.org/nexus/content/groups/public" }
} maven { url "http://repo.bstats.org/content/repositories/releases/" }
}
dependencies {
compile project(':worldedit-core') dependencies {
compile 'com.sk89q:dummypermscompat:1.8' compile project(':worldedit-core')
compile 'org.bukkit:bukkit:1.13-R0.1-SNAPSHOT' // zzz compile 'com.sk89q:dummypermscompat:1.8'
testCompile 'org.mockito:mockito-core:1.9.0-rc1' compile 'org.bukkit:bukkit:1.13-R0.1-SNAPSHOT' // zzz
} compile 'org.bstats:bstats-bukkit:1.2'
testCompile 'org.mockito:mockito-core:1.9.0-rc1'
processResources { }
from (sourceSets.main.resources.srcDirs) {
expand 'internalVersion': project.internalVersion processResources {
include 'plugin.yml' from (sourceSets.main.resources.srcDirs) {
} expand 'internalVersion': project.internalVersion
include 'plugin.yml'
from (sourceSets.main.resources.srcDirs) { }
exclude 'plugin.yml'
} from (sourceSets.main.resources.srcDirs) {
} exclude 'plugin.yml'
}
jar { }
manifest {
attributes("Class-Path": "truezip.jar WorldEdit/truezip.jar js.jar WorldEdit/js.jar", jar {
"WorldEdit-Version": version) manifest {
} attributes("Class-Path": "truezip.jar WorldEdit/truezip.jar js.jar WorldEdit/js.jar",
} "WorldEdit-Version": version)
}
shadowJar { }
dependencies {
include(dependency(':worldedit-core')) shadowJar {
} dependencies {
} include(dependency(':worldedit-core'))
relocate ("org.bstats", "com.sk89q.worldedit.bukkit.bstats") {
build.dependsOn(shadowJar) include(dependency("org.bstats:bstats-bukkit:1.2"))
}
}
}
build.dependsOn(shadowJar)

View File

@ -37,6 +37,7 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Capability; import com.sk89q.worldedit.extension.platform.Capability;
import com.sk89q.worldedit.extension.platform.Platform; import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.extent.inventory.BlockBag; import com.sk89q.worldedit.extent.inventory.BlockBag;
import org.bstats.bukkit.Metrics;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter; import org.bukkit.command.TabCompleter;
@ -102,6 +103,9 @@ public class WorldEditPlugin extends JavaPlugin implements TabCompleter {
// Forge WorldEdit and there's (probably) not going to be any other // Forge WorldEdit and there's (probably) not going to be any other
// platforms to be worried about... at the current time of writing // platforms to be worried about... at the current time of writing
WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent()); WorldEdit.getInstance().getEventBus().post(new PlatformReadyEvent());
// Enable metrics
new Metrics(this);
} }
private void loadConfig() { private void loadConfig() {

View File

@ -12,9 +12,14 @@ plugins {
id 'org.spongepowered.plugin' version '0.8.1' id 'org.spongepowered.plugin' version '0.8.1'
} }
repositories {
maven { url "http://repo.bstats.org/content/repositories/releases/" }
}
dependencies { dependencies {
compile project(':worldedit-core') compile project(':worldedit-core')
compile 'org.spongepowered:spongeapi:7.0.0-SNAPSHOT' compile 'org.spongepowered:spongeapi:7.0.0-SNAPSHOT'
compile 'org.bstats:bstats-sponge:1.2'
testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1' testCompile group: 'org.mockito', name: 'mockito-core', version:'1.9.0-rc1'
} }
@ -37,6 +42,9 @@ jar {
shadowJar { shadowJar {
dependencies { dependencies {
include(dependency(':worldedit-core')) include(dependency(':worldedit-core'))
relocate ("org.bstats", "com.sk89q.worldedit.sponge.bstats") {
include(dependency("org.bstats:bstats-sponge:1.2"))
}
} }
} }

View File

@ -34,6 +34,7 @@ import com.sk89q.worldedit.sponge.adapter.SpongeImplAdapter;
import com.sk89q.worldedit.sponge.adapter.SpongeImplLoader; import com.sk89q.worldedit.sponge.adapter.SpongeImplLoader;
import com.sk89q.worldedit.sponge.config.SpongeConfiguration; import com.sk89q.worldedit.sponge.config.SpongeConfiguration;
import com.sk89q.worldedit.world.item.ItemTypes; import com.sk89q.worldedit.world.item.ItemTypes;
import org.bstats.sponge.Metrics;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.spongepowered.api.Sponge; import org.spongepowered.api.Sponge;
import org.spongepowered.api.block.BlockSnapshot; import org.spongepowered.api.block.BlockSnapshot;
@ -75,6 +76,9 @@ public class SpongeWorldEdit {
@Inject @Inject
private Logger logger; private Logger logger;
@Inject
private Metrics metrics;
public static final String MOD_ID = "worldedit"; public static final String MOD_ID = "worldedit";
private SpongePermissionsProvider provider; private SpongePermissionsProvider provider;