Files
src
build.gradle
Code
10 606
src/main/java/com/tempblocks/TempBlocks.java
package com.tempblocks;
import com.tempblocks.commands.ReloadCommand;
import com.tempblocks.hooks.WorldGuardHook;
import com.tempblocks.listeners.BlockListener;
import com.tempblocks.managers.BlockTracker;
import com.tempblocks.managers.ConfigManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class TempBlocks extends JavaPlugin {
private ConfigManager configManager;
private WorldGuardHook worldGuardHook;
private BlockTracker blockTracker;
@Override
public void onEnable() {
this.saveDefaultConfig();
this.configManager = new ConfigManager(this);
this.configManager.load();
this.worldGuardHook = new WorldGuardHook(this);
this.blockTracker = new BlockTracker(this);
this.blockTracker.loadData();
Bukkit.getPluginManager().registerEvents(new BlockListener(this), this);
this.getCommand("tempblocks").setExecutor(new ReloadCommand(this));
this.getLogger().info("TempBlocks enabled successfully!");
if (this.worldGuardHook.isEnabled()) {
this.getLogger().info("WorldGuard integration enabled");
}
}
@Override
public void onDisable() {
if (this.blockTracker != null) {
this.blockTracker.clearAll();
}
this.getLogger().info("TempBlocks disabled");
}
}