-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.2.0: Added Start and Stop - Cleaned up code
- Loading branch information
Showing
17 changed files
with
131 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 2 additions & 18 deletions
20
src/main/java/de/tamion/minecraft/commands/SetDCSyntax.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,15 @@ | ||
package de.tamion.minecraft.commands; | ||
|
||
import de.tamion.minecraft.MCMain; | ||
import de.tamion.others.Utils; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.configuration.file.FileConfiguration; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class SetDCSyntax implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, @NotNull String[] args) { | ||
if(!sender.hasPermission("DCChat.syntax") || !sender.hasPermission("DCChat.admin")) { | ||
sender.sendMessage("You are not allowed to execute this Command!"); | ||
return false; | ||
} | ||
if(!(args.length >= 1)) { | ||
sender.sendMessage("/setDCSyntax [Syntax]"); | ||
return false; | ||
} | ||
FileConfiguration config = MCMain.getPlugin().getConfig(); | ||
StringBuilder sb = new StringBuilder(); | ||
for(String wor: args) { | ||
sb.append(wor + " "); | ||
} | ||
config.set("Bot.dcsyntax", sb.toString()); | ||
MCMain.getPlugin().saveConfig(); | ||
sender.sendMessage("Syntax Set!"); | ||
sender.sendMessage(Utils.setsyntax(sender, "Bot.dcsyntax", String.join(" ", args))); | ||
return true; | ||
} | ||
} |
20 changes: 2 additions & 18 deletions
20
src/main/java/de/tamion/minecraft/commands/SetJoinSyntax.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,15 @@ | ||
package de.tamion.minecraft.commands; | ||
|
||
import de.tamion.minecraft.MCMain; | ||
import de.tamion.others.Utils; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.configuration.file.FileConfiguration; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class SetJoinSyntax implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, @NotNull String[] args) { | ||
if(!sender.hasPermission("DCChat.syntax") || !sender.hasPermission("DCChat.admin")) { | ||
sender.sendMessage("You are not allowed to execute this Command!"); | ||
return false; | ||
} | ||
if(!(args.length >= 1)) { | ||
sender.sendMessage("/setJoinSyntax [Syntax]"); | ||
return false; | ||
} | ||
FileConfiguration config = MCMain.getPlugin().getConfig(); | ||
StringBuilder sb = new StringBuilder(); | ||
for(String wor: args) { | ||
sb.append(wor+ " "); | ||
} | ||
config.set("Bot.joinsyntax", sb.toString()); | ||
MCMain.getPlugin().saveConfig(); | ||
sender.sendMessage("Syntax Set!"); | ||
sender.sendMessage(Utils.setsyntax(sender, "Bot.joinsyntax", String.join(" ", args))); | ||
return true; | ||
} | ||
} |
20 changes: 2 additions & 18 deletions
20
src/main/java/de/tamion/minecraft/commands/SetLeaveSyntax.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,15 @@ | ||
package de.tamion.minecraft.commands; | ||
|
||
import de.tamion.minecraft.MCMain; | ||
import de.tamion.others.Utils; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.configuration.file.FileConfiguration; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class SetLeaveSyntax implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, @NotNull String[] args) { | ||
if(!sender.hasPermission("DCChat.syntax") || !sender.hasPermission("DCChat.admin")) { | ||
sender.sendMessage("You are not allowed to execute this Command!"); | ||
return false; | ||
} | ||
if(!(args.length >= 1)) { | ||
sender.sendMessage("/setLeaveSyntax [Syntax]"); | ||
return false; | ||
} | ||
FileConfiguration config = MCMain.getPlugin().getConfig(); | ||
StringBuilder sb = new StringBuilder(); | ||
for(String wor: args) { | ||
sb.append(wor+ " "); | ||
} | ||
config.set("Bot.leavesyntax", sb.toString()); | ||
MCMain.getPlugin().saveConfig(); | ||
sender.sendMessage("Syntax Set!"); | ||
sender.sendMessage(Utils.setsyntax(sender, "Bot.leavesyntax", String.join(" ", args))); | ||
return true; | ||
} | ||
} |
20 changes: 2 additions & 18 deletions
20
src/main/java/de/tamion/minecraft/commands/SetMCSyntax.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,15 @@ | ||
package de.tamion.minecraft.commands; | ||
|
||
import de.tamion.minecraft.MCMain; | ||
import de.tamion.others.Utils; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.configuration.file.FileConfiguration; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class SetMCSyntax implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, @NotNull String[] args) { | ||
if(!sender.hasPermission("DCChat.syntax") || !sender.hasPermission("DCChat.admin")) { | ||
sender.sendMessage("You are not allowed to execute this Command!"); | ||
return false; | ||
} | ||
if(!(args.length >= 1)) { | ||
sender.sendMessage("/setMCSyntax [Syntax]"); | ||
return false; | ||
} | ||
FileConfiguration config = MCMain.getPlugin().getConfig(); | ||
StringBuilder sb = new StringBuilder(); | ||
for(String wor: args) { | ||
sb.append(wor+ " "); | ||
} | ||
config.set("Bot.mcsyntax", sb.toString()); | ||
MCMain.getPlugin().saveConfig(); | ||
sender.sendMessage("Syntax Set!"); | ||
sender.sendMessage(Utils.setsyntax(sender, "Bot.mcsyntax", String.join(" ", args))); | ||
return true; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/de/tamion/minecraft/commands/SetStartSyntax.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package de.tamion.minecraft.commands; | ||
|
||
import de.tamion.others.Utils; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class SetStartSyntax implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, @NotNull String[] args) { | ||
sender.sendMessage(Utils.setsyntax(sender, "Bot.startsyntax", String.join(" ", args))); | ||
return true; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/de/tamion/minecraft/commands/SetStopSyntax.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package de.tamion.minecraft.commands; | ||
|
||
import de.tamion.others.Utils; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandExecutor; | ||
import org.bukkit.command.CommandSender; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class SetStopSyntax implements CommandExecutor { | ||
@Override | ||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String label, @NotNull String[] args) { | ||
sender.sendMessage(Utils.setsyntax(sender, "Bot.stopsyntax", String.join(" ", args))); | ||
return true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.