diff --git a/java/coreplugin/coreplugin/Core.java b/java/coreplugin/coreplugin/Core.java index ed4c933..32d7f5d 100644 --- a/java/coreplugin/coreplugin/Core.java +++ b/java/coreplugin/coreplugin/Core.java @@ -10,7 +10,6 @@ import coreplugin.coreplugin.commands.heal; import coreplugin.coreplugin.commands.punish.ban; import coreplugin.coreplugin.commands.punish.kick; import coreplugin.coreplugin.commands.punish.unban; -import coreplugin.coreplugin.commands.toggle; import coreplugin.coreplugin.events.OnPlayerJoin; import coreplugin.coreplugin.events.OnPlayerLeave; import org.bukkit.plugin.PluginManager; @@ -43,6 +42,5 @@ public final class Core extends JavaPlugin { getCommand("ban").setExecutor(new ban()); getCommand("unban").setExecutor(new unban()); getCommand("discord").setExecutor(new discord()); - getCommand("toggle").setExecutor(new toggle()); } } \ No newline at end of file diff --git a/java/coreplugin/coreplugin/commands/discord.java b/java/coreplugin/coreplugin/commands/discord.java index f834136..eab25de 100644 --- a/java/coreplugin/coreplugin/commands/discord.java +++ b/java/coreplugin/coreplugin/commands/discord.java @@ -11,7 +11,7 @@ public class discord extends chatcolors implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { boolean t; - t = toggle.DiscordToggle; + t = Boolean.parseBoolean(Core.getInstance().getConfig().getString("DiscordCommand")); if (t) { if (label.equalsIgnoreCase("discord")) { String Discord = Core.getInstance().getConfig().getString("Discord"); diff --git a/java/coreplugin/coreplugin/commands/heal.java b/java/coreplugin/coreplugin/commands/heal.java index fa2b845..b130d6b 100644 --- a/java/coreplugin/coreplugin/commands/heal.java +++ b/java/coreplugin/coreplugin/commands/heal.java @@ -22,7 +22,7 @@ public class heal extends chatcolors implements CommandExecutor { ps.setHealth(20); ps.setFoodLevel(20); String HealOther = Core.getInstance().getConfig().getString("HealOther"); - p.sendMessage(color(HealOther + args[0])); + p.sendMessage(color(HealOther + " " + args[0])); } else { String InvalidArgument = Core.getInstance().getConfig().getString("InvalidArgument"); p.sendMessage(color(InvalidArgument)); @@ -34,8 +34,8 @@ public class heal extends chatcolors implements CommandExecutor { ps.setFoodLevel(20); String HealOther = Core.getInstance().getConfig().getString("HealOther"); String HealedOther = Core.getInstance().getConfig().getString("HealedOther"); - p.sendMessage(color(HealOther + args[0])); - ps.sendMessage(color(HealedOther + p.getPlayerListName())); + p.sendMessage(color(HealOther + " " + args[0])); + ps.sendMessage(color(HealedOther + " " + p.getPlayerListName())); } } catch (Exception e) { diff --git a/java/coreplugin/coreplugin/events/OnPlayerJoin.java b/java/coreplugin/coreplugin/events/OnPlayerJoin.java index 885b438..aacb6c9 100644 --- a/java/coreplugin/coreplugin/events/OnPlayerJoin.java +++ b/java/coreplugin/coreplugin/events/OnPlayerJoin.java @@ -1,7 +1,6 @@ package coreplugin.coreplugin.events; import coreplugin.coreplugin.Core; -import coreplugin.coreplugin.commands.toggle; import coreplugin.coreplugin.utils.chatcolors; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -12,7 +11,7 @@ public class OnPlayerJoin extends chatcolors implements Listener { @EventHandler public void OnPlayerJoin(PlayerJoinEvent event) { boolean t; - t = toggle.JoinToggle; + t = Boolean.parseBoolean(Core.getInstance().getConfig().getString("CustomJoinAndLeave")); if (t) { Player p = event.getPlayer(); String CustomJoin = Core.getInstance().getConfig().getString("CustomJoin"); diff --git a/java/coreplugin/coreplugin/events/OnPlayerLeave.java b/java/coreplugin/coreplugin/events/OnPlayerLeave.java index 5cbca3c..530569a 100644 --- a/java/coreplugin/coreplugin/events/OnPlayerLeave.java +++ b/java/coreplugin/coreplugin/events/OnPlayerLeave.java @@ -1,7 +1,6 @@ package coreplugin.coreplugin.events; import coreplugin.coreplugin.Core; -import coreplugin.coreplugin.commands.toggle; import coreplugin.coreplugin.utils.chatcolors; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -12,7 +11,7 @@ public class OnPlayerLeave extends chatcolors implements Listener { @EventHandler public void OnPlayerLeave(PlayerQuitEvent event){ boolean t; - t = toggle.LeaveToggle; + t = Boolean.parseBoolean(Core.getInstance().getConfig().getString("CustomJoinAndLeave")); if (t) { Player p = event.getPlayer(); String CustomLeave = Core.getInstance().getConfig().getString("CustomLeave"); diff --git a/resources/config.yml b/resources/config.yml index af0984a..f4846bf 100644 --- a/resources/config.yml +++ b/resources/config.yml @@ -1,3 +1,7 @@ +# Toggle features +DiscordCommand: true +CustomJoinAndLeave: true + # Gamemode messages CreativeSelf: '&aYour gamemode has been changed to &cCreative.' CreativeSetOther: '&aYou changed the gamemode to &cCreative &afor: &d' # Last color code is the color that the playername will show in. @@ -26,8 +30,8 @@ FlyDisabledOther: '&aYour fly has been &cdisabled &aby: &d' # Last color code is # Heal HealSelf: '&aYou have &chealed &ayourself.' -HealOther: '&aYou have &chealed &a:&d' # Last color code is the color that the playername will show in. -HealedOther: '&aYou have been &chealed &aby: &d' # Last color code is the color that the playername will show in. +HealOther: '&aYou have &chealed&a:&d' # Last color code is the color that the playername will show in. +HealedOther: '&aYou have been &chealed &aby:&d' # Last color code is the color that the playername will show in. # Punishments DefaultKick: 'You have been kicked from the server.' diff --git a/resources/plugin.yml b/resources/plugin.yml index 67dcd4a..15faaaa 100644 --- a/resources/plugin.yml +++ b/resources/plugin.yml @@ -24,6 +24,4 @@ commands: unban: description: You can unban people with this! discord: - description: Send your discord link in chat! - toggle: - description: You can toggle certain features with this! \ No newline at end of file + description: Send your discord link in chat! \ No newline at end of file