Files
src
build.gradle
manifest.kod
Code
9 804
src/main/java/com/wishbook/WishBook.java
package com.wishbook;
import com.wishbook.listener.WishListener;
import com.wishbook.manager.WishExecutor;
import com.wishbook.manager.WishSession;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class WishBook extends JavaPlugin {
private WishExecutor wishExecutor;
private WishSession wishSession;
@Override
public void onEnable() {
saveDefaultConfig();
this.wishSession = new WishSession();
this.wishExecutor = new WishExecutor(this);
getServer().getPluginManager().registerEvents(new WishListener(this), this);
getCommand("wishbook").setExecutor(new WishBookCommand(this));
getLogger().info("WishBook has been enabled! Wishes can now be granted.");
}
@Override
public void onDisable() {
wishSession.clearAll();
getLogger().info("WishBook has been disabled.");
}
public String getMessage(String path) {
return colorize(getConfig().getString("messages." + path, "&cMessage not found: " + path));
}
public String colorize(String text) {
return text.replace("{reason}", "")
.replace("&", "§");
}
}