Skip to content

Commit 29d6522

Browse files
Bstats Integration
1 parent 77314f2 commit 29d6522

File tree

4 files changed

+53
-9
lines changed

4 files changed

+53
-9
lines changed

pom.xml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>me.ShakeforProtein</groupId>
88
<artifactId>TreeboTimed</artifactId>
9-
<version>0.1.1</version>
9+
<version>0.1.2</version>
1010
<packaging>jar</packaging>
1111

1212
<name>TreeboTimed</name>
@@ -43,6 +43,29 @@
4343
</execution>
4444
</executions>
4545
</plugin>
46+
<plugin>
47+
<groupId>org.apache.maven.plugins</groupId>
48+
<artifactId>maven-shade-plugin</artifactId>
49+
<version>3.1.0</version>
50+
<!-- Do not include the <configuration>...</configuration> part if you are using Sponge! -->
51+
<configuration>
52+
<relocations>
53+
<relocation>
54+
<pattern>org.bstats</pattern>
55+
<!-- Replace this with your package! -->
56+
<shadedPattern>me.shakeforprotein.treebotimed</shadedPattern>
57+
</relocation>
58+
</relocations>
59+
</configuration>
60+
<executions>
61+
<execution>
62+
<phase>package</phase>
63+
<goals>
64+
<goal>shade</goal>
65+
</goals>
66+
</execution>
67+
</executions>
68+
</plugin>
4669
</plugins>
4770
<resources>
4871
<resource>
@@ -65,7 +88,10 @@
6588
<id>enginehub-maven</id>
6689
<url>http://maven.enginehub.org/repo/</url>
6790
</repository>
68-
91+
<repository>
92+
<id>CodeMC</id>
93+
<url>https://repo.codemc.org/repository/maven-public</url>
94+
</repository>
6995
</repositories>
7096

7197
<dependencies>
@@ -86,5 +112,13 @@
86112
<artifactId>worldedit-bukkit</artifactId>
87113
<version>7.0.0-SNAPSHOT</version>
88114
</dependency>
115+
<dependency>
116+
<groupId>org.bstats</groupId>
117+
<artifactId>bstats-bukkit</artifactId>
118+
<version>1.5</version>
119+
<scope>compile</scope>
120+
</dependency>
89121
</dependencies>
90122
</project>
123+
124+

src/main/java/me/shakeforprotein/treebotimed/TreeboTimed.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.sk89q.worldedit.WorldEdit;
44
import me.shakeforprotein.treebotimed.Commands.*;
55
import me.shakeforprotein.treebotimed.Listeners.PlaceSchem;
6+
import org.bstats.bukkit.Metrics;
67
import org.bukkit.Bukkit;
78
import org.bukkit.ChatColor;
89
import org.bukkit.Location;
@@ -44,11 +45,17 @@ public void onEnable() {
4445
this.getCommand("giveblueprint").setExecutor(new GiveBlueprint(this));
4546
this.getCommand("copyStone").setExecutor(new CopyStone());
4647
Bukkit.getPluginManager().registerEvents(new PlaceSchem(this), this);
47-
setStoneQue();
48+
if(getConfig().getBoolean("allowGenerateOres")) {
49+
setStoneQue();
50+
}
4851
if (getConfig().getBoolean("automaticPasting")) {
4952
setSchedule();
5053
}
51-
54+
if(getConfig().get("bstatsIntegration") != null) {
55+
if (getConfig().getBoolean("bstatsIntegration")) {
56+
Metrics metrics = new Metrics(this);
57+
}
58+
}
5259
}
5360

5461
@Override
@@ -77,7 +84,8 @@ public boolean accept(File dir, String name) {
7784
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
7885
@Override
7986
public void run() {
80-
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "pasteatorigin " + schematic.getAbsolutePath().replace(".scm", ""));
87+
//System.out.println(schematic.getAbsolutePath().replace(".scm", ""));
88+
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "pasteatorigin " + schematic.getName().replace(".scm", ""));
8189
}
8290
}, (interval * count), timespan);
8391
count++;
@@ -94,7 +102,7 @@ public void run() {
94102
if (p.getLocation().getBlockX() > (x - 50) && p.getLocation().getBlockX() < (x + 50)) {
95103
if (p.getLocation().getBlockZ() > (z - 50) && p.getLocation().getBlockZ() < (z + 50)) {
96104
if (p.getLocation().getBlockY() > (y - 15) && p.getLocation().getBlockY() < (y + 50)) {
97-
p.sendMessage(badge + " Resetting farm " + ChatColor.GOLD + schematic.getName().replace(".scm", "") + ChatColor.RESET + " in " + ChatColor.RED + ChatColor.BOLD + "ONE" + ChatColor.RESET + " Minute");
105+
//p.sendMessage(badge + " Resetting farm " + ChatColor.GOLD + schematic.getName().replace(".scm", "") + ChatColor.RESET + " in " + ChatColor.RED + ChatColor.BOLD + "ONE" + ChatColor.RESET + " Minute");
98106
}
99107
}
100108
}

src/main/resources/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
automaticPasting: true
2+
allowGenerateOres: false
23
totalInterval: 30
34
stoneRegenModifier: 40
5+
bstatsIntegration: true
46
badge: '&3&l[&2Treebo Timed&3&l]&r'
57
oreWeights:
68
EMERALD_ORE: 100

src/main/resources/plugin.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: TreeboTimed
22
version: ${project.version}
33
main: me.shakeforprotein.treebotimed.TreeboTimed
4-
api-version: 1.15
4+
api-version: 1.13
55
authors: [ShakeforProtein]
66
depend: [WorldEdit, WorldGuard]
77

88
permissions:
99
treebotimed.doit:
1010
default: op
1111
treebotimed.admin:
12-
default: false
12+
default: op
1313
treebotimed.giveblueprint:
1414
description: Allows the use of giveBluprint command
15-
default: false
15+
default: op
1616

1717
commands:
1818
giveblueprint:

0 commit comments

Comments
 (0)