Skip to content

Commit

Permalink
Bug fixes & changes (etc) for 1.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
nickstuaw committed Sep 26, 2021
1 parent fec0abc commit dcdfe50
Show file tree
Hide file tree
Showing 27 changed files with 61 additions and 65 deletions.
26 changes: 18 additions & 8 deletions .idea/artifacts/PersonalPVP_jar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/discord.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>xyz.nsgw</groupId>
<groupId>xyz.nsgw.personalpvp</groupId>
<artifactId>PersonalPVP</artifactId>
<version>1.4.4</version>
<version>1.4.5</version>
<packaging>jar</packaging>

<name>PersonalPVP</name>
Expand Down Expand Up @@ -42,15 +42,15 @@
<relocations>
<relocation>
<pattern>co.aikar.commands</pattern>
<shadedPattern>xyz.nsgw.nsys.libs.acf</shadedPattern> <!-- Replace this -->
<shadedPattern>xyz.nsgw.personalpvp.libs.acf</shadedPattern> <!-- Replace this -->
</relocation>
<relocation>
<pattern>co.aikar.locales</pattern>
<shadedPattern>xyz.nsgw.nsys.libs.locales</shadedPattern> <!-- Replace this -->
<shadedPattern>xyz.nsgw.personalpvp.libs.locales</shadedPattern> <!-- Replace this -->
</relocation>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>xyz.nsgw.nsys.libs.kyori</shadedPattern> <!-- Replace this -->
<shadedPattern>xyz.nsgw.personalpvp.libs.kyori</shadedPattern> <!-- Replace this -->
</relocation>
</relocations>
</configuration>
Expand Down Expand Up @@ -119,7 +119,7 @@
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.9.0</version>
<version>4.9.1</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/xyz/nsgw/personalpvp/Listeners.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)) {
Expand Down Expand Up @@ -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 ||
Expand Down Expand Up @@ -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();
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/xyz/nsgw/personalpvp/PPVPPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}

Expand Down
32 changes: 22 additions & 10 deletions src/main/java/xyz/nsgw/personalpvp/commands/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -109,28 +110,34 @@ 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("<yellow>"+target.getDisplayName()+" has PVP " + (PVPManager.pvpPositive(target.getUniqueId()) ? "<aqua>ENABLED." : "<green>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 = "<gray>toggled</gray><yellow> PVP for "+target.getName()+".</yellow>";
@CommandCompletion("@players")
public void onToggle(final CommandSender s, final OnlinePlayer target) {
PVPManager.toggle(target.player.getUniqueId());
String msg = "<gray>toggled</gray><yellow> PVP for "+target.player.getName()+".</yellow>";
Utils.send(s, Utils.parse("<yellow>You </yellow>"+msg), true, false);
notifyConsole("<yellow>"+s.getName()+"</yellow> "+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)?"<aqua>enabled</aqua>":"<green>disabled</green>")+"<yellow> PVP for "+target.getName()+".</yellow>";
Utils.send(s, Utils.parse("<yellow>You </yellow>"+msg), true, false);
notifyConsole("<yellow>"+s.getName()+"</yellow> "+msg);
}
@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 = "<aqua>enabled</aqua><yellow> PVP for "+target.getName()+".</yellow>";
Expand All @@ -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 = "<green>disabled</green><yellow> PVP for "+target.getName()+".</yellow>";
Expand All @@ -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)?"<aqua>":"<green>"+"You reset your PVP status."), true, false);
Expand All @@ -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,
Expand All @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
34 changes: 0 additions & 34 deletions target/classes/plugin.yml

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed target/classes/xyz/nsgw/personalpvp/Listeners.class
Binary file not shown.
Binary file removed target/classes/xyz/nsgw/personalpvp/PPVPPlugin.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed target/classes/xyz/nsgw/personalpvp/QuitListener.class
Binary file not shown.
Binary file removed target/classes/xyz/nsgw/personalpvp/Utils.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit dcdfe50

Please sign in to comment.