Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Remove old kit classes and add BaseKit class for CherrySkyPVP
Browse files Browse the repository at this point in the history
Deleted the old kit classes including Jumper, KitCommand, KitManager and KitsSystem. Introduced a new class, BaseKit. Also, removed the registrations related to the deleted classes in the Loader class.
  • Loading branch information
mathiasclari committed Dec 29, 2023
1 parent 1e507bd commit 6cbc99a
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 170 deletions.
36 changes: 7 additions & 29 deletions src/main/java/net/cherrycraft/cherryskypvp/Loader.java
Original file line number Diff line number Diff line change
@@ -1,31 +1,24 @@
package net.cherrycraft.cherryskypvp;

import net.cherrycraft.cherryskypvp.bounty.commands.BountyCommand;
import net.cherrycraft.cherryskypvp.economy.command.CoinsCommand;
import net.cherrycraft.cherryskypvp.launcher.LaunchpadSystem;
import net.cherrycraft.cherryskypvp.manager.CommandManager;
import net.cherrycraft.cherryskypvp.placeholders.StatsPlaceholderExpansion;
import net.cherrycraft.cherryskypvp.spawn.AlwaysSpawn;
import net.cherrycraft.cherryskypvp.spawn.SetSpawnCommand;
import net.cherrycraft.cherryskypvp.stats.SkyPVPStats;
import net.cherrycraft.cherryskypvp.bounty.commands.BountyCommand;
import net.cherrycraft.cherryskypvp.economy.command.CoinsCommand;
import net.cherrycraft.cherryskypvp.kits.KitCommand;
import net.cherrycraft.cherryskypvp.kits.list.Jumper;
import net.cherrycraft.cherryskypvp.kits.system.KitManager;
import net.cherrycraft.cherryskypvp.placeholders.StatsPlaceholderExpansion;
import org.bukkit.Bukkit;
import org.bukkit.event.Listener;

public class Loader implements Listener {

private static KitManager kitManager;


public static void registerCommands(CherrySkyPVP plugin) {
//registeredCommand(new LanguageCommand("language"), plugin);
registeredCommand(new SetSpawnCommand("setspawn"), plugin);
registeredCommand(new CoinsCommand("coins"), plugin);
registeredCommand(new BountyCommand("bounty"), plugin);
registeredCommand(new KitCommand("kit"), plugin);

}


Expand All @@ -34,30 +27,15 @@ private static void registeredCommand(CommandManager command, CherrySkyPVP plugi
plugin.getLogger().info("Command '" + command.getCommandName() + "' has been registered.");
}

private static void registerKits(CherrySkyPVP plugin) {
// Register kits here
kitManager = new KitManager();
kitManager.registerKit(new Jumper("Jumper", "Jumper kit"));
}

public static void registerListeners(CherrySkyPVP plugin) {
// Register listeners here
//Bukkit.getPluginManager().registerEvents(new ExampleListener(), plugin);
Bukkit.getPluginManager().registerEvents(new SkyPVPStats(),plugin);
Bukkit.getPluginManager().registerEvents(new AlwaysSpawn() ,plugin);
if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null){
Bukkit.getPluginManager().registerEvents(new SkyPVPStats(), plugin);
Bukkit.getPluginManager().registerEvents(new AlwaysSpawn(), plugin);
if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
new StatsPlaceholderExpansion().register();
}
Bukkit.getPluginManager().registerEvents(new LaunchpadSystem(),plugin);

// Register kits
registerKits(plugin);
// Register kit listeners
Bukkit.getPluginManager().registerEvents(new Jumper("Jumper","Jumper Kit"), plugin);

}
Bukkit.getPluginManager().registerEvents(new LaunchpadSystem(), plugin);

public static KitManager getKitManager() {
return kitManager;
}
}
6 changes: 6 additions & 0 deletions src/main/java/net/cherrycraft/cherryskypvp/kits/BaseKit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package net.cherrycraft.cherryskypvp.kits;

public class BaseKit {


}
38 changes: 0 additions & 38 deletions src/main/java/net/cherrycraft/cherryskypvp/kits/KitCommand.java

This file was deleted.

64 changes: 0 additions & 64 deletions src/main/java/net/cherrycraft/cherryskypvp/kits/list/Jumper.java

This file was deleted.

This file was deleted.

This file was deleted.

18 changes: 18 additions & 0 deletions src/main/java/net/cherrycraft/cherryskypvp/kits/systems/Kit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package net.cherrycraft.cherryskypvp.kits.systems;

import java.util.List;

public abstract class Kit {
private final String name;
private final String description;

public Kit(String name, String description) {
this.name = name;
this.description = description;
}

List<String> getItems() {

return null;
}
}

0 comments on commit 6cbc99a

Please sign in to comment.