mirror of
https://github.com/5vl/CorePlugin.git
synced 2025-05-23 20:17:01 +00:00
1.0.4
Removed /toggle and put the toggles in the config file due to some issues
This commit is contained in:
parent
0a2b9741ee
commit
750c6e9b5a
@ -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());
|
||||
}
|
||||
}
|
@ -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");
|
||||
|
@ -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) {
|
||||
|
@ -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");
|
||||
|
@ -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");
|
||||
|
@ -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.
|
||||
|
@ -25,5 +25,3 @@ commands:
|
||||
description: You can unban people with this!
|
||||
discord:
|
||||
description: Send your discord link in chat!
|
||||
toggle:
|
||||
description: You can toggle certain features with this!
|
Loading…
x
Reference in New Issue
Block a user