mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-12 13:26:56 +00:00
Refactor damage source checking and restructure player management
The source of damage detection for PvP interactions has been updated to improve accuracy and flexibility. A 'Target' sub-class has been implemented in the PlayerManager class, removing the need for a separate DamageCheck class. The PlayerManager class was also moved to the 'data' package. Distribution of feedback messages has been simplified using the new DamageCheckResult class.
This commit is contained in:
@@ -4,7 +4,8 @@ import me.youhavetrouble.preventstabby.commands.MainCommand;
|
||||
import me.youhavetrouble.preventstabby.config.ConfigCache;
|
||||
import me.youhavetrouble.preventstabby.hooks.PlaceholderApiHook;
|
||||
import me.youhavetrouble.preventstabby.hooks.WorldGuardHook;
|
||||
import me.youhavetrouble.preventstabby.players.PlayerManager;
|
||||
import me.youhavetrouble.preventstabby.data.PlayerListener;
|
||||
import me.youhavetrouble.preventstabby.data.PlayerManager;
|
||||
import me.youhavetrouble.preventstabby.util.*;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@@ -16,7 +17,6 @@ public final class PreventStabby extends JavaPlugin {
|
||||
private static PreventStabby plugin;
|
||||
private ConfigCache configCache;
|
||||
private PlayerManager playerManager;
|
||||
private DamageCheck damageCheck;
|
||||
private DatabaseSQLite sqLite;
|
||||
private static boolean worldGuardHook;
|
||||
|
||||
@@ -25,10 +25,9 @@ public final class PreventStabby extends JavaPlugin {
|
||||
plugin = this;
|
||||
reloadPluginConfig();
|
||||
playerManager = new PlayerManager(this);
|
||||
damageCheck = new DamageCheck(this);
|
||||
|
||||
// Register listeners TODO
|
||||
|
||||
getServer().getPluginManager().registerEvents(new PlayerListener(), this);
|
||||
|
||||
// Register command
|
||||
PluginCommand pvpCommand = getCommand("pvp");
|
||||
@@ -83,10 +82,6 @@ public final class PreventStabby extends JavaPlugin {
|
||||
return playerManager;
|
||||
}
|
||||
|
||||
public DamageCheck getDamageUtil() {
|
||||
return damageCheck;
|
||||
}
|
||||
|
||||
public DatabaseSQLite getSqLite() {return sqLite;}
|
||||
|
||||
public static PreventStabby getPlugin() {
|
||||
|
||||
Reference in New Issue
Block a user