Files
src
build.gradle
Code
19 1,327
src/main/java/com/example/rtpvillager/RTPVillager.java
package com.example.rtpvillager;
import com.example.rtpvillager.commands.RTPCommand;
import com.example.rtpvillager.commands.RTPVillagerCommand;
import com.example.rtpvillager.config.ConfigManager;
import com.example.rtpvillager.inventory.gui.GUIListener;
import com.example.rtpvillager.inventory.gui.GUIManager;
import com.example.rtpvillager.listeners.VillagerInteractListener;
import com.example.rtpvillager.listeners.VillagerLookListener;
import com.example.rtpvillager.listeners.WorldGuardBypassListener;
import com.example.rtpvillager.managers.TeleportManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
@Getter
public class RTPVillager extends JavaPlugin {
private ConfigManager configManager;
private GUIManager guiManager;
private TeleportManager teleportManager;
private final Set<UUID> rtpVillagers = new HashSet<>();
@Override
public void onEnable() {
saveDefaultConfig();
saveResource("messages_pl.yml", false);
saveResource("messages_en.yml", false);
this.configManager = new ConfigManager(this);
this.guiManager = new GUIManager();
this.teleportManager = new TeleportManager(this);
RTPCommand rtpCommand = new RTPCommand(this);
getCommand("rtp").setExecutor(rtpCommand);
getCommand("rtp").setTabCompleter(rtpCommand);
RTPVillagerCommand rtpVillagerCommand = new RTPVillagerCommand(this);
getCommand("rtpvillager").setExecutor(rtpVillagerCommand);
getCommand("rtpvillager").setTabCompleter(rtpVillagerCommand);
Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
Bukkit.getPluginManager().registerEvents(new VillagerInteractListener(this), this);
Bukkit.getPluginManager().registerEvents(new VillagerLookListener(this), this);
Bukkit.getPluginManager().registerEvents(new WorldGuardBypassListener(this), this);
getLogger().info("RTPVillager has been enabled!");
}
@Override
public void onDisable() {
getLogger().info("RTPVillager has been disabled!");
}
}