mirror of
https://github.com/YouHaveTrouble/PreventStabby.git
synced 2026-05-12 05:16:55 +00:00
prepare for finishing rebranding
This commit is contained in:
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>me.youhavetrouble</groupId>
|
<groupId>me.youhavetrouble</groupId>
|
||||||
<artifactId>PreventStabby</artifactId>
|
<artifactId>PreventStabby</artifactId>
|
||||||
<version>1.3-pre5</version>
|
<version>1.3</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>PreventStabby</name>
|
<name>PreventStabby</name>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public final class PreventStabby extends JavaPlugin {
|
|||||||
worldGuardHook = false;
|
worldGuardHook = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Metrics metrics = new Metrics(this, 10597);
|
Metrics metrics = new Metrics(this, 14074);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean worldGuardHookEnabled() {
|
public static boolean worldGuardHookEnabled() {
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ public class HelpCommand {
|
|||||||
|
|
||||||
public static void help(CommandSender sender, String[] args) {
|
public static void help(CommandSender sender, String[] args) {
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(PreventStabby.getPlugin(), () -> {
|
Bukkit.getScheduler().runTaskAsynchronously(PreventStabby.getPlugin(), () -> {
|
||||||
|
|
||||||
List<String> helpPage = new ArrayList<>();
|
List<String> helpPage = new ArrayList<>();
|
||||||
|
|
||||||
helpPage.add(PluginMessages.parseMessage("&b&m &bPreventStabby Help&b&m "));
|
helpPage.add(PluginMessages.parseMessage("&b&m &bPreventStabby Help&b&m "));
|
||||||
helpPage.add(PluginMessages.parseMessage("&9/pvp &b&lhelp &f- shows this message"));
|
helpPage.add(PluginMessages.parseMessage("&9/pvp &b&lhelp &f- shows this message"));
|
||||||
if (sender.hasPermission("preventstabby.command.toggle")) {
|
if (sender.hasPermission("preventstabby.command.toggle")) {
|
||||||
@@ -22,7 +20,6 @@ public class HelpCommand {
|
|||||||
}
|
}
|
||||||
String[] helpReady = helpPage.toArray(new String[0]);
|
String[] helpReady = helpPage.toArray(new String[0]);
|
||||||
sender.sendMessage(helpReady);
|
sender.sendMessage(helpReady);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ import org.bukkit.entity.Player;
|
|||||||
public class PvpToggleCommand {
|
public class PvpToggleCommand {
|
||||||
|
|
||||||
public static void toggle(CommandSender sender, String[] args) {
|
public static void toggle(CommandSender sender, String[] args) {
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(PreventStabby.getPlugin(), () -> {
|
Bukkit.getScheduler().runTaskAsynchronously(PreventStabby.getPlugin(), () -> {
|
||||||
|
|
||||||
if (!sender.hasPermission("preventstabby.command.toggle")) {
|
if (!sender.hasPermission("preventstabby.command.toggle")) {
|
||||||
String message = ChatColor.translateAlternateColorCodes('&', PreventStabby.getPlugin().getConfigCache().getNo_permission());
|
String message = ChatColor.translateAlternateColorCodes('&', PreventStabby.getPlugin().getConfigCache().getNo_permission());
|
||||||
sender.sendMessage(message);
|
sender.sendMessage(message);
|
||||||
@@ -47,7 +45,6 @@ public class PvpToggleCommand {
|
|||||||
sender.sendMessage(message);
|
sender.sendMessage(message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
if (CombatTimer.isInCombat(player.getUniqueId())) {
|
if (CombatTimer.isInCombat(player.getUniqueId())) {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import org.bukkit.command.CommandSender;
|
|||||||
public class ReloadCommand {
|
public class ReloadCommand {
|
||||||
|
|
||||||
public static void reload(CommandSender sender) {
|
public static void reload(CommandSender sender) {
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(PreventStabby.getPlugin(), () -> {
|
Bukkit.getScheduler().runTaskAsynchronously(PreventStabby.getPlugin(), () -> {
|
||||||
if (!sender.hasPermission("preventstabby.command.reload")) {
|
if (!sender.hasPermission("preventstabby.command.reload")) {
|
||||||
String message = ChatColor.translateAlternateColorCodes('&', PreventStabby.getPlugin().getConfigCache().getNo_permission());
|
String message = ChatColor.translateAlternateColorCodes('&', PreventStabby.getPlugin().getConfigCache().getNo_permission());
|
||||||
@@ -17,7 +16,6 @@ public class ReloadCommand {
|
|||||||
}
|
}
|
||||||
PreventStabby.getPlugin().reloadPluginConfig(sender);
|
PreventStabby.getPlugin().reloadPluginConfig(sender);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,9 +85,9 @@ public class ConfigCache {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
configFile.setDescription("PvP toggle that CARES about your pets!");
|
configFile.setDescription("Prevent people from getting stabbed!");
|
||||||
configFile.addLink("Spigot", "https://www.spigotmc.org/resources/togglepvp.89376/");
|
configFile.addLink("Spigot", "https://www.spigotmc.org/resources/89376/");
|
||||||
configFile.addLink("Source", "https://github.com/YouHaveTrouble/TogglePvP");
|
configFile.addLink("Source", "https://github.com/YouHaveTrouble/PreventStabby");
|
||||||
|
|
||||||
configFile.load();
|
configFile.load();
|
||||||
FileConfiguration config = configFile.getConfig();
|
FileConfiguration config = configFile.getConfig();
|
||||||
@@ -135,8 +135,6 @@ public class ConfigCache {
|
|||||||
this.entering_combat = config.getString("messages.entering_combat", "&cEntering combat");
|
this.entering_combat = config.getString("messages.entering_combat", "&cEntering combat");
|
||||||
this.leaving_combat = config.getString("messages.leaving_combat", "&cLeaving combat");
|
this.leaving_combat = config.getString("messages.leaving_combat", "&cLeaving combat");
|
||||||
this.cant_do_that_during_combat = config.getString("messages.cant_do_that_during_combat", "&cYou can't do that while in combat!");
|
this.cant_do_that_during_combat = config.getString("messages.cant_do_that_during_combat", "&cYou can't do that while in combat!");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class WorldGuardHook {
|
|||||||
public static void init() {
|
public static void init() {
|
||||||
PreventStabby plugin = PreventStabby.getPlugin();
|
PreventStabby plugin = PreventStabby.getPlugin();
|
||||||
try {
|
try {
|
||||||
Class.forName("com.sk89q.worldguard.protection.flags.registry.FlagConflictException");
|
Class.forName("com.sk89q.worldguard.protection.flags.registry.FlagRegistry");
|
||||||
WorldGuardPlugin worldGuardPlugin = WorldGuardPlugin.inst();
|
WorldGuardPlugin worldGuardPlugin = WorldGuardPlugin.inst();
|
||||||
if (WorldGuard.getInstance() == null || worldGuardPlugin == null) return;
|
if (WorldGuard.getInstance() == null || worldGuardPlugin == null) return;
|
||||||
plugin.getLogger().info("Hooking into WorldGuard");
|
plugin.getLogger().info("Hooking into WorldGuard");
|
||||||
|
|||||||
@@ -12,21 +12,21 @@ commands:
|
|||||||
aliases:
|
aliases:
|
||||||
- pvp
|
- pvp
|
||||||
permissions:
|
permissions:
|
||||||
toglepvp.combatcommandblock.bypass:
|
preventstabby.combatcommandblock.bypass:
|
||||||
default: op
|
default: op
|
||||||
description: Allows to bypass combat command blocker
|
description: Allows to bypass combat command blocker
|
||||||
toglepvp.combatteleportblock.bypass:
|
preventstabby.combatteleportblock.bypass:
|
||||||
default: op
|
default: op
|
||||||
description: Allows to bypass combat teleport blocker
|
description: Allows to bypass combat teleport blocker
|
||||||
togglepvp.command:
|
preventstabby.command:
|
||||||
default: true
|
default: true
|
||||||
description: Allows usage of /pvp command
|
description: Allows usage of /pvp command
|
||||||
togglepvp.command.toggle:
|
preventstabby.command.toggle:
|
||||||
default: true
|
default: true
|
||||||
description: Allows usage of /pvp <toggle/enable/disable> command
|
description: Allows usage of /pvp <toggle/enable/disable> command
|
||||||
togglepvp.command.toggle.others:
|
preventstabby.command.toggle.others:
|
||||||
default: op
|
default: op
|
||||||
description: Allows usage of /pvp <toggle/enable/disable> <player> command
|
description: Allows usage of /pvp <toggle/enable/disable> <player> command
|
||||||
togglepvp.command.reload:
|
preventstabby.command.reload:
|
||||||
default: op
|
default: op
|
||||||
description: Allows usage of /pvp reload command
|
description: Allows usage of /pvp reload command
|
||||||
Reference in New Issue
Block a user