diff --git a/.idea/artifacts/PersonalPVP_jar.xml b/.idea/artifacts/PersonalPVP_jar.xml index d6b9c03..db833df 100644 --- a/.idea/artifacts/PersonalPVP_jar.xml +++ b/.idea/artifacts/PersonalPVP_jar.xml @@ -1,19 +1,29 @@ - $PROJECT_DIR$/out/artifacts/PersonalPVP_jar + $USER_HOME$/Desktop/TEST/plugins - + + + + + + + + + - - - - + + + + - - + + + + \ No newline at end of file diff --git a/.idea/discord.xml b/.idea/discord.xml new file mode 100644 index 0000000..30bab2a --- /dev/null +++ b/.idea/discord.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8c99008..01e946b 100644 --- a/pom.xml +++ b/pom.xml @@ -4,9 +4,9 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - xyz.nsgw + xyz.nsgw.personalpvp PersonalPVP - 1.4.4 + 1.4.5 jar PersonalPVP @@ -42,15 +42,15 @@ co.aikar.commands - xyz.nsgw.nsys.libs.acf + xyz.nsgw.personalpvp.libs.acf co.aikar.locales - xyz.nsgw.nsys.libs.locales + xyz.nsgw.personalpvp.libs.locales net.kyori - xyz.nsgw.nsys.libs.kyori + xyz.nsgw.personalpvp.libs.kyori @@ -119,7 +119,7 @@ net.kyori adventure-api - 4.9.0 + 4.9.1 net.kyori diff --git a/src/main/java/xyz/nsgw/personalpvp/Listeners.java b/src/main/java/xyz/nsgw/personalpvp/Listeners.java index 3af5325..0feb465 100644 --- a/src/main/java/xyz/nsgw/personalpvp/Listeners.java +++ b/src/main/java/xyz/nsgw/personalpvp/Listeners.java @@ -70,7 +70,7 @@ public void onQuit(final PlayerQuitEvent e) { } } class DeathListener implements Listener { - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onDeath(final PlayerDeathEvent e) { if(e.getEntity().getKiller() == null) return; e.getDrops().clear(); @@ -80,7 +80,7 @@ public void onDeath(final PlayerDeathEvent e) { } class DamageByEntityListener implements Listener { public DamageByEntityListener() {} - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onDamage(@NotNull EntityDamageByEntityEvent e) { Entity defender = e.getEntity(), attacker = e.getDamager(); if(shouldTameablesCancel(attacker, defender)) { @@ -176,7 +176,7 @@ public void onLing(final LingeringPotionSplashEvent e){ }*/ } class ProjectileListener implements Listener { - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onHit(final ProjectileHitEvent e){ Projectile projectile = e.getEntity(); if(e.getHitEntity()==null || @@ -206,7 +206,7 @@ else if(projectile instanceof AbstractArrow) { } } class FishingListener implements Listener { - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onFish(@NotNull PlayerFishEvent e) { if(!(e.getCaught() instanceof Player)) return; UUID caughtUuid = e.getCaught().getUniqueId(), playerUuid = e.getPlayer().getUniqueId(); @@ -217,7 +217,7 @@ public void onFish(@NotNull PlayerFishEvent e) { } } class CombustionListener implements Listener { - @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true) public void onCombust(final EntityCombustByEntityEvent e) { if(!(e.getCombuster() instanceof Player) || !(e.getEntity() instanceof Player)) return; diff --git a/src/main/java/xyz/nsgw/personalpvp/PPVPPlugin.java b/src/main/java/xyz/nsgw/personalpvp/PPVPPlugin.java index 11c65c1..60be1a9 100644 --- a/src/main/java/xyz/nsgw/personalpvp/PPVPPlugin.java +++ b/src/main/java/xyz/nsgw/personalpvp/PPVPPlugin.java @@ -74,6 +74,7 @@ public void onEnable() { checkActionbar(); this.log.info("Default PvP setting: "+(PPVPPlugin.inst().conf().get().getProperty(GeneralConfig.DEFAULT_PVP_STATUS)?"TRUE":"FALSE")); + this.log.info("If you are using spigot (not paper) or get actionbar errors, please disable the actionbar in config.yml by changing toggleable-actionbar.enable to false."); this.log.info("Personal PvP ENABLED."); } diff --git a/src/main/java/xyz/nsgw/personalpvp/commands/CommandHandler.java b/src/main/java/xyz/nsgw/personalpvp/commands/CommandHandler.java index d40f737..64bb4db 100644 --- a/src/main/java/xyz/nsgw/personalpvp/commands/CommandHandler.java +++ b/src/main/java/xyz/nsgw/personalpvp/commands/CommandHandler.java @@ -5,6 +5,7 @@ import co.aikar.commands.InvalidCommandArgument; import co.aikar.commands.PaperCommandManager; import co.aikar.commands.annotation.*; +import co.aikar.commands.bukkit.contexts.OnlinePlayer; import org.bukkit.Bukkit; import org.bukkit.OfflinePlayer; import org.bukkit.command.CommandSender; @@ -109,20 +110,24 @@ public class onOther extends BaseCommand { @Subcommand("status") @CommandPermission("personalpvp.pvpcontrol.other.status") - public void onStatus(final CommandSender s, final Player target) { + public void onStatus(final CommandSender s, final OnlinePlayer t) { + Player target = t.getPlayer(); Utils.send(s, Utils.parse(""+target.getDisplayName()+" has PVP " + (PVPManager.pvpPositive(target.getUniqueId()) ? "ENABLED." : "DISABLED.")), true, false); } @Subcommand("toggle") @CommandPermission("personalpvp.pvpcontrol.other.toggle") - public void onToggle(final CommandSender s, final Player target) { - PVPManager.toggle(target.getUniqueId()); - String msg = "toggled PVP for "+target.getName()+"."; + @CommandCompletion("@players") + public void onToggle(final CommandSender s, final OnlinePlayer target) { + PVPManager.toggle(target.player.getUniqueId()); + String msg = "toggled PVP for "+target.player.getName()+"."; Utils.send(s, Utils.parse("You "+msg), true, false); notifyConsole(""+s.getName()+" "+msg); } @Subcommand("reset") @CommandPermission("personalpvp.pvpcontrol.other.reset") - public void onReset(final CommandSender s, final Player target) { + @CommandCompletion("@players") + public void onReset(final CommandSender s, final OnlinePlayer t) { + Player target = t.getPlayer(); PVPManager.remove(target.getUniqueId()); String msg = (PPVPPlugin.inst().conf().get().getProperty(GeneralConfig.DEFAULT_PVP_STATUS)?"enabled":"disabled")+" PVP for "+target.getName()+"."; Utils.send(s, Utils.parse("You "+msg), true, false); @@ -130,7 +135,9 @@ public void onReset(final CommandSender s, final Player target) { } @Subcommand("enable") @CommandPermission("personalpvp.pvpcontrol.other.enable") - public void onEnable(final CommandSender s, final Player target) { + @CommandCompletion("@players") + public void onEnable(final CommandSender s, final OnlinePlayer t) { + Player target = t.getPlayer(); if(PVPManager.isPvpDisabled(target.getUniqueId())) { PVPManager.toggle(target.getUniqueId()); String msg = "enabled PVP for "+target.getName()+"."; @@ -140,7 +147,9 @@ public void onEnable(final CommandSender s, final Player target) { } @Subcommand("disable") @CommandPermission("personalpvp.pvpcontrol.other.disable") - public void onDisable(final CommandSender s, final Player target) { + @CommandCompletion("@players") + public void onDisable(final CommandSender s, final OnlinePlayer t) { + Player target = t.getPlayer(); if(PVPManager.isPvpEnabled(target.getUniqueId())) { PVPManager.toggle(target.getUniqueId()); String msg = "disabled PVP for "+target.getName()+"."; @@ -156,7 +165,7 @@ private void notifyConsole(final String msg) { @Subcommand("reset") @CommandPermission("personalpvp.resetplayer") - @CommandCompletion("players") + @CommandCompletion("@players") public void onReset(final Player p) { PVPManager.remove(p.getUniqueId()); Utils.send(p, Utils.parse(PPVPPlugin.inst().conf().get().getProperty(GeneralConfig.DEFAULT_PVP_STATUS)?"":""+"You reset your PVP status."), true, false); @@ -168,7 +177,9 @@ public class onLock extends BaseCommand { @Subcommand("toggle") @CommandPermission("personalpvp.lock.toggle") @CommandCompletion("@players") - public void onToggle(final CommandSender s, final Player target) {UUID u = target.getUniqueId(); + public void onToggle(final CommandSender s, final OnlinePlayer t) { + Player target = t.getPlayer(); + UUID u = target.getUniqueId(); String name = target.getName(); String locked = PVPManager.toggleLocked(u)?"locked":"unlocked"; Utils.send(s, @@ -195,7 +206,8 @@ public void onOfflineToggle(final CommandSender s, final OfflinePlayer target) { @Subcommand("status") @CommandPermission("personalpvp.lock.status") @CommandCompletion("@players") - public void onStatus(final CommandSender s, final Player target) { + public void onStatus(final CommandSender s, final OnlinePlayer t) { + Player target = t.getPlayer(); UUID u = target.getUniqueId(); String name = target.getName(); String locked = PVPManager.isLocked(u)?"locked":"unlocked"; diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 32ed490..0951522 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -2,8 +2,8 @@ name: PersonalPVP version: ${project.version} main: xyz.nsgw.personalpvp.PPVPPlugin api-version: 1.17 -authors: [ CosmicSilence ] -website: https://github.com/Nebula-O +authors: [ nsgw ] +website: https://github.com/nsgwick softdepend: [PlaceholderAPI] permissions: personalpvp.player: diff --git a/target/classes/plugin.yml b/target/classes/plugin.yml deleted file mode 100644 index 10a7274..0000000 --- a/target/classes/plugin.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: PersonalPVP -version: 1.4.2 -main: xyz.nsgw.personalpvp.PPVPPlugin -api-version: 1.17 -authors: [ CosmicSilence ] -website: https://github.com/Nebula-O -softdepend: [PlaceholderAPI] -permissions: - personalpvp.player: - children: - - personalpvp.help - - personalpvp.togglepvp - - personalpvp.pvpcontrol - - personalpvp.toggleactionbar - default: not op - description: All default permissions. - personalpvp.admin: - default: op - description: Complete set of PVP permissions. - children: - - personalpvp.reload - - personalpvp.update - - personalpvp.togglepvp - - personalpvp.togglepvp.other - - personalpvp.togglepvp.bypass - - personalpvp.toggleactionbar - - personalpvp.pvpcontrol - - personalpvp.pvpcontrol.admin - - personalpvp.pvpother - - personalpvp.resetplayer - - personalpvp.lock - - personalpvp.listpvp - - personalpvp.help - - personalpvp.listpermissions \ No newline at end of file diff --git a/target/classes/xyz/nsgw/personalpvp/CombustionListener.class b/target/classes/xyz/nsgw/personalpvp/CombustionListener.class deleted file mode 100644 index 65cb378..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/CombustionListener.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/DamageByEntityListener.class b/target/classes/xyz/nsgw/personalpvp/DamageByEntityListener.class deleted file mode 100644 index 7678755..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/DamageByEntityListener.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/DeathListener.class b/target/classes/xyz/nsgw/personalpvp/DeathListener.class deleted file mode 100644 index 1e5750a..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/DeathListener.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/FishingListener.class b/target/classes/xyz/nsgw/personalpvp/FishingListener.class deleted file mode 100644 index 7b2254d..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/FishingListener.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/Listeners.class b/target/classes/xyz/nsgw/personalpvp/Listeners.class deleted file mode 100644 index 64a1f17..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/Listeners.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/PPVPPlugin.class b/target/classes/xyz/nsgw/personalpvp/PPVPPlugin.class deleted file mode 100644 index 82b9669..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/PPVPPlugin.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/PotionListener.class b/target/classes/xyz/nsgw/personalpvp/PotionListener.class deleted file mode 100644 index 61537d7..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/PotionListener.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/ProjectileListener.class b/target/classes/xyz/nsgw/personalpvp/ProjectileListener.class deleted file mode 100644 index b6df688..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/ProjectileListener.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/QuitListener.class b/target/classes/xyz/nsgw/personalpvp/QuitListener.class deleted file mode 100644 index a529d74..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/QuitListener.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/Utils.class b/target/classes/xyz/nsgw/personalpvp/Utils.class deleted file mode 100644 index b19ba32..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/Utils.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/commands/CommandHandler.class b/target/classes/xyz/nsgw/personalpvp/commands/CommandHandler.class deleted file mode 100644 index 66c06ea..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/commands/CommandHandler.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand$onLock.class b/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand$onLock.class deleted file mode 100644 index 33060d0..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand$onLock.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand$onOther.class b/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand$onOther.class deleted file mode 100644 index 68ba368..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand$onOther.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand$onPvpCtrlr.class b/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand$onPvpCtrlr.class deleted file mode 100644 index e69821d..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand$onPvpCtrlr.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand.class b/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand.class deleted file mode 100644 index 41b47b2..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/commands/PVPCommand.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/config/ConfigHandler.class b/target/classes/xyz/nsgw/personalpvp/config/ConfigHandler.class deleted file mode 100644 index b20b13f..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/config/ConfigHandler.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/config/GeneralConfig.class b/target/classes/xyz/nsgw/personalpvp/config/GeneralConfig.class deleted file mode 100644 index 42cd319..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/config/GeneralConfig.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/managers/PVPManager.class b/target/classes/xyz/nsgw/personalpvp/managers/PVPManager.class deleted file mode 100644 index 8cf6d27..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/managers/PVPManager.class and /dev/null differ diff --git a/target/classes/xyz/nsgw/personalpvp/managers/TaskManager.class b/target/classes/xyz/nsgw/personalpvp/managers/TaskManager.class deleted file mode 100644 index 6d4af5d..0000000 Binary files a/target/classes/xyz/nsgw/personalpvp/managers/TaskManager.class and /dev/null differ