Skip to content

Commit

Permalink
Added bstats & Updated readme
Browse files Browse the repository at this point in the history
I think we hit the point to offer a proper metrics system.

Happy enchanting as this should (hopefully, if no other bugs come to be) be the final v2.1.x commit
  • Loading branch information
Geolykt committed Oct 26, 2020
1 parent 1cee436 commit 6f1015c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/target/
*.prefs
.project
dependency-reduced-pom.xml
22 changes: 21 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
<id>sk89q-repo</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<repository>
<id>CodeMC</id> <!-- For BStats -->
<url>https://repo.codemc.org/repository/maven-public</url>
</repository>
</repositories>
<dependencies>
<dependency>
Expand All @@ -39,6 +43,14 @@
<scope>provided</scope>
</dependency>

<!-- BStats, our metrics system -->
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>1.7</version>
<scope>compile</scope>
</dependency>

<!-- World protection plugins to integrate with -->
<dependency>
<groupId>com.github.TownyAdvanced</groupId>
Expand All @@ -52,7 +64,7 @@
<version>7.0.4-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<!-- TODO Anti-cheat APIs for Anti-cheat integrations-->
</dependencies>

Expand All @@ -77,6 +89,14 @@
</goals>
</execution>
</executions>
<configuration>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>de.geolykt.enchantments_plus.bstats</shadedPattern>
</relocation>
</relocations>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
17 changes: 11 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Got a question? Need help or want to discuss changes? Then feel free to DM me via discord: tristellar#9022. Issues however should be reported here so forkers can profit from them being public, but It's the best if at least someone (me in most cases) knows exploits or bugs so they can be fixed.
Got a question? Need help or want to discuss changes? Then feel free to join our [discord server](https://discord.gg/DcceT53). Issues however should be reported here so forkers can profit from them being public, but It's the best if at least someone (me in most cases) knows exploits or bugs so they can be fixed.

The plugin only intends to support 1.16.3 and newer versions when the time comes.

Expand All @@ -8,13 +8,15 @@ Zenchantments is a custom enchantment plugin that adds 70+ new enchantments (it
<br> While we currently don't add or remove any Enchantments, we will attempt to rebalance them and make them futureproof. In essence, we attempt to make this Fork as stable as possible to support Production-grade Servers.

## Enchantments+ vs other Zenchantments forks
- This fork is highly actively maintained and has persisted since May of 2020, which is the longer than any other fork which otherwise is more shortlived.
- This fork is fast. During the last months the fork accumulated lots of revisions that aim at improving performance as well as general code quality.
- This fork is highly actively maintained and has persisted since May of 2020, which is the longer than any other fork who are otherwise more shortlived.
- This is fast. During the last months the fork accumulated lots of revisions that aim at improving performance as well as general code quality.
- Enchantments+ doesn't use NMS. This means that newer versions are supported at a bigger scale than otherwise is the case, however with Zenchantments remvoing it's multi-version support, this may no longer be full selling point.
- Zenchantments supports (at some scale) 1.12 and other versions, Enchantments+ doesn't
- The fork compiles, Zenchantments doesn't.
- The fork is stable, while there are some bugs, most are either really obscure or noone reported them to me.
- Zenchantments supports (at some scale) 1.12 and other versions, Enchantments+ doesn't.
- The fork compiles, Zenchantments doesn't (for 1.16.2+).
- The fork is stable, while there are some bugs, most are either really obscure or noone reported them to me. If they are reported, they will often be fixed in under a day (especially on github).

## Metrics
As of version 2.1.6 the plugin uses bstats to cover metrics, the page where the information is shown can be found [here](https://bstats.org/plugin/bukkit/EnchantmentsPlus/9211).

## Permissions
<b>enchplus.enchant.get</b> - On player enchant event, allow player to have a chance at the enabled custom enchantments<br>
Expand Down Expand Up @@ -59,6 +61,7 @@ To view the changes compared to Zenchantments, add the Changelog of [NMS-Less Ze
<li>Help and tab completion now handle permissions</li>
<li>Mystery fish can now catch other water mobs such as cod, pufferfish and salmon and was buffed overall</li>
<li>Admins can now change which items are part of which tool</li>
<li>Added metrics system</li>
</ul>
</li>
<li>Patches:
Expand All @@ -71,6 +74,8 @@ To view the changes compared to Zenchantments, add the Changelog of [NMS-Less Ze
<li>Spectral performance increased noticeably</li>
<li>Lots of performance improvements for periodically running tasks</li>
<li>Dispensing laser items no longer temporarily freezes the Server</li>
<li>Grindstone works properly in a few more cases now</li>
<li>Spectral arrows can now be used!</li>
</ul>
</li>
<li>Code changes (doesn't affect behaviour as much):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//For Bukkit & Spigot 1.16.X

import org.apache.commons.lang.time.StopWatch;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
Expand Down Expand Up @@ -135,6 +136,12 @@ public boolean removeEnchantment(ItemStack stk, String enchantmentName) {
return false;
}

/**
* The metric object used by the plugin. Internal use only.
* @since 2.1.6
*/
private Metrics metric;

// Loads configs and starts tasks
public void onEnable() {
StopWatch w = new StopWatch();
Expand Down Expand Up @@ -191,7 +198,14 @@ public void onEnable() {
}, 5, 5);

// medium-high asynchronous frequency runnable (every five ticks)
getServer().getScheduler().runTaskTimerAsynchronously(this, () -> {Anthropomorphism.removeCheck();}, 5, 5);
getServer().getScheduler().runTaskTimerAsynchronously(this, () -> Anthropomorphism.removeCheck(), 5, 5);

// BSTATS metrics init
metric = new Metrics(this, 9211);
metric.addCustomChart(new Metrics.SimplePie("distribution_method", () -> Storage.DISTRIBUTION));
metric.addCustomChart(new Metrics.SimplePie("plugin_brand", () -> Storage.BRAND));
metric.addCustomChart(new Metrics.SimplePie("enchantment_getter", () -> CustomEnchantment.Enchantment_Adapter.getClass().getSimpleName()));

w.stop();
getLogger().info(Storage.BRAND + " v" + Storage.version + " started up in " + w.getTime() + "ms");
}
Expand Down

0 comments on commit 6f1015c

Please sign in to comment.