mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-06 15:52:03 +00:00
Merge branch 'community-edition' into main
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package net.momirealms.craftengine.bukkit.plugin;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class BukkitCraftEnginePlugin extends JavaPlugin {
|
||||
private final BukkitCraftEngine plugin;
|
||||
|
||||
@@ -18,7 +23,20 @@ public class BukkitCraftEnginePlugin extends JavaPlugin {
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
this.plugin.scheduler().asyncRepeating(() -> {
|
||||
Collection<? extends Player> players = Bukkit.getOnlinePlayers();
|
||||
if (players.size() > 30) {
|
||||
this.plugin.logger().warn("Glad to see that your server is growing!");
|
||||
this.plugin.logger().warn("The Community Edition supports up to 30 players. Unlock limitless potential with CraftEngine Premium:");
|
||||
this.plugin.logger().warn("► Unlimited player capacity");
|
||||
this.plugin.logger().warn("► Priority support");
|
||||
this.plugin.logger().warn("► Exclusive features");
|
||||
}
|
||||
}, 1, 1, TimeUnit.MINUTES);
|
||||
this.plugin.onPluginEnable();
|
||||
this.plugin.logger().warn("You're using the CraftEngine Community Edition.");
|
||||
this.plugin.logger().warn("This version is completely free for servers with up to 30 players.");
|
||||
this.plugin.logger().warn("Please consider purchasing the premium version to support CraftEngine's development.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -143,7 +143,7 @@ tasks {
|
||||
manifest {
|
||||
attributes["paperweight-mappings-namespace"] = "mojang"
|
||||
}
|
||||
archiveFileName = "${rootProject.name}-paper-plugin-${rootProject.properties["project_version"]}.jar"
|
||||
archiveFileName = "${rootProject.name}-community-edition-${rootProject.properties["project_version"]}.jar"
|
||||
destinationDirectory.set(file("$rootDir/target"))
|
||||
relocate("net.kyori", "net.momirealms.craftengine.libraries")
|
||||
relocate("net.momirealms.sparrow.nbt", "net.momirealms.craftengine.libraries.nbt")
|
||||
|
||||
@@ -18,6 +18,8 @@ public final class PaperCraftEnginePlugin extends JavaPlugin {
|
||||
@Override
|
||||
public void onEnable() {
|
||||
this.bootstrap.plugin.onPluginEnable();
|
||||
this.bootstrap.plugin.logger().warn("You're using the CraftEngine Community Edition.");
|
||||
this.bootstrap.plugin.logger().warn("Please consider purchasing the premium version to support CraftEngine's development.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.momirealms.craftengine.core.item.behavior.ItemBehavior;
|
||||
import net.momirealms.craftengine.core.item.behavior.ItemBehaviorFactory;
|
||||
import net.momirealms.craftengine.core.item.context.UseOnContext;
|
||||
import net.momirealms.craftengine.core.pack.Pack;
|
||||
import net.momirealms.craftengine.core.pack.PendingConfigSection;
|
||||
import net.momirealms.craftengine.core.plugin.CraftEngine;
|
||||
import net.momirealms.craftengine.core.plugin.locale.LocalizedResourceConfigException;
|
||||
import net.momirealms.craftengine.core.util.Direction;
|
||||
|
||||
Reference in New Issue
Block a user