Files
src
build.gradle
Code
19 881
src/main/java/com/kodarii/rustportableutils/RustPortableUtils.java
package com.kodarii.rustportableutils;
import com.kodarii.rustportableutils.commands.*;
import com.kodarii.rustportableutils.listeners.VaultListener;
import com.kodarii.rustportableutils.listeners.WorkbenchListener;
import com.kodarii.rustportableutils.managers.VaultManager;
import com.kodarii.rustportableutils.utils.GeyserUtil;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class RustPortableUtils extends JavaPlugin {
private VaultManager vaultManager;
@Override
public void onEnable() {
saveDefaultConfig();
this.vaultManager = new VaultManager(this);
GeyserUtil.init(this);
getServer().getPluginManager().registerEvents(new VaultListener(this), this);
getServer().getPluginManager().registerEvents(new WorkbenchListener(this), this);
getCommand("vault").setExecutor(new VaultCommand(this));
getCommand("craft").setExecutor(new CraftCommand(this));
getCommand("smelt").setExecutor(new SmeltCommand(this));
getCommand("bsmelt").setExecutor(new BlastSmeltCommand(this));
getCommand("ssmelt").setExecutor(new SmokerSmeltCommand(this));
getCommand("anvil").setExecutor(new AnvilCommand(this));
getCommand("etable").setExecutor(new EnchantTableCommand(this));
getCommand("brew").setExecutor(new BrewCommand(this));
getCommand("smith").setExecutor(new SmithCommand(this));
getCommand("grind").setExecutor(new GrindCommand(this));
getLogger().info("RustPortableUtils has been enabled!" +
(GeyserUtil.isAvailable() ? " (GeyserMC detected - Bedrock support active)" : ""));
}
@Override
public void onDisable() {
if (vaultManager != null) {
vaultManager.saveAllVaults();
}
getLogger().info("RustPortableUtils has been disabled!");
}
public String getMessage(String path) {
return getConfig().getString("messages." + path, "&cMessage not found: " + path)
.replace("&", "§");
}
}