1.2.0
This commit is contained in:
commit
6b6ebbcd18
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
113
.gitignore
vendored
Normal file
113
.gitignore
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
# User-specific stuff
|
||||
.idea/
|
||||
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
*~
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
target/
|
||||
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
.flattened-pom.xml
|
||||
|
||||
# Common working directory
|
||||
run/
|
74
CommandGUI V1/pom.xml
Normal file
74
CommandGUI V1/pom.xml
Normal file
@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
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>de.jatitv</groupId>
|
||||
<artifactId>commandgui</artifactId>
|
||||
<version>1.2.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>CommandGUI</name>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>${java.version}</source>
|
||||
<target>${java.version}</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigotmc-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype</id>
|
||||
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.16.5-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
18
CommandGUI V1/src/main/java/de/jatitv/commandgui/TODO.java
Normal file
18
CommandGUI V1/src/main/java/de/jatitv/commandgui/TODO.java
Normal file
@ -0,0 +1,18 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
package de.jatitv.commandgui;
|
||||
|
||||
public class TODO {
|
||||
|
||||
// If you have ideas or wishes, please send them to me via Discord: https://discord.gg/vRyXFFterJ
|
||||
|
||||
// Wenn ihr ideen habt oder Wünsche denn meldet sie mir via Discord: https://discord.gg/vRyXFFterJ
|
||||
|
||||
|
||||
// ToDo for next Updates
|
||||
// ToDo e.setCancelled(true); für jeden slot in config
|
||||
// ToDo Title
|
||||
|
||||
// ToDo NO_Messages -> no_NO_Messages alle Sprachen
|
||||
|
||||
}
|
1140
CommandGUI V1/src/main/java/de/jatitv/commandgui/commands/GUI_1.java
Normal file
1140
CommandGUI V1/src/main/java/de/jatitv/commandgui/commands/GUI_1.java
Normal file
File diff suppressed because it is too large
Load Diff
1139
CommandGUI V1/src/main/java/de/jatitv/commandgui/commands/GUI_2.java
Normal file
1139
CommandGUI V1/src/main/java/de/jatitv/commandgui/commands/GUI_2.java
Normal file
File diff suppressed because it is too large
Load Diff
1140
CommandGUI V1/src/main/java/de/jatitv/commandgui/commands/GUI_3.java
Normal file
1140
CommandGUI V1/src/main/java/de/jatitv/commandgui/commands/GUI_3.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,122 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.commands;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
public class Give {
|
||||
|
||||
public static void giveCommand(CommandSender sender, String reciver, String wb) {
|
||||
Player target = Bukkit.getPlayer(reciver);
|
||||
boolean empty = false;
|
||||
for (int i = 0; i < target.getInventory().getSize() - 5; i++) {
|
||||
if (target.getInventory().getItem(i) == null) {
|
||||
empty = true;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (empty) {
|
||||
|
||||
if (wb.equals(DefaultValue_GUI_1.Command)) {
|
||||
ItemStack item = new ItemStack(Material.valueOf(DefaultValue_GUI_1.UseItem_Item));
|
||||
ItemMeta itemMeta = item.getItemMeta();
|
||||
itemMeta.setDisplayName(DefaultValue_GUI_1.UseItem_Name.replace("[guiname]", DefaultValue_GUI_1.GUIName));
|
||||
itemMeta.setLore(DefaultValue_GUI_1.UseItem_Lore);
|
||||
item.setItemMeta(itemMeta);
|
||||
item.setAmount(1);
|
||||
target.getInventory().addItem(item);
|
||||
|
||||
if (sender != target){
|
||||
sender.sendMessage(DefaultValue.give.replace("[sender]", sender.getName()).replace("[player]", target.getName())
|
||||
.replace("[item]", DefaultValue_GUI_1.UseItem_Name).replace("[guiname]", DefaultValue_GUI_1.GUIName));
|
||||
target.sendMessage(DefaultValue.giveReceived.replace("[sender]", sender.getName()).replace("[player]", target.getName())
|
||||
.replace("[item]", DefaultValue_GUI_1.UseItem_Name).replace("[guiname]", DefaultValue_GUI_1.GUIName));
|
||||
|
||||
} else {
|
||||
if (DefaultValue.Sound_Give_Enable && DefaultValue.Sound_Enable){
|
||||
target.playSound(target.getLocation(), DefaultValue.Sound_Give, 3, 1);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (wb.equals(DefaultValue_GUI_2.Command)) {
|
||||
ItemStack item = new ItemStack(Material.valueOf(DefaultValue_GUI_2.UseItem_Item));
|
||||
ItemMeta itemMeta = item.getItemMeta();
|
||||
itemMeta.setDisplayName(DefaultValue_GUI_2.UseItem_Name.replace("[guiname]", DefaultValue_GUI_2.GUIName));
|
||||
itemMeta.setLore(DefaultValue_GUI_2.UseItem_Lore);
|
||||
item.setItemMeta(itemMeta);
|
||||
item.setAmount(1);
|
||||
target.getInventory().addItem(item);
|
||||
|
||||
if (sender != target) {
|
||||
sender.sendMessage(DefaultValue.give.replace("[sender]", sender.getName()).replace("[player]", target.getName())
|
||||
.replace("[item]", DefaultValue_GUI_2.UseItem_Name).replace("[guiname]", DefaultValue_GUI_2.GUIName));
|
||||
target.sendMessage(DefaultValue.giveReceived.replace("[sender]", sender.getName()).replace("[player]", target.getName())
|
||||
.replace("[item]", DefaultValue_GUI_2.UseItem_Name).replace("[guiname]", DefaultValue_GUI_2.GUIName));
|
||||
if (DefaultValue.Sound_Give_Enable && DefaultValue.Sound_Enable) {
|
||||
((Player) sender).playSound(((Player) sender).getLocation(), DefaultValue.Sound_Give, 3, 1);
|
||||
target.playSound(target.getLocation(), DefaultValue.Sound_Give, 3, 1);
|
||||
}
|
||||
} else{
|
||||
if (DefaultValue.Sound_Give_Enable && DefaultValue.Sound_Enable) {
|
||||
target.playSound(target.getLocation(), DefaultValue.Sound_Give, 3, 1);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (wb.equals(DefaultValue_GUI_3.Command)) {
|
||||
ItemStack item = new ItemStack(Material.valueOf(DefaultValue_GUI_3.UseItem_Item));
|
||||
ItemMeta itemMeta = item.getItemMeta();
|
||||
itemMeta.setDisplayName(DefaultValue_GUI_3.UseItem_Name.replace("[guiname]", DefaultValue_GUI_3.GUIName));
|
||||
itemMeta.setLore(DefaultValue_GUI_3.UseItem_Lore);
|
||||
item.setItemMeta(itemMeta);
|
||||
item.setAmount(1);
|
||||
target.getInventory().addItem(item);
|
||||
|
||||
if (sender != target) {
|
||||
sender.sendMessage(DefaultValue.give.replace("[sender]", sender.getName()).replace("[player]", target.getName())
|
||||
.replace("[item]", DefaultValue_GUI_3.UseItem_Name).replace("[guiname]", DefaultValue_GUI_3.GUIName));
|
||||
target.sendMessage(DefaultValue.giveReceived.replace("[sender]", sender.getName()).replace("[player]", target.getName())
|
||||
.replace("[item]", DefaultValue_GUI_3.UseItem_Name).replace("[guiname]", DefaultValue_GUI_3.GUIName));
|
||||
if (DefaultValue.Sound_Give_Enable && DefaultValue.Sound_Enable) {
|
||||
((Player) sender).playSound(((Player) sender).getLocation(), DefaultValue.Sound_Give, 3, 1);
|
||||
target.playSound(target.getLocation(), DefaultValue.Sound_Give, 3, 1);
|
||||
}
|
||||
} else {
|
||||
if (DefaultValue.Sound_Give_Enable && DefaultValue.Sound_Enable) {
|
||||
target.playSound(target.getLocation(), DefaultValue.Sound_Give, 3, 1);
|
||||
}
|
||||
}
|
||||
|
||||
} else Help.Help(sender);
|
||||
} else {
|
||||
if (target == sender) {
|
||||
sender.sendMessage(DefaultValue.NoInventorySpace);
|
||||
} else {
|
||||
sender.sendMessage(DefaultValue.PlayerNoInventorySpace.replace("[player]", target.getName()));
|
||||
}
|
||||
if (sender instanceof Player) {
|
||||
if (DefaultValue.Sound_NoInventorySpace_Enable && DefaultValue.Sound_Enable) {
|
||||
((Player) sender).playSound(((Player) sender).getLocation(), DefaultValue.Sound_NoInventorySpace, 3, 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,64 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.commands;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class Help {
|
||||
|
||||
public static void Help(CommandSender sender) {
|
||||
if (sender.hasPermission("commandgui.command")
|
||||
|| sender.hasPermission("commandgui.command.info")
|
||||
|| sender.hasPermission("commandgui.admin")
|
||||
|| sender.isOp()) {
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " §8----- §4Command§9GUI §chelp §8-----");
|
||||
sender.sendMessage(DefaultValue.PrefixHC);
|
||||
if (sender.hasPermission("commandgui.command") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (DefaultValue.DefaultGUI == 1) {
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " " + DefaultValue.HelpCgui.replace("[gui]", DefaultValue_GUI_1.GUIName));
|
||||
} else if (DefaultValue.DefaultGUI == 2) {
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " " + DefaultValue.HelpCgui.replace("[gui]", DefaultValue_GUI_2.GUIName));
|
||||
} else if (DefaultValue.DefaultGUI == 3) {
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " " + DefaultValue.HelpCgui.replace("[gui]", DefaultValue_GUI_3.GUIName));
|
||||
}
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " " + DefaultValue.HelpHelp);
|
||||
}
|
||||
if (sender.hasPermission("commandgui.command.info") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " " + DefaultValue.HelpInfo);
|
||||
}
|
||||
|
||||
if (sender.hasPermission("commandgui.command.give") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " " + DefaultValue.HelpGive);
|
||||
|
||||
}
|
||||
if (!DefaultValue_GUI_1.Command_Permission_Enable || sender.hasPermission("commandgui.command.gui1") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (DefaultValue_GUI_1.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " " + DefaultValue.HelpOpen.replace("[gui]", DefaultValue_GUI_1.Command).replace("[guiname]", DefaultValue_GUI_1.GUIName));
|
||||
}
|
||||
}
|
||||
if (!DefaultValue_GUI_2.Command_Permission_Enable || sender.hasPermission("commandgui.command.gui2") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (DefaultValue_GUI_2.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " " + DefaultValue.HelpOpen.replace("[gui]", DefaultValue_GUI_2.Command).replace("[guiname]", DefaultValue_GUI_2.GUIName));
|
||||
}
|
||||
}
|
||||
if (!DefaultValue_GUI_3.Command_Permission_Enable || sender.hasPermission("commandgui.command.gui3") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (DefaultValue_GUI_3.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " " + DefaultValue.HelpOpen.replace("[gui]", DefaultValue_GUI_3.Command).replace("[guiname]", DefaultValue_GUI_3.GUIName));
|
||||
}
|
||||
}
|
||||
|
||||
if (sender.hasPermission("wonderbagshop.admin") || sender.isOp()) {
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " " + DefaultValue.HelpReload);
|
||||
}
|
||||
sender.sendMessage(DefaultValue.PrefixHC);
|
||||
sender.sendMessage(DefaultValue.PrefixHC + " §8----------------------------");
|
||||
} else {
|
||||
sender.sendMessage(DefaultValue.NoPermission);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,232 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.commands.cmdManagement;
|
||||
|
||||
import de.jatitv.commandgui.commands.*;
|
||||
import de.jatitv.commandgui.config.Messages_Select;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import de.jatitv.commandgui.system.Load;
|
||||
import de.jatitv.commandgui.system.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
|
||||
public class CmdExecuter implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
if (args.length == 0) {
|
||||
|
||||
|
||||
if (DefaultValue.DefaultGUI == 1) {
|
||||
if (!DefaultValue_GUI_1.Command_Permission_Enable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
if (DefaultValue_GUI_1.GUI_Enable || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
GUI_1.openCGUI(player);
|
||||
} else player.sendMessage(DefaultValue.GUIisDisable.replace("[gui]", DefaultValue_GUI_1.GUIName));
|
||||
} else player.sendMessage(DefaultValue.NoPermission.replace("[cmd]", "/commandgui").replace("[perm]", "commandgui.command"));
|
||||
} else if (DefaultValue.DefaultGUI == 2) {
|
||||
if (!DefaultValue_GUI_2.Command_Permission_Enable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
if (DefaultValue_GUI_2.GUI_Enable || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
GUI_2.openCGUI(player);
|
||||
} else player.sendMessage(DefaultValue.GUIisDisable.replace("[gui]", DefaultValue_GUI_2.GUIName));
|
||||
} else player.sendMessage(DefaultValue.NoPermission.replace("[cmd]", "/commandgui").replace("[perm]", "commandgui.command"));
|
||||
} else if (DefaultValue.DefaultGUI == 3) {
|
||||
if (!DefaultValue_GUI_3.Command_Permission_Enable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
if (DefaultValue_GUI_3.GUI_Enable || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
GUI_3.openCGUI(player);
|
||||
} else player.sendMessage(DefaultValue.GUIisDisable.replace("[gui]", DefaultValue_GUI_3.GUIName));
|
||||
} else player.sendMessage(DefaultValue.NoPermission.replace("[cmd]", "/commandgui").replace("[perm]", "commandgui.command"));
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "info":
|
||||
case "plugin":
|
||||
case "pl":
|
||||
case "version":
|
||||
case "ver":
|
||||
if (player.hasPermission("commandgui.command.info") || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§8-------- §4Plugin-Info §8--------");
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2This plugin was developed by §9JaTiTV");
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2Twitch: §ehttps://www.twitch.tv/jatitv");
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2Support-Discord: §e" + Main.DiscordLink);
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2Spigot: §e" + Main.Spigot);
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2Version: §6" + Main.getPlugin().getDescription().getVersion());
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§8-----------------------------");
|
||||
|
||||
if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4\n" + DefaultValue.PrefixHC + "§4Vault could not be connected / found! " +
|
||||
"§9Please download it here: §6https://www.spigotmc.org/resources/vault.34315/§4\n" + DefaultValue.PrefixHC);
|
||||
player.sendMessage(DefaultValue.PrefixHC + "§4\n" + DefaultValue.PrefixHC + "§4Vault could not be connected / found! " +
|
||||
"§9Please download it here: §6https://www.spigotmc.org/resources/vault.34315/§4\n" + DefaultValue.PrefixHC);
|
||||
}
|
||||
|
||||
} else {
|
||||
player.sendMessage(DefaultValue.NoPermissionForCommand.replace("[cmd]", "/commandgui info")
|
||||
.replace("[perm]", "commandgui.command.info"));
|
||||
}
|
||||
break;
|
||||
|
||||
case "open":
|
||||
if (args.length == 2) {
|
||||
if (args[1].equals(DefaultValue_GUI_1.Command)) {
|
||||
if (!DefaultValue_GUI_1.Command_Permission_Enable || player.hasPermission("commandgui.command.gui1") || player.hasPermission("commandgui.admin")
|
||||
|| player.isOp()) {
|
||||
if (DefaultValue_GUI_1.GUI_Enable || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
GUI_1.openCGUI(player);
|
||||
} else {
|
||||
player.sendMessage(DefaultValue.GUIisDisable.replace("[gui]", DefaultValue_GUI_1.GUIName));
|
||||
}
|
||||
} else player.sendMessage(DefaultValue.NoPermissionForCommand.replace("[cmd]", "/commandgui " + DefaultValue_GUI_1.Command)
|
||||
.replace("[perm]", "commandgui.command.gui1"));
|
||||
|
||||
|
||||
} else if (args[1].equals(DefaultValue_GUI_2.Command)) {
|
||||
if (!DefaultValue_GUI_2.Command_Permission_Enable || player.hasPermission("commandgui.command.gui2") || player.hasPermission("commandgui.admin")
|
||||
|| player.isOp()) {
|
||||
if (DefaultValue_GUI_2.GUI_Enable || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
GUI_2.openCGUI(player);
|
||||
} else {
|
||||
player.sendMessage(DefaultValue.GUIisDisable.replace("[gui]", DefaultValue_GUI_2.GUIName));
|
||||
}
|
||||
} else player.sendMessage(DefaultValue.NoPermissionForCommand.replace("[cmd]", "/commandgui " + DefaultValue_GUI_2.Command)
|
||||
.replace("[perm]", "commandgui.command.gui2"));
|
||||
|
||||
|
||||
} else if (args[1].equals(DefaultValue_GUI_3.Command)) {
|
||||
if (!DefaultValue_GUI_3.Command_Permission_Enable || player.hasPermission("commandgui.command.gui3") || player.hasPermission("commandgui.admin")
|
||||
|| player.isOp()) {
|
||||
if (DefaultValue_GUI_3.GUI_Enable || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
GUI_3.openCGUI(player);
|
||||
} else {
|
||||
player.sendMessage(DefaultValue.GUIisDisable.replace("[gui]", DefaultValue_GUI_3.GUIName));
|
||||
}
|
||||
} else player.sendMessage(DefaultValue.NoPermissionForCommand.replace("[cmd]", "/commandgui " + DefaultValue_GUI_3.Command)
|
||||
.replace("[perm]", "commandgui.command.gui3"));
|
||||
} else Help.Help(sender);
|
||||
} else Help.Help(sender);
|
||||
break;
|
||||
|
||||
case "give":
|
||||
if (args.length == 3) {
|
||||
if (player.hasPermission("commandgui.command.give") || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
if (Bukkit.getPlayer(args[1]) != null) {
|
||||
Give.giveCommand(sender, args[1], args[2]);
|
||||
} else {
|
||||
sender.sendMessage(DefaultValue.PlayerNotFound.replace("[player]", args[1]));
|
||||
if (DefaultValue.Sound_PlayerNotFound_Enable && DefaultValue.Sound_Enable) {
|
||||
((Player) sender).playSound(((Player) sender).getLocation(), DefaultValue.Sound_PlayerNotFound, 3, 1);
|
||||
}
|
||||
}
|
||||
} else player.sendMessage(DefaultValue.NoPermissionForCommand.replace("[cmd]", "/commandgui give")
|
||||
.replace("[perm]", "commandgui.command.give"));
|
||||
} else Help.Help(sender);
|
||||
break;
|
||||
|
||||
case "reload":
|
||||
case "rl":
|
||||
if (player.hasPermission("commandgui.command.reload") || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
if (sender instanceof Player) sender.sendMessage(DefaultValue.PrefixHC + DefaultValue.ReloadStart);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§6Plugin reload...");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
|
||||
try {
|
||||
Load.LoadSend(Main.getPlugin().getDescription().getVersion());
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (sender instanceof Player) sender.sendMessage(DefaultValue.PrefixHC + DefaultValue.ReloadEnd);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2Plugin successfully reloaded.");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
} else {
|
||||
player.sendMessage(DefaultValue.NoPermissionForCommand.replace("[cmd]", "/commandgui reload")
|
||||
.replace("[perm]", "commandgui.command.reload"));
|
||||
}
|
||||
break;
|
||||
|
||||
case "help":
|
||||
default:
|
||||
Help.Help(sender);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
if (args.length == 1 || args.length == 2 || args.length == 3) {
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "info":
|
||||
case "plugin":
|
||||
case "pl":
|
||||
case "version":
|
||||
case "ver":
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§8-------- §4Plugin-Info §8--------");
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2This plugin was developed by §9JaTiTV");
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2Twitch: §ehttps://www.twitch.tv/jatitv");
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2Support-Discord: §e" + Main.DiscordLink);
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2Spigot: §e" + Main.Spigot);
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§2Version: §6" + Main.getPlugin().getDescription().getVersion());
|
||||
sender.sendMessage(DefaultValue.PrefixHC + "§8-----------------------------");
|
||||
|
||||
if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4\n" + DefaultValue.PrefixHC + "§4Vault could not be connected / found! " +
|
||||
"§9Please download it here: §6https://www.spigotmc.org/resources/vault.34315/§4\n" + DefaultValue.PrefixHC);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Help.Help(sender);
|
||||
break;
|
||||
case "rl":
|
||||
case "reload":
|
||||
if (sender instanceof Player) sender.sendMessage(DefaultValue.PrefixHC + DefaultValue.ReloadStart);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§6Plugin reload...");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
|
||||
Bukkit.getServer().getPluginManager().disablePlugin(Main.getPlugin());
|
||||
|
||||
Bukkit.getPluginManager().getPlugin(Main.plugin.getName()).getPluginLoader().enablePlugin(Main.getPlugin());
|
||||
if (sender instanceof Player) sender.sendMessage(DefaultValue.PrefixHC + DefaultValue.ReloadEnd);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2Plugin successfully reloaded.");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
break;
|
||||
|
||||
case "give":
|
||||
if (args.length == 3) {
|
||||
if (Bukkit.getPlayer(args[1]) != null) {
|
||||
Give.giveCommand(sender, args[1], args[2]);
|
||||
} else {
|
||||
sender.sendMessage(DefaultValue.PlayerNotFound.replace("[player]", args[1]));
|
||||
if (sender instanceof Player) {
|
||||
if (DefaultValue.Sound_PlayerNotFound_Enable && DefaultValue.Sound_Enable) {
|
||||
((Player) sender).playSound(((Player) sender).getLocation(), DefaultValue.Sound_PlayerNotFound, 3, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else Help.Help(sender);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage("§8[§6Command§9GUI§8] §cThis command is only for players!");
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package de.jatitv.commandgui.commands.cmdManagement;
|
||||
|
||||
import de.jatitv.commandgui.commands.GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class RegisterCommands_GUI_1 extends Command {
|
||||
private String alias;
|
||||
|
||||
public RegisterCommands_GUI_1(String alias) {
|
||||
super(alias);
|
||||
this.alias = alias;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
if (!DefaultValue_GUI_1.Command_Permission_Enable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
if (DefaultValue_GUI_1.GUI_Enable || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
GUI_1.openCGUI(player);
|
||||
} else player.sendMessage(DefaultValue.GUIisDisable.replace("[gui]", DefaultValue_GUI_1.GUIName));
|
||||
} else player.sendMessage(DefaultValue.NoPermission.replace("[cmd]", "/commandgui").replace("[perm]", "commandgui.command"));
|
||||
} else sender.sendMessage("§8[§6Command§9GUI§8] §cThis command is only for players!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,32 @@
|
||||
package de.jatitv.commandgui.commands.cmdManagement;
|
||||
|
||||
import de.jatitv.commandgui.commands.GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class RegisterCommands_GUI_2 extends Command {
|
||||
private String alias;
|
||||
|
||||
public RegisterCommands_GUI_2(String alias) {
|
||||
super(alias);
|
||||
this.alias = alias;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
if (!DefaultValue_GUI_2.Command_Permission_Enable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
if (DefaultValue_GUI_2.GUI_Enable || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
GUI_2.openCGUI(player);
|
||||
} else player.sendMessage(DefaultValue.GUIisDisable.replace("[gui]", DefaultValue_GUI_2.GUIName));
|
||||
} else player.sendMessage(DefaultValue.NoPermission.replace("[cmd]", "/commandgui").replace("[perm]", "commandgui.command"));
|
||||
} else sender.sendMessage("§8[§6Command§9GUI§8] §cThis command is only for players!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,32 @@
|
||||
package de.jatitv.commandgui.commands.cmdManagement;
|
||||
|
||||
import de.jatitv.commandgui.commands.GUI_3;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class RegisterCommands_GUI_3 extends Command {
|
||||
private String alias;
|
||||
|
||||
public RegisterCommands_GUI_3(String alias) {
|
||||
super(alias);
|
||||
this.alias = alias;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
if (!DefaultValue_GUI_3.Command_Permission_Enable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
if (DefaultValue_GUI_3.GUI_Enable || player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
GUI_3.openCGUI(player);
|
||||
} else player.sendMessage(DefaultValue.GUIisDisable.replace("[gui]", DefaultValue_GUI_3.GUIName));
|
||||
} else player.sendMessage(DefaultValue.NoPermission.replace("[cmd]", "/commandgui").replace("[perm]", "commandgui.command"));
|
||||
} else sender.sendMessage("§8[§6Command§9GUI§8] §cThis command is only for players!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,131 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.commands.cmdManagement;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class TabComplete implements TabCompleter {
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command command, String lable, String[] args) {
|
||||
if (sender instanceof Player) {
|
||||
List<String> list = new ArrayList<>();
|
||||
if (args.length == 0 || args.length == 1) {
|
||||
if (args[0].isEmpty()) {
|
||||
|
||||
if (sender.hasPermission("commandgui.command")
|
||||
|| sender.hasPermission("commandgui.command.gui1") || sender.hasPermission("commandgui.command.gui2") || sender.hasPermission("commandgui.command.gui3")
|
||||
|| sender.hasPermission("commandgui.command.info") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add("help");
|
||||
}
|
||||
if (sender.hasPermission("commandgui.command.info") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add("info");
|
||||
}
|
||||
if (sender.hasPermission("commandgui.command.give") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add("give");
|
||||
}
|
||||
if (!DefaultValue_GUI_1.Command_Permission_Enable || !DefaultValue_GUI_2.Command_Permission_Enable || !DefaultValue_GUI_2.Command_Permission_Enable
|
||||
|| sender.hasPermission("commandgui.command.gui1") || sender.hasPermission("commandgui.command.gui2") || sender.hasPermission("commandgui.command.gui3")
|
||||
|| sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add("open");
|
||||
}
|
||||
if (sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add("reload");
|
||||
}
|
||||
return list;
|
||||
}
|
||||
if (args[0].charAt(0) == 'h') {
|
||||
if (sender.hasPermission("commandgui.command")
|
||||
|| sender.hasPermission("commandgui.command.gui1") || sender.hasPermission("commandgui.command.gui2") || sender.hasPermission("commandgui.command.gui3")
|
||||
|| sender.hasPermission("commandgui.command.info") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add("help");
|
||||
}
|
||||
|
||||
} else if (args[0].charAt(0) == 'i') {
|
||||
if (sender.hasPermission("commandgui.command.info") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add("info");
|
||||
}
|
||||
|
||||
} else if (args[0].charAt(0) == 'o') {
|
||||
if (!DefaultValue_GUI_1.Command_Permission_Enable || !DefaultValue_GUI_2.Command_Permission_Enable || !DefaultValue_GUI_3.Command_Permission_Enable
|
||||
|| sender.hasPermission("commandgui.command.gui1") || sender.hasPermission("commandgui.command.gui2") || sender.hasPermission("commandgui.command.gui3")
|
||||
|| sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add("open");
|
||||
}
|
||||
|
||||
} else if (args[0].charAt(0) == 'g') {
|
||||
if (sender.hasPermission("commandgui.command.give") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add("give");
|
||||
}
|
||||
|
||||
} else if (args[0].charAt(0) == 'r') {
|
||||
if (sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add("reload");
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("open")) {
|
||||
if (DefaultValue_GUI_1.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (!DefaultValue_GUI_1.Command_Permission_Enable || sender.hasPermission("commandgui.command.gui1") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_1.Command);
|
||||
}
|
||||
}
|
||||
if (DefaultValue_GUI_2.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (!DefaultValue_GUI_2.Command_Permission_Enable || sender.hasPermission("commandgui.command.gui2") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_2.Command);
|
||||
}
|
||||
}
|
||||
if (DefaultValue_GUI_3.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (!DefaultValue_GUI_3.Command_Permission_Enable || sender.hasPermission("commandgui.command.gui3") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_3.Command);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("give")) {
|
||||
if (sender.hasPermission("commandgui.command.give") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
Iterator var6 = Bukkit.getOnlinePlayers().iterator();
|
||||
|
||||
while (var6.hasNext()) {
|
||||
Player player1 = (Player) var6.next();
|
||||
list.add(player1.getName());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
|
||||
} else {
|
||||
if (args.length == 3 && args[0].equalsIgnoreCase("give")) {
|
||||
if (args[2].isEmpty()) {
|
||||
if (sender.hasPermission("commandgui.command.give") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (DefaultValue_GUI_1.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_1.Command);
|
||||
}
|
||||
if (DefaultValue_GUI_2.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_2.Command);
|
||||
}
|
||||
if (DefaultValue_GUI_3.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_3.Command);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new ArrayList();
|
||||
}
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.commands.cmdManagement;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class TabCompleteNEW implements TabCompleter {
|
||||
|
||||
private static HashMap<String, String> arg1 = new HashMap<String, String>() {{
|
||||
put("help", "commandgui.admin;commandgui.command.info;commandgui.command.gui1;commandgui.command.gui2;commandgui.command.gui3;commandgui.command");
|
||||
put("info", "commandgui.admin;commandgui.command.info");
|
||||
put("give", "commandgui.admin;commandgui.command.give");
|
||||
if (!DefaultValue_GUI_1.Command_Permission_Enable || !DefaultValue_GUI_2.Command_Permission_Enable || !DefaultValue_GUI_3.Command_Permission_Enable){
|
||||
put("open", null);
|
||||
} else put("open", "commandgui.admin;commandgui.command.gui1;commandgui.command.gui2;commandgui.command.gui3");
|
||||
|
||||
put("reload", "commandgui.admin");
|
||||
}};
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command cmd, String s, String[] args) {
|
||||
List<String> list = new ArrayList<>();
|
||||
if (sender instanceof Player) {
|
||||
Player p = (Player) sender;
|
||||
if (args.length == 1) {
|
||||
for (String command : arg1.keySet()) {
|
||||
Boolean passend = true;
|
||||
for (int i = 0; i < args[0].length(); i++) {
|
||||
if (args[0].length() >= command.length()) {
|
||||
passend = false;
|
||||
} else {
|
||||
if (args[0].charAt(i) != command.charAt(i)) {
|
||||
passend = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasPermission(p, arg1.get(command)) && passend) {
|
||||
list.add(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("open")) {
|
||||
if (!DefaultValue_GUI_1.Command_Permission_Enable || sender.hasPermission("commandgui.command.gui1") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (DefaultValue_GUI_1.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_1.Command);
|
||||
}
|
||||
}
|
||||
if (!DefaultValue_GUI_2.Command_Permission_Enable || sender.hasPermission("commandgui.command.gui2") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (DefaultValue_GUI_2.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_2.Command);
|
||||
}
|
||||
}
|
||||
|
||||
if (!DefaultValue_GUI_3.Command_Permission_Enable || sender.hasPermission("commandgui.command.gui3") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (DefaultValue_GUI_3.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_3.Command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (args.length == 2) {
|
||||
switch (args[0]) {
|
||||
case "give":
|
||||
if (hasPermission(p, arg1.get("give"))) {
|
||||
for (Player player : Bukkit.getOnlinePlayers()) {
|
||||
Boolean passend = true;
|
||||
for (int i = 0; i < args[1].length(); i++) {
|
||||
if (args[1].length() >= player.getName().length()) {
|
||||
passend = false;
|
||||
} else {
|
||||
if (args[1].charAt(i) != player.getName().charAt(i)) {
|
||||
passend = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasPermission(p, arg1.get(player)) && passend) {
|
||||
list.add(player.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (args.length == 3 && args[0].equalsIgnoreCase("give")) {
|
||||
if (args[2].isEmpty()) {
|
||||
if (sender.hasPermission("commandgui.command.give") || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
if (DefaultValue_GUI_1.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_1.Command);
|
||||
}
|
||||
if (DefaultValue_GUI_2.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_2.Command);
|
||||
}
|
||||
if (DefaultValue_GUI_3.GUI_Enable || sender.hasPermission("commandgui.admin") || sender.isOp()) {
|
||||
list.add(DefaultValue_GUI_3.Command);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static boolean hasPermission(Player player, String permission) {
|
||||
if (player.isOp()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String[] Permissions = permission.split(";");
|
||||
for (String perm : Permissions) {
|
||||
if (player.hasPermission(perm)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,249 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.config;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.system.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Config {
|
||||
|
||||
public static void configCreate(String version) {
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Config.yml load...");
|
||||
|
||||
File configYML = new File(Main.thisp().getDataFolder().getPath(), "Config.yml");
|
||||
YamlConfiguration yamlConfiguration_config = YamlConfiguration.loadConfiguration(configYML);
|
||||
|
||||
if (!yamlConfiguration_config.contains("Do_not_remove_or_change.Created"))
|
||||
yamlConfiguration_config.set("Do_not_remove_or_change.Created", "This file was created with version " + version);
|
||||
yamlConfiguration_config.set("Do_not_remove_or_change.Version", version);
|
||||
yamlConfiguration_config.set("Do_not_remove_or_change.Autor", Main.Autor);
|
||||
yamlConfiguration_config.set("Do_not_remove_or_change.Spigot", Main.Spigot);
|
||||
yamlConfiguration_config.set("Do_not_remove_or_change.Discord", Main.DiscordMSG);
|
||||
|
||||
if (yamlConfiguration_config.contains("Plugin.UpdateCheckOnJoin")) {
|
||||
DefaultValue.UpdateCheckOnJoin = yamlConfiguration_config.getBoolean("Plugin.UpdateCheckOnJoin");
|
||||
} else {
|
||||
yamlConfiguration_config.set("Plugin.UpdateCheckOnJoin", DefaultValue.UpdateCheckOnJoin);
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6UpdateCheckOnJoin §4was added to §9Config.yml§4!");
|
||||
}
|
||||
if (yamlConfiguration_config.contains("Plugin.language")) {
|
||||
DefaultValue.language = yamlConfiguration_config.getString("Plugin.language");
|
||||
} else {
|
||||
yamlConfiguration_config.set("Plugin.language", DefaultValue.language);
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6language §4was added to §9Config.yml§4!");
|
||||
}
|
||||
/*
|
||||
if (yamlConfiguration_config.contains("Plugin.Debug.Enable")) {
|
||||
DefultValue.Debug = yamlConfiguration_config.getBoolean("Plugin.Debug.Enable");
|
||||
} else {
|
||||
yamlConfiguration_config.set("Plugin.Debug.Enable", DefultValue.Debug);
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefultValue.PrefixHC + "§4Setting §6Debug Enable §4was added to §9Config.yml§4!");
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
if (yamlConfiguration_config.contains("Cost.Currency")) {
|
||||
DefaultValue.Currency = yamlConfiguration_config.getString("Cost.Currency");
|
||||
} else {
|
||||
yamlConfiguration_config.set("Cost.Currency", DefaultValue.Currency);
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Cost Currency §4was added to §9Config.yml§4!");
|
||||
}
|
||||
|
||||
if (yamlConfiguration_config.contains("GUI.DefaultGUI")) {
|
||||
DefaultValue.DefaultGUI = yamlConfiguration_config.getInt("GUI.DefaultGUI");
|
||||
} else {
|
||||
yamlConfiguration_config.set("GUI.DefaultGUI", DefaultValue.DefaultGUI);
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6GUI DefaultGUI §4was added to §9Config.yml§4!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*Sound
|
||||
*/
|
||||
|
||||
String soundEPL;
|
||||
if (Main.minecraft1_8) {
|
||||
soundEPL = "LEVEL_UP";
|
||||
} else {
|
||||
soundEPL = "ENTITY_PLAYER_LEVELUP";
|
||||
}
|
||||
|
||||
String soundHAT;
|
||||
if (Main.minecraft1_8) {
|
||||
soundHAT = "NOTE_STICKS";
|
||||
} else if (Main.minecraft1_9 || Main.minecraft1_10 || Main.minecraft1_11 || Main.minecraft1_12) {
|
||||
soundHAT = "BLOCK_NOTE_HAT";
|
||||
} else {
|
||||
soundHAT = "BLOCK_NOTE_BLOCK_HAT";
|
||||
}
|
||||
|
||||
String soundBNBH;
|
||||
if (Main.minecraft1_8) {
|
||||
soundBNBH = "NOTE_PIANO";
|
||||
} else if (Main.minecraft1_9 || Main.minecraft1_10 || Main.minecraft1_11 || Main.minecraft1_12) {
|
||||
soundBNBH = "BLOCK_NOTE_HARP";
|
||||
} else {
|
||||
soundBNBH = "BLOCK_NOTE_BLOCK_HARP";
|
||||
}
|
||||
|
||||
String soundBNBG;
|
||||
if (Main.minecraft1_8) {
|
||||
soundBNBG = "NOTE_PIANO";
|
||||
} else if (Main.minecraft1_9 || Main.minecraft1_10 || Main.minecraft1_11 || Main.minecraft1_12) {
|
||||
soundBNBG = "BLOCK_NOTE_BASS";
|
||||
} else {
|
||||
soundBNBG = "BLOCK_NOTE_BLOCK_GUITAR";
|
||||
}
|
||||
|
||||
if (yamlConfiguration_config.contains("Sound.Enable")) {
|
||||
DefaultValue.Sound_Enable = yamlConfiguration_config.getBoolean("Sound.Enable");
|
||||
} else {
|
||||
yamlConfiguration_config.set("Sound.Enable", true);
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Sound Enable §4was added to §9Config.yml§4!");
|
||||
}
|
||||
|
||||
if (yamlConfiguration_config.contains("Sound.Click.Enable")) {
|
||||
DefaultValue.Sound_Click_Enable = yamlConfiguration_config.getBoolean("Sound.Click.Enable");
|
||||
} else {
|
||||
yamlConfiguration_config.set("Sound.Click.Enable", true);
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Sound Click Enable §4was added to §9Config.yml§4!");
|
||||
}
|
||||
if (yamlConfiguration_config.contains("Sound.Click.Sound")) {
|
||||
DefaultValue.Sound_Click_input = (yamlConfiguration_config.getString("Sound.Click.Sound").toUpperCase().replace(".", "_"));
|
||||
} else {
|
||||
yamlConfiguration_config.set("Sound.Click.Sound", soundHAT);
|
||||
DefaultValue.Sound_Click_input = soundHAT;
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Sound Click §4was added to §9Config.yml§4!");
|
||||
}
|
||||
|
||||
|
||||
if (yamlConfiguration_config.contains("Sound.NoMoney.Enable")) {
|
||||
DefaultValue.Sound_NoMoney_Enable = yamlConfiguration_config.getBoolean("Sound.NoMoney.Enable");
|
||||
} else {
|
||||
yamlConfiguration_config.set("Sound.NoMoney.Enable", true);
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Sound NoMoney Enable §4was added to §9Config.yml§4!");
|
||||
}
|
||||
if (yamlConfiguration_config.contains("Sound.NoMoney.Sound")) {
|
||||
DefaultValue.Sound_NoMoney_input = (yamlConfiguration_config.getString("Sound.NoMoney.Sound").toUpperCase().replace(".", "_"));
|
||||
} else {
|
||||
yamlConfiguration_config.set("Sound.NoMoney.Sound", soundBNBH);
|
||||
DefaultValue.Sound_NoMoney_input = soundBNBH;
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Sound NoMoney §4was added to §9Config.yml§4!");
|
||||
}
|
||||
|
||||
|
||||
if (yamlConfiguration_config.contains("Sound.NoInventorySpace.Enable")) {
|
||||
DefaultValue.Sound_NoInventorySpace_Enable = yamlConfiguration_config.getBoolean("Sound.NoInventorySpace.Enable");
|
||||
} else {
|
||||
yamlConfiguration_config.set("Sound.NoInventorySpace.Enable", true);
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Sound NoInventorySpace Enable §4was added to §9Config.yml§4!");
|
||||
}
|
||||
if (yamlConfiguration_config.contains("Sound.NoInventorySpace.Sound")) {
|
||||
DefaultValue.Sound_NoInventorySpace_input = (yamlConfiguration_config.getString("Sound.NoInventorySpace.Sound").toUpperCase().replace(".", "_"));
|
||||
} else {
|
||||
yamlConfiguration_config.set("Sound.NoInventorySpace.Sound", soundBNBG);
|
||||
DefaultValue.Sound_NoInventorySpace_input = soundBNBG;
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Sound NoInventorySpace §4was added to §9Config.yml§4!");
|
||||
}
|
||||
|
||||
|
||||
if (yamlConfiguration_config.contains("Sound.Give.Enable")) {
|
||||
DefaultValue.Sound_Give_Enable = yamlConfiguration_config.getBoolean("Sound.Give.Enable");
|
||||
} else {
|
||||
yamlConfiguration_config.set("Sound.Give.Enable", true);
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Sound Give Enable §4was added to §9Config.yml§4!");
|
||||
}
|
||||
if (yamlConfiguration_config.contains("Sound.Give.Sound")) {
|
||||
DefaultValue.Sound_Give_input = (yamlConfiguration_config.getString("Sound.Give.Sound").toUpperCase().replace(".", "_"));
|
||||
} else {
|
||||
yamlConfiguration_config.set("Sound.Give.Sound", soundEPL);
|
||||
DefaultValue.Sound_Give_input = soundEPL;
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Sound Give §4was added to §9Config.yml§4!");
|
||||
}
|
||||
|
||||
|
||||
if (yamlConfiguration_config.contains("Sound.PlayerNotFound.Enable")) {
|
||||
DefaultValue.Sound_PlayerNotFound_Enable = yamlConfiguration_config.getBoolean("Sound.PlayerNotFound.Enable");
|
||||
} else {
|
||||
yamlConfiguration_config.set("Sound.PlayerNotFound.Enable", true);
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Sound PlayerNotFound Enable §4was added to §9Config.yml§4!");
|
||||
}
|
||||
if (yamlConfiguration_config.contains("Sound.PlayerNotFound.Sound")) {
|
||||
DefaultValue.Sound_PlayerNotFound_input = (yamlConfiguration_config.getString("Sound.PlayerNotFound.Sound").toUpperCase().replace(".", "_"));
|
||||
} else {
|
||||
yamlConfiguration_config.set("Sound.PlayerNotFound.Sound", soundBNBH);
|
||||
DefaultValue.Sound_PlayerNotFound_input = soundBNBH;
|
||||
if (configYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Setting §6Sound Send §4was added to §9Config.yml§4!");
|
||||
}
|
||||
|
||||
try {
|
||||
yamlConfiguration_config.save(configYML);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
Sound sound_Click = Sound.valueOf(DefaultValue.Sound_Click_input);
|
||||
if (sound_Click != null) {
|
||||
DefaultValue.Sound_Click = sound_Click;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Bukkit.getConsoleSender().sendMessage("§4\n§4\n§4\n" + DefaultValue.SoundNotFound.replace("[prefix]", DefaultValue.Prefix)
|
||||
.replace("[sound]", "§8Click: §6" + DefaultValue.Sound_Click_input) + "§4\n§4\n§4\n");
|
||||
DefaultValue.Sound_Click = Sound.valueOf(soundHAT);
|
||||
}
|
||||
|
||||
try {
|
||||
Sound sound_NoMoney = Sound.valueOf(DefaultValue.Sound_NoMoney_input);
|
||||
if (sound_NoMoney != null) {
|
||||
DefaultValue.Sound_NoMoney = sound_NoMoney;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Bukkit.getConsoleSender().sendMessage("§4\n§4\n§4\n" + DefaultValue.SoundNotFound.replace("[prefix]", DefaultValue.Prefix)
|
||||
.replace("[sound]", "§8NoMoney: §6" + DefaultValue.Sound_NoMoney_input) + "§4\n§4\n§4\n");
|
||||
DefaultValue.Sound_NoMoney = Sound.valueOf(soundBNBH);
|
||||
}
|
||||
|
||||
try {
|
||||
Sound sound_Give = Sound.valueOf(DefaultValue.Sound_Give_input);
|
||||
if (sound_Give != null) {
|
||||
DefaultValue.Sound_Give = sound_Give;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Bukkit.getConsoleSender().sendMessage("§4\n§4\n§4\n" + DefaultValue.SoundNotFound.replace("[prefix]", DefaultValue.Prefix)
|
||||
.replace("[sound]", "§8Give: §6" + DefaultValue.Sound_Give_input) + "§4\n§4\n§4\n");
|
||||
DefaultValue.Sound_Give = Sound.valueOf(soundEPL);
|
||||
}
|
||||
|
||||
try {
|
||||
Sound sound_NoInventorySpace = Sound.valueOf(DefaultValue.Sound_NoInventorySpace_input);
|
||||
if (sound_NoInventorySpace != null) {
|
||||
DefaultValue.Sound_NoInventorySpace = sound_NoInventorySpace;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Bukkit.getConsoleSender().sendMessage("§4\n§4\n§4\n" + DefaultValue.SoundNotFound.replace("[prefix]", DefaultValue.Prefix)
|
||||
.replace("[sound]", "§8sound_NoInventorySpace: §6" + DefaultValue.Sound_NoInventorySpace_input) + "§4\n§4\n§4\n");
|
||||
DefaultValue.Sound_NoInventorySpace = Sound.valueOf(soundBNBG);
|
||||
}
|
||||
|
||||
try {
|
||||
Sound sound_PlayerNotFound = Sound.valueOf(DefaultValue.Sound_PlayerNotFound_input);
|
||||
if (sound_PlayerNotFound != null) {
|
||||
DefaultValue.Sound_PlayerNotFound = sound_PlayerNotFound;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Bukkit.getConsoleSender().sendMessage("§4\n§4\n§4\n" + DefaultValue.SoundNotFound.replace("[prefix]", DefaultValue.Prefix)
|
||||
.replace("[sound]", "§8PlayerNotFound: §6" + DefaultValue.Sound_PlayerNotFound_input) + "§4\n§4\n§4\n");
|
||||
DefaultValue.Sound_PlayerNotFound = Sound.valueOf(soundBNBH);
|
||||
}
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2Config.yml loaded successfully.");
|
||||
}
|
||||
}
|
4439
CommandGUI V1/src/main/java/de/jatitv/commandgui/config/GUI_1.java
Normal file
4439
CommandGUI V1/src/main/java/de/jatitv/commandgui/config/GUI_1.java
Normal file
File diff suppressed because it is too large
Load Diff
4403
CommandGUI V1/src/main/java/de/jatitv/commandgui/config/GUI_2.java
Normal file
4403
CommandGUI V1/src/main/java/de/jatitv/commandgui/config/GUI_2.java
Normal file
File diff suppressed because it is too large
Load Diff
4403
CommandGUI V1/src/main/java/de/jatitv/commandgui/config/GUI_3.java
Normal file
4403
CommandGUI V1/src/main/java/de/jatitv/commandgui/config/GUI_3.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,123 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.config;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.system.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Messages_DE {
|
||||
|
||||
public static void messagesCreate(String version) {
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4DE_Messages.yml load...");
|
||||
|
||||
File messagesDEYML = new File(Main.thisp().getDataFolder().getPath(), "languages/de_DE_Messages.yml");
|
||||
YamlConfiguration yamlConfiguration_DEmsg = YamlConfiguration.loadConfiguration(messagesDEYML);
|
||||
|
||||
if (!yamlConfiguration_DEmsg.contains("Do_not_remove_or_change.Created"))
|
||||
yamlConfiguration_DEmsg.set("Do_not_remove_or_change.Created", "This file was created with version " + version);
|
||||
yamlConfiguration_DEmsg.set("Do_not_remove_or_change.Version", version);
|
||||
yamlConfiguration_DEmsg.set("Do_not_remove_or_change.Autor", Main.Autor);
|
||||
yamlConfiguration_DEmsg.set("Do_not_remove_or_change.Spigot", Main.Spigot);
|
||||
yamlConfiguration_DEmsg.set("Do_not_remove_or_change.Discord", Main.DiscordMSG);
|
||||
|
||||
if (!yamlConfiguration_DEmsg.contains("Plugin.NoPermission")) {
|
||||
yamlConfiguration_DEmsg.set("Plugin.NoPermission", DefaultValue.DE_NoPermission.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermission §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Plugin.NoPermissionForCommand")) {
|
||||
yamlConfiguration_DEmsg.set("Plugin.NoPermissionForCommand", DefaultValue.DE_NoPermissionForCommand.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermissionForCommand §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Plugin.NoPermissionForItem")) {
|
||||
yamlConfiguration_DEmsg.set("Plugin.NoPermissionForItem", DefaultValue.DE_NoPermissionForItem.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermissionForItem §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Plugin.VaultNotSetUp")) {
|
||||
yamlConfiguration_DEmsg.set("Plugin.VaultNotSetUp", DefaultValue.DE_VaultNotSetUp.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6VaultNotSetUp §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Plugin.SoundNotFound")) {
|
||||
yamlConfiguration_DEmsg.set("Plugin.SoundNotFound", DefaultValue.DE_SoundNotFound.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6SoundNotFound §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Plugin.Reload.Start")) {
|
||||
yamlConfiguration_DEmsg.set("Plugin.Reload.Start", DefaultValue.DE_ReloadStart.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Reload Start §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Plugin.Reload.End")) {
|
||||
yamlConfiguration_DEmsg.set("Plugin.Reload.End", DefaultValue.DE_ReloadEnd.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Reload End §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Help.CGUI")) {
|
||||
yamlConfiguration_DEmsg.set("Help.CGUI", DefaultValue.DE_HelpCgui.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + DefaultValue.HelpCgui.replace("§8[§6C§9GUI§8]", "[prefix]").replace("§", "&"));
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Help.Help")) {
|
||||
yamlConfiguration_DEmsg.set("Help.Help", DefaultValue.DE_HelpHelp.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Help §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Help.Info")) {
|
||||
yamlConfiguration_DEmsg.set("Help.Info", DefaultValue.DE_HelpInfo.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Info §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Help.Open")) {
|
||||
yamlConfiguration_DEmsg.set("Help.Open", DefaultValue.DE_HelpOpen.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Open §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Help.Give")) {
|
||||
yamlConfiguration_DEmsg.set("Help.Give", DefaultValue.DE_HelpGive.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Give §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Help.Reload")) {
|
||||
yamlConfiguration_DEmsg.set("Help.Reload", DefaultValue.DE_HelpReload.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Reload §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Cost.Buy_msg")) {
|
||||
yamlConfiguration_DEmsg.set("Cost.Buy_msg", DefaultValue.DE_Buy_msg.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Buy_msg §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Cost.No_money")) {
|
||||
yamlConfiguration_DEmsg.set("Cost.No_money", DefaultValue.DE_No_money.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6No_money §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Cost.NoInventorySpace")) {
|
||||
yamlConfiguration_DEmsg.set("Cost.NoInventorySpace", DefaultValue.DE_NoInventorySpace.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoInventorySpace §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("GUI.IsDisabled")) {
|
||||
yamlConfiguration_DEmsg.set("GUI.IsDisabled", DefaultValue.DE_GUIisDisable.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6GUI IsDisabled §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Give.Sender")) {
|
||||
yamlConfiguration_DEmsg.set("Give.Sender", DefaultValue.DE_give.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give Sender §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Give.Receiver")) {
|
||||
yamlConfiguration_DEmsg.set("Give.Receiver", DefaultValue.DE_giveReceived.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give Receiver §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Give.PlayerNotFond")) {
|
||||
yamlConfiguration_DEmsg.set("Give.PlayerNotFond", DefaultValue.DE_PlayerNotFound.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give PlayerNotFond §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_DEmsg.contains("Give.PlayerNoInventorySpace")) {
|
||||
yamlConfiguration_DEmsg.set("Give.PlayerNoInventorySpace", DefaultValue.DE_PlayerNoInventorySpace.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesDEYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give PlayerNoInventorySpace §4was added to §9DE_Messages.yml§4!");
|
||||
}
|
||||
try {
|
||||
yamlConfiguration_DEmsg.save(messagesDEYML);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2DE_Messages.yml loaded successfully.");
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,124 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.config;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.system.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Messages_EN {
|
||||
|
||||
public static void messagesCreate(String version) {
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4EN_Messages.yml load...");
|
||||
|
||||
File messagesENYML = new File(Main.thisp().getDataFolder().getPath(), "languages/en_EN_Messages.yml");
|
||||
YamlConfiguration yamlConfiguration_ENmsg = YamlConfiguration.loadConfiguration(messagesENYML);
|
||||
|
||||
if (!yamlConfiguration_ENmsg.contains("Do_not_remove_or_change.Created"))
|
||||
yamlConfiguration_ENmsg.set("Do_not_remove_or_change.Created", "This file was created with version " + version);
|
||||
yamlConfiguration_ENmsg.set("Do_not_remove_or_change.Version", version);
|
||||
yamlConfiguration_ENmsg.set("Do_not_remove_or_change.Autor", Main.Autor);
|
||||
yamlConfiguration_ENmsg.set("Do_not_remove_or_change.Spigot", Main.Spigot);
|
||||
yamlConfiguration_ENmsg.set("Do_not_remove_or_change.Discord", Main.DiscordMSG);
|
||||
|
||||
if (!yamlConfiguration_ENmsg.contains("Plugin.NoPermission")) {
|
||||
yamlConfiguration_ENmsg.set("Plugin.NoPermission", DefaultValue.NoPermission.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermission §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Plugin.NoPermissionForCommand")) {
|
||||
yamlConfiguration_ENmsg.set("Plugin.NoPermissionForCommand", DefaultValue.NoPermissionForCommand.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermissionForCommand §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Plugin.NoPermissionForItem")) {
|
||||
yamlConfiguration_ENmsg.set("Plugin.NoPermissionForItem", DefaultValue.NoPermissionForItem.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermissionForItem §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Plugin.VaultNotSetUp")) {
|
||||
yamlConfiguration_ENmsg.set("Plugin.VaultNotSetUp", DefaultValue.VaultNotSetUp.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6VaultNotSetUp §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Plugin.SoundNotFound")) {
|
||||
yamlConfiguration_ENmsg.set("Plugin.SoundNotFound", DefaultValue.SoundNotFound.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6SoundNotFound §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Plugin.Reload.Start")) {
|
||||
yamlConfiguration_ENmsg.set("Plugin.Reload.Start", DefaultValue.ReloadStart.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Reload Start §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Plugin.Reload.End")) {
|
||||
yamlConfiguration_ENmsg.set("Plugin.Reload.End", DefaultValue.ReloadEnd.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Reload End §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Help.CGUI")) {
|
||||
yamlConfiguration_ENmsg.set("Help.CGUI", DefaultValue.HelpCgui.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + DefaultValue.HelpCgui.replace("§8[§6C§9GUI§8]", "[prefix]").replace("§", "&"));
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Help.Help")) {
|
||||
yamlConfiguration_ENmsg.set("Help.Help", DefaultValue.HelpHelp.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Help §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Help.Info")) {
|
||||
yamlConfiguration_ENmsg.set("Help.Info", DefaultValue.HelpInfo.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Info §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Help.Open")) {
|
||||
yamlConfiguration_ENmsg.set("Help.Open", DefaultValue.HelpOpen.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Open §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Help.Give")) {
|
||||
yamlConfiguration_ENmsg.set("Help.Give", DefaultValue.HelpGive.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Give §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Help.Reload")) {
|
||||
yamlConfiguration_ENmsg.set("Help.Reload", DefaultValue.HelpReload.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Reload §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Cost.Buy_msg")) {
|
||||
yamlConfiguration_ENmsg.set("Cost.Buy_msg", DefaultValue.Buy_msg.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Buy_msg §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Cost.No_money")) {
|
||||
yamlConfiguration_ENmsg.set("Cost.No_money", DefaultValue.No_money.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6No_money §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Cost.NoInventorySpace")) {
|
||||
yamlConfiguration_ENmsg.set("Cost.NoInventorySpace", DefaultValue.NoInventorySpace.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoInventorySpace §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("GUI.IsDisabled")) {
|
||||
yamlConfiguration_ENmsg.set("GUI.IsDisabled", DefaultValue.GUIisDisable.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6GUI IsDisabled §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Give.Sender")) {
|
||||
yamlConfiguration_ENmsg.set("Give.Sender", DefaultValue.give.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give Sender §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Give.Receiver")) {
|
||||
yamlConfiguration_ENmsg.set("Give.Receiver", DefaultValue.giveReceived.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give Receiver §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Give.PlayerNotFond")) {
|
||||
yamlConfiguration_ENmsg.set("Give.PlayerNotFond", DefaultValue.PlayerNotFound.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give PlayerNotFond §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_ENmsg.contains("Give.PlayerNoInventorySpace")) {
|
||||
yamlConfiguration_ENmsg.set("Give.PlayerNoInventorySpace", DefaultValue.PlayerNoInventorySpace.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesENYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give PlayerNoInventorySpace §4was added to §9EN_Messages.yml§4!");
|
||||
}
|
||||
try {
|
||||
yamlConfiguration_ENmsg.save(messagesENYML);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2EN_Messages.yml loaded successfully.");
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.config;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.system.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Messages_FR {
|
||||
|
||||
public static void messagesCreate(String version) {
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4FR_Messages.yml load...");
|
||||
|
||||
File messagesFRYML = new File(Main.thisp().getDataFolder().getPath(), "languages/fr_FR_Messages.yml");
|
||||
YamlConfiguration yamlConfiguration_FRmsg = YamlConfiguration.loadConfiguration(messagesFRYML);
|
||||
|
||||
if (!yamlConfiguration_FRmsg.contains("Do_not_remove_or_change.Created"))
|
||||
yamlConfiguration_FRmsg.set("Do_not_remove_or_change.Created", "This file was created with version " + version);
|
||||
yamlConfiguration_FRmsg.set("Do_not_remove_or_change.Version", version);
|
||||
yamlConfiguration_FRmsg.set("Do_not_remove_or_change.Autor", Main.Autor);
|
||||
yamlConfiguration_FRmsg.set("Do_not_remove_or_change.Spigot", Main.Spigot);
|
||||
yamlConfiguration_FRmsg.set("Do_not_remove_or_change.Discord", Main.DiscordMSG);
|
||||
|
||||
if (!yamlConfiguration_FRmsg.contains("Plugin.NoPermission")) {
|
||||
yamlConfiguration_FRmsg.set("Plugin.NoPermission", DefaultValue.FR_NoPermission.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermission §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Plugin.NoPermissionForCommand")) {
|
||||
yamlConfiguration_FRmsg.set("Plugin.NoPermissionForCommand", DefaultValue.FR_NoPermissionForCommand.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermissionForCommand §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Plugin.NoPermissionForItem")) {
|
||||
yamlConfiguration_FRmsg.set("Plugin.NoPermissionForItem", DefaultValue.FR_NoPermissionForItem.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermissionForItem §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Plugin.VaultNotSetUp")) {
|
||||
yamlConfiguration_FRmsg.set("Plugin.VaultNotSetUp", DefaultValue.FR_VaultNotSetUp.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6VaultNotSetUp §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Plugin.SoundNotFound")) {
|
||||
yamlConfiguration_FRmsg.set("Plugin.SoundNotFound", DefaultValue.FR_SoundNotFound.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6SoundNotFound §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Plugin.Reload.Start")) {
|
||||
yamlConfiguration_FRmsg.set("Plugin.Reload.Start", DefaultValue.FR_ReloadStart.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Reload Start §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Plugin.Reload.End")) {
|
||||
yamlConfiguration_FRmsg.set("Plugin.Reload.End", DefaultValue.FR_ReloadEnd.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Reload End §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Help.CGUI")) {
|
||||
yamlConfiguration_FRmsg.set("Help.CGUI", DefaultValue.FR_HelpCgui.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + DefaultValue.HelpCgui.replace("§8[§6C§9GUI§8]", "[prefix]").replace("§", "&"));
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Help.Help")) {
|
||||
yamlConfiguration_FRmsg.set("Help.Help", DefaultValue.FR_HelpHelp.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Help §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Help.Info")) {
|
||||
yamlConfiguration_FRmsg.set("Help.Info", DefaultValue.FR_HelpInfo.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Info §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Help.Open")) {
|
||||
yamlConfiguration_FRmsg.set("Help.Open", DefaultValue.FR_HelpOpen.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Open §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Help.Give")) {
|
||||
yamlConfiguration_FRmsg.set("Help.Give", DefaultValue.FR_HelpGive.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Give §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Help.Reload")) {
|
||||
yamlConfiguration_FRmsg.set("Help.Reload", DefaultValue.FR_HelpReload.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Reload §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Cost.Buy_msg")) {
|
||||
yamlConfiguration_FRmsg.set("Cost.Buy_msg", DefaultValue.FR_Buy_msg.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Buy_msg §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Cost.No_money")) {
|
||||
yamlConfiguration_FRmsg.set("Cost.No_money", DefaultValue.FR_No_money.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6No_money §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Cost.NoInventorySpace")) {
|
||||
yamlConfiguration_FRmsg.set("Cost.NoInventorySpace", DefaultValue.FR_NoInventorySpace.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoInventorySpace §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("GUI.IsDisabled")) {
|
||||
yamlConfiguration_FRmsg.set("GUI.IsDisabled", DefaultValue.FR_GUIisDisable.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6GUI IsDisabled §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Give.Sender")) {
|
||||
yamlConfiguration_FRmsg.set("Give.Sender", DefaultValue.FR_give.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give Sender §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Give.Receiver")) {
|
||||
yamlConfiguration_FRmsg.set("Give.Receiver", DefaultValue.FR_giveReceived.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give Receiver §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Give.PlayerNotFond")) {
|
||||
yamlConfiguration_FRmsg.set("Give.PlayerNotFond", DefaultValue.FR_PlayerNotFound.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give PlayerNotFond §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_FRmsg.contains("Give.PlayerNoInventorySpace")) {
|
||||
yamlConfiguration_FRmsg.set("Give.PlayerNoInventorySpace", DefaultValue.FR_PlayerNoInventorySpace.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesFRYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give PlayerNoInventorySpace §4was added to §9FR_Messages.yml§4!");
|
||||
}
|
||||
try {
|
||||
yamlConfiguration_FRmsg.save(messagesFRYML);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2FR_Messages.yml loaded successfully.");
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.config;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.system.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class Messages_NO {
|
||||
|
||||
public static void messagesCreate(String version) {
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4NO_Messages.yml load...");
|
||||
|
||||
File messagesNOYML = new File(Main.thisp().getDataFolder().getPath(), "languages/no_NO_Messages.yml");
|
||||
YamlConfiguration yamlConfiguration_NOmsg = YamlConfiguration.loadConfiguration(messagesNOYML);
|
||||
|
||||
if (!yamlConfiguration_NOmsg.contains("Do_not_remove_or_change.Created"))
|
||||
yamlConfiguration_NOmsg.set("Do_not_remove_or_change.Created", "This file was created with version " + version);
|
||||
yamlConfiguration_NOmsg.set("Do_not_remove_or_change.Version", version);
|
||||
yamlConfiguration_NOmsg.set("Do_not_remove_or_change.Autor", Main.Autor);
|
||||
yamlConfiguration_NOmsg.set("Do_not_remove_or_change.Spigot", Main.Spigot);
|
||||
yamlConfiguration_NOmsg.set("Do_not_remove_or_change.Discord", Main.DiscordMSG);
|
||||
|
||||
if (!yamlConfiguration_NOmsg.contains("Plugin.NoPermission")) {
|
||||
yamlConfiguration_NOmsg.set("Plugin.NoPermission", DefaultValue.NO_NoPermission.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermission §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Plugin.NoPermissionForCommand")) {
|
||||
yamlConfiguration_NOmsg.set("Plugin.NoPermissionForCommand", DefaultValue.NO_NoPermissionForCommand.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermissionForCommand §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Plugin.NoPermissionForItem")) {
|
||||
yamlConfiguration_NOmsg.set("Plugin.NoPermissionForItem", DefaultValue.NO_NoPermissionForItem.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoPermissionForItem §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Plugin.VaultNotSetUp")) {
|
||||
yamlConfiguration_NOmsg.set("Plugin.VaultNotSetUp", DefaultValue.NO_VaultNotSetUp.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6VaultNotSetUp §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Plugin.SoundNotFound")) {
|
||||
yamlConfiguration_NOmsg.set("Plugin.SoundNotFound", DefaultValue.NO_SoundNotFound.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6SoundNotFound §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Plugin.Reload.Start")) {
|
||||
yamlConfiguration_NOmsg.set("Plugin.Reload.Start", DefaultValue.NO_ReloadStart.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Reload Start §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Plugin.Reload.End")) {
|
||||
yamlConfiguration_NOmsg.set("Plugin.Reload.End", DefaultValue.NO_ReloadEnd.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Reload End §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Help.CGUI")) {
|
||||
yamlConfiguration_NOmsg.set("Help.CGUI", DefaultValue.NO_HelpCgui.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + DefaultValue.HelpCgui.replace("§8[§6C§9GUI§8]", "[prefix]").replace("§", "&"));
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Help.Help")) {
|
||||
yamlConfiguration_NOmsg.set("Help.Help", DefaultValue.NO_HelpHelp.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Help §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Help.Info")) {
|
||||
yamlConfiguration_NOmsg.set("Help.Info", DefaultValue.NO_HelpInfo.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Info §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Help.Open")) {
|
||||
yamlConfiguration_NOmsg.set("Help.Open", DefaultValue.NO_HelpOpen.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Open §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Help.Give")) {
|
||||
yamlConfiguration_NOmsg.set("Help.Give", DefaultValue.NO_HelpGive.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Give §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Help.Reload")) {
|
||||
yamlConfiguration_NOmsg.set("Help.Reload", DefaultValue.NO_HelpReload.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Help Reload §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Cost.Buy_msg")) {
|
||||
yamlConfiguration_NOmsg.set("Cost.Buy_msg", DefaultValue.NO_Buy_msg.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Buy_msg §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Cost.No_money")) {
|
||||
yamlConfiguration_NOmsg.set("Cost.No_money", DefaultValue.NO_No_money.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6No_money §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Cost.NoInventorySpace")) {
|
||||
yamlConfiguration_NOmsg.set("Cost.NoInventorySpace", DefaultValue.NO_NoInventorySpace.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6NoInventorySpace §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("GUI.IsDisabled")) {
|
||||
yamlConfiguration_NOmsg.set("GUI.IsDisabled", DefaultValue.NO_GUIisDisable.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6GUI IsDisabled §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Give.Sender")) {
|
||||
yamlConfiguration_NOmsg.set("Give.Sender", DefaultValue.NO_give.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give Sender §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Give.Receiver")) {
|
||||
yamlConfiguration_NOmsg.set("Give.Receiver", DefaultValue.NO_giveReceived.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give Receiver §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Give.PlayerNotFond")) {
|
||||
yamlConfiguration_NOmsg.set("Give.PlayerNotFond", DefaultValue.NO_PlayerNotFound.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give PlayerNotFond §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
if (!yamlConfiguration_NOmsg.contains("Give.PlayerNoInventorySpace")) {
|
||||
yamlConfiguration_NOmsg.set("Give.PlayerNoInventorySpace", DefaultValue.NO_PlayerNoInventorySpace.replace(DefaultValue.Prefix, "[prefix]").replace("§", "&"));
|
||||
if (messagesNOYML.isFile()) Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Message §6Give PlayerNoInventorySpace §4was added to §9NO_Messages.yml§4!");
|
||||
}
|
||||
try {
|
||||
yamlConfiguration_NOmsg.save(messagesNOYML);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2NO_Messages.yml loaded successfully.");
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.config;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.system.Main;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class Messages_Select {
|
||||
|
||||
public static String selectMSG;
|
||||
public static String sel;
|
||||
|
||||
public static void selectCreate() {
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Select language...");
|
||||
|
||||
|
||||
switch (DefaultValue.language) {
|
||||
case "de_DE":
|
||||
selectMSG = "German";
|
||||
sel = "de_DE";
|
||||
break;
|
||||
case "fr_FR":
|
||||
selectMSG = "French";
|
||||
sel = "fr_FR";
|
||||
break;
|
||||
case "no_NO":
|
||||
selectMSG = "Norwegian";
|
||||
sel = "no_NO";
|
||||
break;
|
||||
default:
|
||||
selectMSG = "English";
|
||||
sel = "en_EN";
|
||||
break;
|
||||
}
|
||||
|
||||
File messagesYML = new File(Main.thisp().getDataFolder().getPath(), "languages/" + sel + "_Messages.yml");
|
||||
YamlConfiguration yamlConfiguration_msg = YamlConfiguration.loadConfiguration(messagesYML);
|
||||
DefaultValue.NoPermission = replace(yamlConfiguration_msg.getString("Plugin.NoPermission"));
|
||||
DefaultValue.NoPermissionForCommand = replace(yamlConfiguration_msg.getString("Plugin.NoPermissionForCommand"));
|
||||
DefaultValue.NoPermissionForItem = replace(yamlConfiguration_msg.getString("Plugin.NoPermissionForItem"));
|
||||
DefaultValue.VaultNotSetUp = replace(yamlConfiguration_msg.getString("Plugin.VaultNotSetUp"));
|
||||
DefaultValue.SoundNotFound = replace(yamlConfiguration_msg.getString("Plugin.SoundNotFound"));
|
||||
DefaultValue.ReloadStart = replace(yamlConfiguration_msg.getString("Plugin.Reload.Start"));
|
||||
DefaultValue.ReloadEnd = replace(yamlConfiguration_msg.getString("Plugin.Reload.End"));
|
||||
DefaultValue.HelpCgui = replace(yamlConfiguration_msg.getString("Help.CGUI"));
|
||||
DefaultValue.HelpHelp = replace(yamlConfiguration_msg.getString("Help.Help"));
|
||||
DefaultValue.HelpInfo = replace(yamlConfiguration_msg.getString("Help.Info"));
|
||||
DefaultValue.HelpOpen = replace(yamlConfiguration_msg.getString("Help.Open"));
|
||||
DefaultValue.HelpGive = replace(yamlConfiguration_msg.getString("Help.Give"));
|
||||
DefaultValue.HelpReload = replace(yamlConfiguration_msg.getString("Help.Reload"));
|
||||
DefaultValue.No_money = replace(yamlConfiguration_msg.getString("Cost.No_money"));
|
||||
DefaultValue.NoInventorySpace = replace(yamlConfiguration_msg.getString("Cost.NoInventorySpace"));
|
||||
DefaultValue.Buy_msg = replace(yamlConfiguration_msg.getString("Cost.Buy_msg"));
|
||||
DefaultValue.GUIisDisable = replace(yamlConfiguration_msg.getString("GUI.IsDisabled"));
|
||||
DefaultValue.give = replace(yamlConfiguration_msg.getString("Give.Sender"));
|
||||
DefaultValue.giveReceived = replace(yamlConfiguration_msg.getString("Give.Receiver"));
|
||||
DefaultValue.PlayerNotFound = replace(yamlConfiguration_msg.getString("Give.PlayerNotFond"));
|
||||
DefaultValue.PlayerNoInventorySpace = replace(yamlConfiguration_msg.getString("Give.PlayerNoInventorySpace"));
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2Language successfully selected to: §6" + selectMSG);
|
||||
}
|
||||
|
||||
private static String replace(String Text) {
|
||||
return Text.replace("[prefix]", DefaultValue.PrefixHC).replace("&", "§").replace("[ue]", "ü")
|
||||
.replace("[UE]", "Ü").replace("[oe]", "Ö").replace("[OE]", "Ö")
|
||||
.replace("[ae]", "ä").replace("[AE]", "Ä");
|
||||
}
|
||||
}
|
@ -0,0 +1,166 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
// -----------------------------
|
||||
// _____ _____ _ _ _____
|
||||
// / ____/ ____| | | |_ _|
|
||||
// | | | | __| | | | | |
|
||||
// | | | | |_ | | | | | |
|
||||
// | |___| |__| | |__| |_| |_
|
||||
// \_____\_____|\____/|_____|
|
||||
// -----------------------------
|
||||
|
||||
package de.jatitv.commandgui.defaultValue;
|
||||
|
||||
import org.bukkit.Sound;
|
||||
|
||||
public class DefaultValue {
|
||||
|
||||
// Config
|
||||
|
||||
public static boolean Debug = false;
|
||||
public static Boolean UpdateCheckOnJoin = true;
|
||||
public static String language = "en_EN";
|
||||
|
||||
public static String Currency = "$";
|
||||
|
||||
public static Integer DefaultGUI = 1;
|
||||
|
||||
|
||||
// Messages
|
||||
public static String PrefixHC = "§8[§4C§9GUI§8] ";
|
||||
public static String Prefix = "§8[§4C§9GUI§8]";
|
||||
|
||||
// EN
|
||||
public static String NoPermission = PrefixHC + "§cYou do not have permission for §4Command§9GUI!";
|
||||
public static String NoPermissionForCommand = PrefixHC + "§cFor §b[cmd] §cyou lack the permission §6[perm]§c!";
|
||||
public static String NoPermissionForItem = PrefixHC + "§cFor §b[item] §cyou lack the permission §6[perm]§c!";
|
||||
public static String VaultNotSetUp = PrefixHC + "§4Vault / Economy not set up!";
|
||||
public static String SoundNotFound = PrefixHC + "§4The sound §6[sound] §4could not be found! Please check your settings.";
|
||||
public static String ReloadStart = "§6Plugin reload...";
|
||||
public static String ReloadEnd = "§2Plugin successfully reloaded.";
|
||||
|
||||
public static String HelpCgui = "§8'§b/commandgui §8| §b/cgui§8' §eOpen the Default GUI §7(§r[gui]§7)§e.";
|
||||
public static String HelpHelp = "§8'§b/commandgui help§8' §eOpens this help.";
|
||||
public static String HelpInfo = "§8'§b/commandgui info§8' §eCall the info about §4Command§9GUI§e.";
|
||||
public static String HelpOpen = "§8'§b/commandgui open [gui]§8' §eOpen the GUI: §6[guiname]§e.";
|
||||
public static String HelpGive = "§8'§b/commandgui give §7<player> <gui>§8' §eGive a player a GUI Item.";
|
||||
public static String HelpReload = "§8'§b/commandgui reload§8' §eReloads the Plugin.";
|
||||
|
||||
public static String Buy_msg = PrefixHC + "§2You bought [itemname] §2for §6[price]§2.";
|
||||
public static String No_money = PrefixHC + "§cYou do not have enough money!";
|
||||
public static String NoInventorySpace = PrefixHC + "&cNo free inventory space!";
|
||||
|
||||
public static String GUIisDisable = PrefixHC + "§cThe GUI [gui] §cis currently disabled!";
|
||||
|
||||
public static String give = PrefixHC + "§2You gave §6[player] §2a [item]§2!";
|
||||
public static String giveReceived = PrefixHC + "§2You have received a [item] §2from §6[sender]§2!";
|
||||
public static String PlayerNotFound = PrefixHC + "§cThe player §6[player] §cwas not found or is not online!";
|
||||
public static String PlayerNoInventorySpace = PrefixHC + "§6[player] §chas no free inventory space available!";
|
||||
|
||||
// DE
|
||||
public static String DE_NoPermission = PrefixHC + "§cDu hast keine Permission f[ue]r §4Command§9GUI!";
|
||||
public static String DE_NoPermissionForCommand = PrefixHC + "§cF[ue]r §b[cmd] §cfehlt dir die Permission §6[perm]§c!";
|
||||
public static String DE_NoPermissionForItem = PrefixHC + "§cF[ue]r §b[item] §cfehlt dir die Permission §6[perm]§c!";
|
||||
public static String DE_VaultNotSetUp = PrefixHC + "§4Vault / Economy nicht eingerichtet!";
|
||||
public static String DE_SoundNotFound = PrefixHC + "§4Der Sound §6[sound] §4wurde nicht gefunden! Bitte überprüfe die Einstellungen.";
|
||||
public static String DE_ReloadStart = "§6Plugin wird neu geladen...";
|
||||
public static String DE_ReloadEnd = "§2Plugin erfolgreich neu geladen.";
|
||||
|
||||
public static String DE_HelpCgui = "§8'§b/commandgui §8| §b/cgui§8' §e[OE]ffne die default GUI §7(§r[gui]§7)§e.";
|
||||
public static String DE_HelpHelp = "§8'§b/commandgui help§8' §e[OE]ffne diese help.";
|
||||
public static String DE_HelpInfo = "§8'§b/commandgui info§8' §eRufe die Infos von §4Command§9GUI §eauf.";
|
||||
public static String DE_HelpOpen = "§8'§b/commandgui open [gui]§8' §e[OE]ffne die GUI: §6[guiname]§e.";
|
||||
public static String DE_HelpGive = "§8'§b/commandgui give §7<player> <gui>§8' &eGebe einem Spieler ein GUI Item.";
|
||||
public static String DE_HelpReload = "§8'§b/commandgui reload§8' &eLade das Plugin neu.";
|
||||
|
||||
public static String DE_Buy_msg = PrefixHC + "&2Du hast dir [itemname] &2f[ue]r &6[price] &2gekauft.";
|
||||
public static String DE_No_money = PrefixHC + "&cDu hast nicht gen[ue]gend Geld!";
|
||||
public static String DE_NoInventorySpace = PrefixHC + "§cDu hast keinen Platz in deinem Inventar!";
|
||||
|
||||
public static String DE_GUIisDisable = PrefixHC + "&cDie GUI [gui] &cist derzeit Deaktiviert!";
|
||||
|
||||
public static String DE_give = PrefixHC + "&2Du hast &6[player] &2ein [item] &2gegeben!";
|
||||
public static String DE_giveReceived = PrefixHC + "&2Du hast von &6[sender] &2, [item] &2bekommen!";
|
||||
public static String DE_PlayerNotFound = PrefixHC + "&cDer Spieler &6[player] &cwurde nicht gefunden oder ist nicht Online!";
|
||||
public static String DE_PlayerNoInventorySpace = PrefixHC + "&6[player] &chat keinen freien Platz in seinem Inventar!";
|
||||
|
||||
// FR
|
||||
public static String FR_NoPermission = PrefixHC + "§cVous n'avez pas la permission pour §4Command§9GUI!";
|
||||
public static String FR_NoPermissionForCommand = PrefixHC + "§cPour §b[cmd] §cil vous manque la permission §6[perm]§c!";
|
||||
public static String FR_NoPermissionForItem = PrefixHC + "§cPour §b[item] §cil vous manque la permission §6[perm]§c!";
|
||||
public static String FR_VaultNotSetUp = PrefixHC + "§4Vault / Economie non mis en place!";
|
||||
public static String FR_SoundNotFound = PrefixHC + "§4Le son §6[sound] §4n'a pas pu être trouvé ! Vérifiez votre configuration.";
|
||||
public static String FR_ReloadStart = "§6Le plugin recharge...";
|
||||
public static String FR_ReloadEnd = "§2Le plugin est rechargé.";
|
||||
|
||||
public static String FR_HelpCgui = "§8'§b/commandgui §8| §b/cgui§8' §eOuvre l'interface par défaut §7(§r[gui]§7)§e.";
|
||||
public static String FR_HelpHelp = "§8'§b/commandgui help§8' §eOuvre cette aide.";
|
||||
public static String FR_HelpInfo = "§8'§b/commandgui info§8' §eDonne les infos à propos de §4Command§9GUI§e.";
|
||||
public static String FR_HelpOpen = "§8'§b/commandgui open [gui]§8' §eOuvre l'inteface: §6[guiname]§e.";
|
||||
public static String FR_HelpGive = "§8'§b/commandgui give §7<player> <gui>§8' §eDonne à un joueur un item pour une interface.";
|
||||
public static String FR_HelpReload = "§8'§b/commandgui reload§8' §eRecharge le plugin.";
|
||||
|
||||
public static String FR_Buy_msg = PrefixHC + "§2Vous avez acheté [itemname] §2pour §6[price]§2.";
|
||||
public static String FR_No_money = PrefixHC + "§cVous n'avez pas assez d'argent!";
|
||||
public static String FR_NoInventorySpace = PrefixHC + "§cVous n'avez pas de place dans l'inventaire!";
|
||||
|
||||
public static String FR_GUIisDisable = PrefixHC + "§cL'interface [gui] §cest actuellement désactivée!";
|
||||
|
||||
public static String FR_give = PrefixHC + "§2Vous avez donné à §6[player] §2un [item]§2!";
|
||||
public static String FR_giveReceived = PrefixHC + "§2Vous avez reçu un [item] §2de §6[sender]§2!";
|
||||
public static String FR_PlayerNotFound = PrefixHC + "§cLe joueur §6[player] §cn'a pas pu être trouvé ou n'est pas connecté!";
|
||||
public static String FR_PlayerNoInventorySpace = PrefixHC + "§6[player] §cn'a pas d'espace libre dans son inventaire!";
|
||||
|
||||
// NO
|
||||
public static String NO_NoPermission = PrefixHC + "§cDu har ikke tillatelse for §4Command§9GUI!";
|
||||
public static String NO_NoPermissionForCommand = PrefixHC + "§cDu mangler §6[perm] §vfor §b[cmd]§c!";
|
||||
public static String NO_NoPermissionForItem = PrefixHC + "§cDu mangler §6[perm] §cfor §b[item]§c!";
|
||||
public static String NO_VaultNotSetUp = PrefixHC + "§4Vault / Økonomi er ikke satt opp!";
|
||||
public static String NO_SoundNotFound = PrefixHC + "§4Lydeffekten §6[sound] §4ble ikke funnet! Sjekk instillingene dine.";
|
||||
public static String NO_ReloadStart = "§6Plugin restarter...";
|
||||
public static String NO_ReloadEnd = "§2Plugin restartet.";
|
||||
|
||||
public static String NO_HelpCgui = "§8'§b/commandgui §8| §b/cgui§8' §eÅpner Default GUI §7(§r[gui]§7)§e.";
|
||||
public static String NO_HelpHelp = "§8'§b/commandgui help§8' §eÅpner hjelp.";
|
||||
public static String NO_HelpInfo = "§8'§b/commandgui info§8' §eViser info om §4Command§9GUI§e.";
|
||||
public static String NO_HelpOpen = "§8'§b/commandgui open [gui]§8' §eÅpner GUI: §6[guiname]§e.";
|
||||
public static String NO_HelpGive = "§8'§b/commandgui give §7<player> <gui>§8' §eGir en spiller et GUI Item.";
|
||||
public static String NO_HelpReload = "§8'§b/commandgui reload§8' §eRestarter pluginen.";
|
||||
|
||||
public static String NO_Buy_msg = PrefixHC + "§2Du kjøpte [itemname] §2for §6[price]§2.";
|
||||
public static String NO_No_money = PrefixHC + "§cDu har ikke nok penger!";
|
||||
public static String NO_NoInventorySpace = PrefixHC + "§cDu har ikke nok ledig plass!";
|
||||
|
||||
public static String NO_GUIisDisable = PrefixHC + "§cGUI [gui] §cer avskrudd!";
|
||||
|
||||
public static String NO_give = PrefixHC + "§2Du gav §6[player] §2[item]§2!";
|
||||
public static String NO_giveReceived = PrefixHC + "§2Du har mottatt [item] §2fa §6[sender]§2!";
|
||||
public static String NO_PlayerNotFound = PrefixHC + "§cSpilleren §6[player] §cble ikke funnet!";
|
||||
public static String NO_PlayerNoInventorySpace = PrefixHC + "&6[player] §char ikke nok ledig plass!";
|
||||
|
||||
|
||||
// Sound
|
||||
|
||||
public static Boolean Sound_Enable = true;
|
||||
|
||||
public static Boolean Sound_Click_Enable = true;
|
||||
public static Sound Sound_Click;
|
||||
public static String Sound_Click_input;
|
||||
|
||||
public static Boolean Sound_NoMoney_Enable = true;
|
||||
public static Sound Sound_NoMoney;
|
||||
public static String Sound_NoMoney_input;
|
||||
|
||||
public static Boolean Sound_NoInventorySpace_Enable = true;
|
||||
public static Sound Sound_NoInventorySpace;
|
||||
public static String Sound_NoInventorySpace_input;
|
||||
|
||||
public static Boolean Sound_Give_Enable = true;
|
||||
public static Sound Sound_Give;
|
||||
public static String Sound_Give_input;
|
||||
|
||||
public static Boolean Sound_PlayerNotFound_Enable = true;
|
||||
public static Sound Sound_PlayerNotFound;
|
||||
public static String Sound_PlayerNotFound_input;
|
||||
|
||||
}
|
@ -0,0 +1,852 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
// -----------------------------
|
||||
// _____ _____ _ _ _____
|
||||
// / ____/ ____| | | |_ _|
|
||||
// | | | | __| | | | | |
|
||||
// | | | | |_ | | | | | |
|
||||
// | |___| |__| | |__| |_| |_
|
||||
// \_____\_____|\____/|_____|
|
||||
// -----------------------------
|
||||
|
||||
package de.jatitv.commandgui.defaultValue;
|
||||
|
||||
import de.jatitv.commandgui.system.Main;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class DefaultValue_GUI_1 {
|
||||
|
||||
public static Boolean GiveUseItemOnFirstJoin = false;
|
||||
public static Boolean GiveUseItemOnFirstJoin_Permission_Enable = false;
|
||||
|
||||
public static Boolean GUI_Enable = false;
|
||||
|
||||
public static String GiveUseItemOnFirstJoin_Permission = "commandgui.giveuseitemonfirstjoin.gui1";
|
||||
public static String UseItem_Item = "COMPASS";
|
||||
public static String UseItem_Name = "§7Open the: [guiname]";
|
||||
public static List UseItem_Lore = Arrays.asList();
|
||||
|
||||
public static String Command = "GUI1";
|
||||
public static Boolean Command_Permission_Enable = true;
|
||||
|
||||
public static String GUIName = "§9GUI §51";
|
||||
public static Boolean FillItem_Enable = true;
|
||||
public static String FillItem = "BLACK_STAINED_GLASS_PANE";
|
||||
public static short FillItem_1_8 = 15;
|
||||
public static Integer GUILines = 1;
|
||||
|
||||
public static Boolean Permission_Enable = false;
|
||||
public static String Permission = "commandgui.use.gui1";
|
||||
|
||||
|
||||
/**
|
||||
* line1
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L1_S1_Enable = true;
|
||||
public static Boolean L1_S1_Playerhead = true;
|
||||
public static String L1_S1_Item = "PAPER";
|
||||
public static String L1_S1_Name = "§3Player Info";
|
||||
public static List L1_S1_Lore = Arrays.asList("§8-----------------", "§bPlayer: §6%player_name%", "", "§eGamemode: §6%player_gamemode%", "§eHealth: §6%player_health_scale%");
|
||||
public static Boolean L1_S1_Cost_Enable = false;
|
||||
public static Double L1_S1_Price = 0.00;
|
||||
public static Boolean L1_S1_Command_Enable = false;
|
||||
public static Boolean L1_S1_CommandAsConsole = false;
|
||||
public static String L1_S1_Command = "";
|
||||
public static Boolean L1_S1_Message_Enable = false;
|
||||
public static List<String> L1_S1_Message;
|
||||
public static Boolean L1_S1_Permission_Enable = false;
|
||||
public static String L1_S1_Permission = "commandgui.use.gui1.line1.slot1";
|
||||
|
||||
public static Boolean L1_S2_Enable = false;
|
||||
public static String L1_S2_Item = "";
|
||||
public static String L1_S2_Name = "";
|
||||
public static List L1_S2_Lore = Arrays.asList();
|
||||
public static Boolean L1_S2_Cost_Enable = false;
|
||||
public static Double L1_S2_Price = 0.00;
|
||||
public static Boolean L1_S2_Command_Enable = false;
|
||||
public static Boolean L1_S2_CommandAsConsole = false;
|
||||
public static String L1_S2_Command = "";
|
||||
public static Boolean L1_S2_Message_Enable = false;
|
||||
public static List<String> L1_S2_Message;
|
||||
public static Boolean L1_S2_Permission_Enable = false;
|
||||
public static String L1_S2_Permission = "commandgui.use.gui1.line1.slot2";
|
||||
|
||||
public static Boolean L1_S3_Enable = false;
|
||||
public static String L1_S3_Item = "";
|
||||
public static String L1_S3_Name = "";
|
||||
public static List L1_S3_Lore = Arrays.asList();
|
||||
public static Boolean L1_S3_Cost_Enable = false;
|
||||
public static Double L1_S3_Price = 0.00;
|
||||
public static Boolean L1_S3_Command_Enable = false;
|
||||
public static Boolean L1_S3_CommandAsConsole = false;
|
||||
public static String L1_S3_Command = "";
|
||||
public static Boolean L1_S3_Message_Enable = false;
|
||||
public static List<String> L1_S3_Message;
|
||||
public static Boolean L1_S3_Permission_Enable = false;
|
||||
public static String L1_S3_Permission = "commandgui.use.gui1.line1.slot3";
|
||||
|
||||
public static Boolean L1_S4_Enable = true;
|
||||
public static String L1_S4_Item = "STONE";
|
||||
public static String L1_S4_Name = "§4Example GUI";
|
||||
public static List L1_S4_Lore = Arrays.asList();
|
||||
public static Boolean L1_S4_Cost_Enable = false;
|
||||
public static Double L1_S4_Price = 0.00;
|
||||
public static Boolean L1_S4_Command_Enable = false;
|
||||
public static Boolean L1_S4_CommandAsConsole = false;
|
||||
public static String L1_S4_Command = "";
|
||||
public static Boolean L1_S4_Message_Enable = true;
|
||||
public static List<String> L1_S4_Message = Arrays.asList(
|
||||
"[prefix] §cThe settings can be edited in the GUI_1.yml.",
|
||||
"[prefix]",
|
||||
"[prefix] §bIn the GUI, placeholders can be used for the item names and lores.",
|
||||
"[prefix] §bIt is adjustable how many lines the GUI should have.",
|
||||
"[prefix] §aIt is possible to make functions chargeable §c(requires Vault and an Economy plugin)§a.",
|
||||
"[prefix] §bYou can send messages to the executing player.",
|
||||
"[prefix] §aYou can execute commands.",
|
||||
"[prefix] ",
|
||||
"[prefix] §2If you have further questions, please come to my Discord: §6" + Main.DiscordLink);
|
||||
public static Boolean L1_S4_Permission_Enable = false;
|
||||
public static String L1_S4_Permission = "commandgui.use.gui1.line1.slot4";
|
||||
|
||||
public static Boolean L1_S5_Enable = false;
|
||||
public static String L1_S5_Item = "";
|
||||
public static String L1_S5_Name = "";
|
||||
public static List L1_S5_Lore = Arrays.asList();
|
||||
public static Boolean L1_S5_Cost_Enable = false;
|
||||
public static Double L1_S5_Price = 0.00;
|
||||
public static Boolean L1_S5_Command_Enable = false;
|
||||
public static Boolean L1_S5_CommandAsConsole = false;
|
||||
public static String L1_S5_Command = "";
|
||||
public static Boolean L1_S5_Message_Enable = false;
|
||||
public static List<String> L1_S5_Message;
|
||||
public static Boolean L1_S5_Permission_Enable = false;
|
||||
public static String L1_S5_Permission = "commandgui.use.gui1.line1.slot5";
|
||||
|
||||
public static Boolean L1_S6_Enable = true;
|
||||
public static String L1_S6_Item = "TNT";
|
||||
public static String L1_S6_Name = "§4More plugins from JaTiTV";
|
||||
public static List L1_S6_Lore = Arrays.asList();
|
||||
public static Boolean L1_S6_Cost_Enable = false;
|
||||
public static Double L1_S6_Price = 0.00;
|
||||
public static Boolean L1_S6_Command_Enable = false;
|
||||
public static Boolean L1_S6_CommandAsConsole = false;
|
||||
public static String L1_S6_Command = "";
|
||||
public static Boolean L1_S6_Message_Enable = true;
|
||||
public static List<String> L1_S6_Message = Arrays.asList(
|
||||
"[prefix] §8------ §6More plugins from JaTiTV §8------",
|
||||
"[prefix]",
|
||||
"[prefix] §2Wonder§6Bag§9Shop §7-> §bhttps://www.spigotmc.org/resources/wonderbagshop.89234/",
|
||||
"[prefix] §5PaPi§6Test §7-> §bhttps://www.spigotmc.org/resources/papitest-placeholderapi-tester.90439/",
|
||||
"[prefix]",
|
||||
"[prefix] §2All plugins from JaTiTV:",
|
||||
"[prefix] §bhttps://www.spigotmc.org/resources/authors/jatitv.1022547/",
|
||||
"[prefix] §8----------------------------------");
|
||||
public static Boolean L1_S6_Permission_Enable = false;
|
||||
public static String L1_S6_Permission = "commandgui.use.gui1.line1.slot6";
|
||||
|
||||
public static Boolean L1_S7_Enable = false;
|
||||
public static String L1_S7_Item = "";
|
||||
public static String L1_S7_Name = "";
|
||||
public static List L1_S7_Lore = Arrays.asList();
|
||||
public static Boolean L1_S7_Cost_Enable = false;
|
||||
public static Double L1_S7_Price = 0.00;
|
||||
public static Boolean L1_S7_Command_Enable = false;
|
||||
public static Boolean L1_S7_CommandAsConsole = false;
|
||||
public static String L1_S7_Command = "";
|
||||
public static Boolean L1_S7_Message_Enable = false;
|
||||
public static List<String> L1_S7_Message;
|
||||
public static Boolean L1_S7_Permission_Enable = false;
|
||||
public static String L1_S7_Permission = "commandgui.use.gui1.line1.slot7";
|
||||
|
||||
public static Boolean L1_S8_Enable = false;
|
||||
public static String L1_S8_Item = "";
|
||||
public static String L1_S8_Name = "";
|
||||
public static List L1_S8_Lore = Arrays.asList();
|
||||
public static Boolean L1_S8_Cost_Enable = false;
|
||||
public static Double L1_S8_Price = 0.00;
|
||||
public static Boolean L1_S8_Command_Enable = false;
|
||||
public static Boolean L1_S8_CommandAsConsole = false;
|
||||
public static String L1_S8_Command = "";
|
||||
public static Boolean L1_S8_Message_Enable = false;
|
||||
public static List<String> L1_S8_Message;
|
||||
public static Boolean L1_S8_Permission_Enable = false;
|
||||
public static String L1_S8_Permission = "commandgui.use.gui1.line1.slot8";
|
||||
|
||||
public static Boolean L1_S9_Enable = true;
|
||||
public static String L1_S9_Item = "PAPER";
|
||||
public static String L1_S9_Name = "§6NightVision";
|
||||
public static List L1_S9_Lore = Arrays.asList("§8-----------------", "§65 minutes", "§5[price]");
|
||||
public static Boolean L1_S9_Cost_Enable = true;
|
||||
public static Double L1_S9_Price = 100.00;
|
||||
public static Boolean L1_S9_Command_Enable = true;
|
||||
public static Boolean L1_S9_CommandAsConsole = true;
|
||||
public static String L1_S9_Command;// = "effect give @p night_vision 300 1 true";
|
||||
public static Boolean L1_S9_Message_Enable = false;
|
||||
public static List<String> L1_S9_Message;
|
||||
public static Boolean L1_S9_Permission_Enable = false;
|
||||
public static String L1_S9_Permission = "commandgui.use.gui1.line1.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line2
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L2_S1_Enable = false;
|
||||
public static String L2_S1_Item = "";
|
||||
public static String L2_S1_Name = "";
|
||||
public static List L2_S1_Lore = Arrays.asList();
|
||||
public static Boolean L2_S1_Cost_Enable = false;
|
||||
public static Double L2_S1_Price = 0.00;
|
||||
public static Boolean L2_S1_Command_Enable = false;
|
||||
public static Boolean L2_S1_CommandAsConsole = false;
|
||||
public static String L2_S1_Command = "";
|
||||
public static Boolean L2_S1_Message_Enable = false;
|
||||
public static List<String> L2_S1_Message;
|
||||
public static Boolean L2_S1_Permission_Enable = false;
|
||||
public static String L2_S1_Permission = "commandgui.use.gui1.line2.slot1";
|
||||
|
||||
public static Boolean L2_S2_Enable = false;
|
||||
public static String L2_S2_Item = "";
|
||||
public static String L2_S2_Name = "";
|
||||
public static List L2_S2_Lore = Arrays.asList();
|
||||
public static Boolean L2_S2_Cost_Enable = false;
|
||||
public static Double L2_S2_Price = 0.00;
|
||||
public static Boolean L2_S2_Command_Enable = false;
|
||||
public static Boolean L2_S2_CommandAsConsole = false;
|
||||
public static String L2_S2_Command = "";
|
||||
public static Boolean L2_S2_Message_Enable = false;
|
||||
public static List<String> L2_S2_Message;
|
||||
public static Boolean L2_S2_Permission_Enable = false;
|
||||
public static String L2_S2_Permission = "commandgui.use.gui1.line2.slot2";
|
||||
|
||||
public static Boolean L2_S3_Enable = false;
|
||||
public static String L2_S3_Item = "";
|
||||
public static String L2_S3_Name = "";
|
||||
public static List L2_S3_Lore = Arrays.asList();
|
||||
public static Boolean L2_S3_Cost_Enable = false;
|
||||
public static Double L2_S3_Price = 0.00;
|
||||
public static Boolean L2_S3_Command_Enable = false;
|
||||
public static Boolean L2_S3_CommandAsConsole = false;
|
||||
public static String L2_S3_Command = "";
|
||||
public static Boolean L2_S3_Message_Enable = false;
|
||||
public static List<String> L2_S3_Message;
|
||||
public static Boolean L2_S3_Permission_Enable = false;
|
||||
public static String L2_S3_Permission = "commandgui.use.gui1.line2.slot3";
|
||||
|
||||
public static Boolean L2_S4_Enable = false;
|
||||
public static String L2_S4_Item = "";
|
||||
public static String L2_S4_Name = "";
|
||||
public static List L2_S4_Lore = Arrays.asList();
|
||||
public static Boolean L2_S4_Cost_Enable = false;
|
||||
public static Double L2_S4_Price = 0.00;
|
||||
public static Boolean L2_S4_Command_Enable = false;
|
||||
public static Boolean L2_S4_CommandAsConsole = false;
|
||||
public static String L2_S4_Command = "";
|
||||
public static Boolean L2_S4_Message_Enable = false;
|
||||
public static List<String> L2_S4_Message;
|
||||
public static Boolean L2_S4_Permission_Enable = false;
|
||||
public static String L2_S4_Permission = "commandgui.use.gui1.line2.slot4";
|
||||
|
||||
public static Boolean L2_S5_Enable = false;
|
||||
public static String L2_S5_Item = "";
|
||||
public static String L2_S5_Name = "";
|
||||
public static List L2_S5_Lore = Arrays.asList();
|
||||
public static Boolean L2_S5_Cost_Enable = false;
|
||||
public static Double L2_S5_Price = 0.00;
|
||||
public static Boolean L2_S5_Command_Enable = false;
|
||||
public static Boolean L2_S5_CommandAsConsole = false;
|
||||
public static String L2_S5_Command = "";
|
||||
public static Boolean L2_S5_Message_Enable = false;
|
||||
public static List<String> L2_S5_Message;
|
||||
public static Boolean L2_S5_Permission_Enable = false;
|
||||
public static String L2_S5_Permission = "commandgui.use.gui1.line2.slot5";
|
||||
|
||||
public static Boolean L2_S6_Enable = false;
|
||||
public static String L2_S6_Item = "";
|
||||
public static String L2_S6_Name = "";
|
||||
public static List L2_S6_Lore = Arrays.asList();
|
||||
public static Boolean L2_S6_Cost_Enable = false;
|
||||
public static Double L2_S6_Price = 0.00;
|
||||
public static Boolean L2_S6_Command_Enable = false;
|
||||
public static Boolean L2_S6_CommandAsConsole = false;
|
||||
public static String L2_S6_Command = "";
|
||||
public static Boolean L2_S6_Message_Enable = false;
|
||||
public static List<String> L2_S6_Message;
|
||||
public static Boolean L2_S6_Permission_Enable = false;
|
||||
public static String L2_S6_Permission = "commandgui.use.gui1.line2.slot6";
|
||||
|
||||
public static Boolean L2_S7_Enable = false;
|
||||
public static String L2_S7_Item = "";
|
||||
public static String L2_S7_Name = "";
|
||||
public static List L2_S7_Lore = Arrays.asList();
|
||||
public static Boolean L2_S7_Cost_Enable = false;
|
||||
public static Double L2_S7_Price = 0.00;
|
||||
public static Boolean L2_S7_Command_Enable = false;
|
||||
public static Boolean L2_S7_CommandAsConsole = false;
|
||||
public static String L2_S7_Command = "";
|
||||
public static Boolean L2_S7_Message_Enable = false;
|
||||
public static List<String> L2_S7_Message;
|
||||
public static Boolean L2_S7_Permission_Enable = false;
|
||||
public static String L2_S7_Permission = "commandgui.use.gui1.line2.slot7";
|
||||
|
||||
public static Boolean L2_S8_Enable = false;
|
||||
public static String L2_S8_Item = "";
|
||||
public static String L2_S8_Name = "";
|
||||
public static List L2_S8_Lore = Arrays.asList();
|
||||
public static Boolean L2_S8_Cost_Enable = false;
|
||||
public static Double L2_S8_Price = 0.00;
|
||||
public static Boolean L2_S8_Command_Enable = false;
|
||||
public static Boolean L2_S8_CommandAsConsole = false;
|
||||
public static String L2_S8_Command = "";
|
||||
public static Boolean L2_S8_Message_Enable = false;
|
||||
public static List<String> L2_S8_Message;
|
||||
public static Boolean L2_S8_Permission_Enable = false;
|
||||
public static String L2_S8_Permission = "commandgui.use.gui1.line2.slot8";
|
||||
|
||||
public static Boolean L2_S9_Enable = false;
|
||||
public static String L2_S9_Item = "";
|
||||
public static String L2_S9_Name = "";
|
||||
public static List L2_S9_Lore = Arrays.asList();
|
||||
public static Boolean L2_S9_Cost_Enable = false;
|
||||
public static Double L2_S9_Price = 0.00;
|
||||
public static Boolean L2_S9_Command_Enable = false;
|
||||
public static Boolean L2_S9_CommandAsConsole = false;
|
||||
public static String L2_S9_Command = "";
|
||||
public static Boolean L2_S9_Message_Enable = false;
|
||||
public static List<String> L2_S9_Message;
|
||||
public static Boolean L2_S9_Permission_Enable = false;
|
||||
public static String L2_S9_Permission = "commandgui.use.gui1.line2.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line3
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L3_S1_Enable = false;
|
||||
public static String L3_S1_Item = "";
|
||||
public static String L3_S1_Name = "";
|
||||
public static List L3_S1_Lore = Arrays.asList();
|
||||
public static Boolean L3_S1_Cost_Enable = false;
|
||||
public static Double L3_S1_Price = 0.00;
|
||||
public static Boolean L3_S1_Command_Enable = false;
|
||||
public static Boolean L3_S1_CommandAsConsole = false;
|
||||
public static String L3_S1_Command = "";
|
||||
public static Boolean L3_S1_Message_Enable = false;
|
||||
public static List<String> L3_S1_Message;
|
||||
public static Boolean L3_S1_Permission_Enable = false;
|
||||
public static String L3_S1_Permission = "commandgui.use.gui1.line3.slot1";
|
||||
|
||||
public static Boolean L3_S2_Enable = false;
|
||||
public static String L3_S2_Item = "";
|
||||
public static String L3_S2_Name = "";
|
||||
public static List L3_S2_Lore = Arrays.asList();
|
||||
public static Boolean L3_S2_Cost_Enable = false;
|
||||
public static Double L3_S2_Price = 0.00;
|
||||
public static Boolean L3_S2_Command_Enable = false;
|
||||
public static Boolean L3_S2_CommandAsConsole = false;
|
||||
public static String L3_S2_Command = "";
|
||||
public static Boolean L3_S2_Message_Enable = false;
|
||||
public static List<String> L3_S2_Message;
|
||||
public static Boolean L3_S2_Permission_Enable = false;
|
||||
public static String L3_S2_Permission = "commandgui.use.gui1.line3.slot2";
|
||||
|
||||
public static Boolean L3_S3_Enable = false;
|
||||
public static String L3_S3_Item = "";
|
||||
public static String L3_S3_Name = "";
|
||||
public static List L3_S3_Lore = Arrays.asList();
|
||||
public static Boolean L3_S3_Cost_Enable = false;
|
||||
public static Double L3_S3_Price = 0.00;
|
||||
public static Boolean L3_S3_Command_Enable = false;
|
||||
public static Boolean L3_S3_CommandAsConsole = false;
|
||||
public static String L3_S3_Command = "";
|
||||
public static Boolean L3_S3_Message_Enable = false;
|
||||
public static List<String> L3_S3_Message;
|
||||
public static Boolean L3_S3_Permission_Enable = false;
|
||||
public static String L3_S3_Permission = "commandgui.use.gui1.line3.slot3";
|
||||
|
||||
public static Boolean L3_S4_Enable = false;
|
||||
public static String L3_S4_Item = "";
|
||||
public static String L3_S4_Name = "";
|
||||
public static List L3_S4_Lore = Arrays.asList();
|
||||
public static Boolean L3_S4_Cost_Enable = false;
|
||||
public static Double L3_S4_Price = 0.00;
|
||||
public static Boolean L3_S4_Command_Enable = false;
|
||||
public static Boolean L3_S4_CommandAsConsole = false;
|
||||
public static String L3_S4_Command = "";
|
||||
public static Boolean L3_S4_Message_Enable = false;
|
||||
public static List<String> L3_S4_Message;
|
||||
public static Boolean L3_S4_Permission_Enable = false;
|
||||
public static String L3_S4_Permission = "commandgui.use.gui1.line3.slot4";
|
||||
|
||||
public static Boolean L3_S5_Enable = false;
|
||||
public static String L3_S5_Item = "";
|
||||
public static String L3_S5_Name = "";
|
||||
public static List L3_S5_Lore = Arrays.asList();
|
||||
public static Boolean L3_S5_Cost_Enable = false;
|
||||
public static Double L3_S5_Price = 0.00;
|
||||
public static Boolean L3_S5_Command_Enable = false;
|
||||
public static Boolean L3_S5_CommandAsConsole = false;
|
||||
public static String L3_S5_Command = "";
|
||||
public static Boolean L3_S5_Message_Enable = false;
|
||||
public static List<String> L3_S5_Message;
|
||||
public static Boolean L3_S5_Permission_Enable = false;
|
||||
public static String L3_S5_Permission = "commandgui.use.gui1.line3.slot5";
|
||||
|
||||
public static Boolean L3_S6_Enable = false;
|
||||
public static String L3_S6_Item = "";
|
||||
public static String L3_S6_Name = "";
|
||||
public static List L3_S6_Lore = Arrays.asList();
|
||||
public static Boolean L3_S6_Cost_Enable = false;
|
||||
public static Double L3_S6_Price = 0.00;
|
||||
public static Boolean L3_S6_Command_Enable = false;
|
||||
public static Boolean L3_S6_CommandAsConsole = false;
|
||||
public static String L3_S6_Command = "";
|
||||
public static Boolean L3_S6_Message_Enable = false;
|
||||
public static List<String> L3_S6_Message;
|
||||
public static Boolean L3_S6_Permission_Enable = false;
|
||||
public static String L3_S6_Permission = "commandgui.use.gui1.line3.slot6";
|
||||
|
||||
public static Boolean L3_S7_Enable = false;
|
||||
public static String L3_S7_Item = "";
|
||||
public static String L3_S7_Name = "";
|
||||
public static List L3_S7_Lore = Arrays.asList();
|
||||
public static Boolean L3_S7_Cost_Enable = false;
|
||||
public static Double L3_S7_Price = 0.00;
|
||||
public static Boolean L3_S7_Command_Enable = false;
|
||||
public static Boolean L3_S7_CommandAsConsole = false;
|
||||
public static String L3_S7_Command = "";
|
||||
public static Boolean L3_S7_Message_Enable = false;
|
||||
public static List<String> L3_S7_Message;
|
||||
public static Boolean L3_S7_Permission_Enable = false;
|
||||
public static String L3_S7_Permission = "commandgui.use.gui1.line3.slot7";
|
||||
|
||||
public static Boolean L3_S8_Enable = false;
|
||||
public static String L3_S8_Item = "";
|
||||
public static String L3_S8_Name = "";
|
||||
public static List L3_S8_Lore = Arrays.asList();
|
||||
public static Boolean L3_S8_Cost_Enable = false;
|
||||
public static Double L3_S8_Price = 0.00;
|
||||
public static Boolean L3_S8_Command_Enable = false;
|
||||
public static Boolean L3_S8_CommandAsConsole = false;
|
||||
public static String L3_S8_Command = "";
|
||||
public static Boolean L3_S8_Message_Enable = false;
|
||||
public static List<String> L3_S8_Message;
|
||||
public static Boolean L3_S8_Permission_Enable = false;
|
||||
public static String L3_S8_Permission = "commandgui.use.gui1.line3.slot8";
|
||||
|
||||
public static Boolean L3_S9_Enable = false;
|
||||
public static String L3_S9_Item = "";
|
||||
public static String L3_S9_Name = "";
|
||||
public static List L3_S9_Lore = Arrays.asList();
|
||||
public static Boolean L3_S9_Cost_Enable = false;
|
||||
public static Double L3_S9_Price = 0.00;
|
||||
public static Boolean L3_S9_Command_Enable = false;
|
||||
public static Boolean L3_S9_CommandAsConsole = false;
|
||||
public static String L3_S9_Command = "";
|
||||
public static Boolean L3_S9_Message_Enable = false;
|
||||
public static List<String> L3_S9_Message;
|
||||
public static Boolean L3_S9_Permission_Enable = false;
|
||||
public static String L3_S9_Permission = "commandgui.use.gui1.line3.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line4
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L4_S1_Enable = false;
|
||||
public static String L4_S1_Item = "";
|
||||
public static String L4_S1_Name = "";
|
||||
public static List L4_S1_Lore = Arrays.asList();
|
||||
public static Boolean L4_S1_Cost_Enable = false;
|
||||
public static Double L4_S1_Price = 0.00;
|
||||
public static Boolean L4_S1_Command_Enable = false;
|
||||
public static Boolean L4_S1_CommandAsConsole = false;
|
||||
public static String L4_S1_Command = "";
|
||||
public static Boolean L4_S1_Message_Enable = false;
|
||||
public static List<String> L4_S1_Message;
|
||||
public static Boolean L4_S1_Permission_Enable = false;
|
||||
public static String L4_S1_Permission = "commandgui.use.gui1.line4.slot1";
|
||||
|
||||
public static Boolean L4_S2_Enable = false;
|
||||
public static String L4_S2_Item = "";
|
||||
public static String L4_S2_Name = "";
|
||||
public static List L4_S2_Lore = Arrays.asList();
|
||||
public static Boolean L4_S2_Cost_Enable = false;
|
||||
public static Double L4_S2_Price = 0.00;
|
||||
public static Boolean L4_S2_Command_Enable = false;
|
||||
public static Boolean L4_S2_CommandAsConsole = false;
|
||||
public static String L4_S2_Command = "";
|
||||
public static Boolean L4_S2_Message_Enable = false;
|
||||
public static List<String> L4_S2_Message;
|
||||
public static Boolean L4_S2_Permission_Enable = false;
|
||||
public static String L4_S2_Permission = "commandgui.use.gui1.line4.slot2";
|
||||
|
||||
public static Boolean L4_S3_Enable = false;
|
||||
public static String L4_S3_Item = "";
|
||||
public static String L4_S3_Name = "";
|
||||
public static List L4_S3_Lore = Arrays.asList();
|
||||
public static Boolean L4_S3_Cost_Enable = false;
|
||||
public static Double L4_S3_Price = 0.00;
|
||||
public static Boolean L4_S3_Command_Enable = false;
|
||||
public static Boolean L4_S3_CommandAsConsole = false;
|
||||
public static String L4_S3_Command = "";
|
||||
public static Boolean L4_S3_Message_Enable = false;
|
||||
public static List<String> L4_S3_Message;
|
||||
public static Boolean L4_S3_Permission_Enable = false;
|
||||
public static String L4_S3_Permission = "commandgui.use.gui1.line4.slot3";
|
||||
|
||||
public static Boolean L4_S4_Enable = false;
|
||||
public static String L4_S4_Item = "";
|
||||
public static String L4_S4_Name = "";
|
||||
public static List L4_S4_Lore = Arrays.asList();
|
||||
public static Boolean L4_S4_Cost_Enable = false;
|
||||
public static Double L4_S4_Price = 0.00;
|
||||
public static Boolean L4_S4_Command_Enable = false;
|
||||
public static Boolean L4_S4_CommandAsConsole = false;
|
||||
public static String L4_S4_Command = "";
|
||||
public static Boolean L4_S4_Message_Enable = false;
|
||||
public static List<String> L4_S4_Message;
|
||||
public static Boolean L4_S4_Permission_Enable = false;
|
||||
public static String L4_S4_Permission = "commandgui.use.gui1.line4.slot4";
|
||||
|
||||
public static Boolean L4_S5_Enable = false;
|
||||
public static String L4_S5_Item = "";
|
||||
public static String L4_S5_Name = "";
|
||||
public static List L4_S5_Lore = Arrays.asList();
|
||||
public static Boolean L4_S5_Cost_Enable = false;
|
||||
public static Double L4_S5_Price = 0.00;
|
||||
public static Boolean L4_S5_Command_Enable = false;
|
||||
public static Boolean L4_S5_CommandAsConsole = false;
|
||||
public static String L4_S5_Command = "";
|
||||
public static Boolean L4_S5_Message_Enable = false;
|
||||
public static List<String> L4_S5_Message;
|
||||
public static Boolean L4_S5_Permission_Enable = false;
|
||||
public static String L4_S5_Permission = "commandgui.use.gui1.line4.slot5";
|
||||
|
||||
public static Boolean L4_S6_Enable = false;
|
||||
public static String L4_S6_Item = "";
|
||||
public static String L4_S6_Name = "";
|
||||
public static List L4_S6_Lore = Arrays.asList();
|
||||
public static Boolean L4_S6_Cost_Enable = false;
|
||||
public static Double L4_S6_Price = 0.00;
|
||||
public static Boolean L4_S6_Command_Enable = false;
|
||||
public static Boolean L4_S6_CommandAsConsole = false;
|
||||
public static String L4_S6_Command = "";
|
||||
public static Boolean L4_S6_Message_Enable = false;
|
||||
public static List<String> L4_S6_Message;
|
||||
public static Boolean L4_S6_Permission_Enable = false;
|
||||
public static String L4_S6_Permission = "commandgui.use.gui1.line4.slot6";
|
||||
|
||||
public static Boolean L4_S7_Enable = false;
|
||||
public static String L4_S7_Item = "";
|
||||
public static String L4_S7_Name = "";
|
||||
public static List L4_S7_Lore = Arrays.asList();
|
||||
public static Boolean L4_S7_Cost_Enable = false;
|
||||
public static Double L4_S7_Price = 0.00;
|
||||
public static Boolean L4_S7_Command_Enable = false;
|
||||
public static Boolean L4_S7_CommandAsConsole = false;
|
||||
public static String L4_S7_Command = "";
|
||||
public static Boolean L4_S7_Message_Enable = false;
|
||||
public static List<String> L4_S7_Message;
|
||||
public static Boolean L4_S7_Permission_Enable = false;
|
||||
public static String L4_S7_Permission = "commandgui.use.gui1.line4.slot7";
|
||||
|
||||
public static Boolean L4_S8_Enable = false;
|
||||
public static String L4_S8_Item = "";
|
||||
public static String L4_S8_Name = "";
|
||||
public static List L4_S8_Lore = Arrays.asList();
|
||||
public static Boolean L4_S8_Cost_Enable = false;
|
||||
public static Double L4_S8_Price = 0.00;
|
||||
public static Boolean L4_S8_Command_Enable = false;
|
||||
public static Boolean L4_S8_CommandAsConsole = false;
|
||||
public static String L4_S8_Command = "";
|
||||
public static Boolean L4_S8_Message_Enable = false;
|
||||
public static List<String> L4_S8_Message;
|
||||
public static Boolean L4_S8_Permission_Enable = false;
|
||||
public static String L4_S8_Permission = "commandgui.use.gui1.line4.slot8";
|
||||
|
||||
public static Boolean L4_S9_Enable = false;
|
||||
public static String L4_S9_Item = "";
|
||||
public static String L4_S9_Name = "";
|
||||
public static List L4_S9_Lore = Arrays.asList();
|
||||
public static Boolean L4_S9_Cost_Enable = false;
|
||||
public static Double L4_S9_Price = 0.00;
|
||||
public static Boolean L4_S9_Command_Enable = false;
|
||||
public static Boolean L4_S9_CommandAsConsole = false;
|
||||
public static String L4_S9_Command = "";
|
||||
public static Boolean L4_S9_Message_Enable = false;
|
||||
public static List<String> L4_S9_Message;
|
||||
public static Boolean L4_S9_Permission_Enable = false;
|
||||
public static String L4_S9_Permission = "commandgui.use.gui1.line4.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line5
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L5_S1_Enable = false;
|
||||
public static String L5_S1_Item = "";
|
||||
public static String L5_S1_Name = "";
|
||||
public static List L5_S1_Lore = Arrays.asList();
|
||||
public static Boolean L5_S1_Cost_Enable = false;
|
||||
public static Double L5_S1_Price = 0.00;
|
||||
public static Boolean L5_S1_Command_Enable = false;
|
||||
public static Boolean L5_S1_CommandAsConsole = false;
|
||||
public static String L5_S1_Command = "";
|
||||
public static Boolean L5_S1_Message_Enable = false;
|
||||
public static List<String> L5_S1_Message;
|
||||
public static Boolean L5_S1_Permission_Enable = false;
|
||||
public static String L5_S1_Permission = "commandgui.use.gui1.line5.slot1";
|
||||
|
||||
public static Boolean L5_S2_Enable = false;
|
||||
public static String L5_S2_Item = "";
|
||||
public static String L5_S2_Name = "";
|
||||
public static List L5_S2_Lore = Arrays.asList();
|
||||
public static Boolean L5_S2_Cost_Enable = false;
|
||||
public static Double L5_S2_Price = 0.00;
|
||||
public static Boolean L5_S2_Command_Enable = false;
|
||||
public static Boolean L5_S2_CommandAsConsole = false;
|
||||
public static String L5_S2_Command = "";
|
||||
public static Boolean L5_S2_Message_Enable = false;
|
||||
public static List<String> L5_S2_Message;
|
||||
public static Boolean L5_S2_Permission_Enable = false;
|
||||
public static String L5_S2_Permission = "commandgui.use.gui1.line5.slot2";
|
||||
|
||||
public static Boolean L5_S3_Enable = false;
|
||||
public static String L5_S3_Item = "";
|
||||
public static String L5_S3_Name = "";
|
||||
public static List L5_S3_Lore = Arrays.asList();
|
||||
public static Boolean L5_S3_Cost_Enable = false;
|
||||
public static Double L5_S3_Price = 0.00;
|
||||
public static Boolean L5_S3_Command_Enable = false;
|
||||
public static Boolean L5_S3_CommandAsConsole = false;
|
||||
public static String L5_S3_Command = "";
|
||||
public static Boolean L5_S3_Message_Enable = false;
|
||||
public static List<String> L5_S3_Message;
|
||||
public static Boolean L5_S3_Permission_Enable = false;
|
||||
public static String L5_S3_Permission = "commandgui.use.gui1.line5.slot3";
|
||||
|
||||
public static Boolean L5_S4_Enable = false;
|
||||
public static String L5_S4_Item = "";
|
||||
public static String L5_S4_Name = "";
|
||||
public static List L5_S4_Lore = Arrays.asList();
|
||||
public static Boolean L5_S4_Cost_Enable = false;
|
||||
public static Double L5_S4_Price = 0.00;
|
||||
public static Boolean L5_S4_Command_Enable = false;
|
||||
public static Boolean L5_S4_CommandAsConsole = false;
|
||||
public static String L5_S4_Command = "";
|
||||
public static Boolean L5_S4_Message_Enable = false;
|
||||
public static List<String> L5_S4_Message;
|
||||
public static Boolean L5_S4_Permission_Enable = false;
|
||||
public static String L5_S4_Permission = "commandgui.use.gui1.line5.slot4";
|
||||
|
||||
public static Boolean L5_S5_Enable = false;
|
||||
public static String L5_S5_Item = "";
|
||||
public static String L5_S5_Name = "";
|
||||
public static List L5_S5_Lore = Arrays.asList();
|
||||
public static Boolean L5_S5_Cost_Enable = false;
|
||||
public static Double L5_S5_Price = 0.00;
|
||||
public static Boolean L5_S5_Command_Enable = false;
|
||||
public static Boolean L5_S5_CommandAsConsole = false;
|
||||
public static String L5_S5_Command = "";
|
||||
public static Boolean L5_S5_Message_Enable = false;
|
||||
public static List<String> L5_S5_Message;
|
||||
public static Boolean L5_S5_Permission_Enable = false;
|
||||
public static String L5_S5_Permission = "commandgui.use.gui1.line5.slot5";
|
||||
|
||||
public static Boolean L5_S6_Enable = false;
|
||||
public static String L5_S6_Item = "";
|
||||
public static String L5_S6_Name = "";
|
||||
public static List L5_S6_Lore = Arrays.asList();
|
||||
public static Boolean L5_S6_Cost_Enable = false;
|
||||
public static Double L5_S6_Price = 0.00;
|
||||
public static Boolean L5_S6_Command_Enable = false;
|
||||
public static Boolean L5_S6_CommandAsConsole = false;
|
||||
public static String L5_S6_Command = "";
|
||||
public static Boolean L5_S6_Message_Enable = false;
|
||||
public static List<String> L5_S6_Message;
|
||||
public static Boolean L5_S6_Permission_Enable = false;
|
||||
public static String L5_S6_Permission = "commandgui.use.gui1.line5.slot6";
|
||||
|
||||
public static Boolean L5_S7_Enable = false;
|
||||
public static String L5_S7_Item = "";
|
||||
public static String L5_S7_Name = "";
|
||||
public static List L5_S7_Lore = Arrays.asList();
|
||||
public static Boolean L5_S7_Cost_Enable = false;
|
||||
public static Double L5_S7_Price = 0.00;
|
||||
public static Boolean L5_S7_Command_Enable = false;
|
||||
public static Boolean L5_S7_CommandAsConsole = false;
|
||||
public static String L5_S7_Command = "";
|
||||
public static Boolean L5_S7_Message_Enable = false;
|
||||
public static List<String> L5_S7_Message;
|
||||
public static Boolean L5_S7_Permission_Enable = false;
|
||||
public static String L5_S7_Permission = "commandgui.use.gui1.line5.slot7";
|
||||
|
||||
public static Boolean L5_S8_Enable = false;
|
||||
public static String L5_S8_Item = "";
|
||||
public static String L5_S8_Name = "";
|
||||
public static List L5_S8_Lore = Arrays.asList();
|
||||
public static Boolean L5_S8_Cost_Enable = false;
|
||||
public static Double L5_S8_Price = 0.00;
|
||||
public static Boolean L5_S8_Command_Enable = false;
|
||||
public static Boolean L5_S8_CommandAsConsole = false;
|
||||
public static String L5_S8_Command = "";
|
||||
public static Boolean L5_S8_Message_Enable = false;
|
||||
public static List<String> L5_S8_Message;
|
||||
public static Boolean L5_S8_Permission_Enable = false;
|
||||
public static String L5_S8_Permission = "commandgui.use.gui1.line5.slot8";
|
||||
|
||||
public static Boolean L5_S9_Enable = false;
|
||||
public static String L5_S9_Item = "";
|
||||
public static String L5_S9_Name = "";
|
||||
public static List L5_S9_Lore = Arrays.asList();
|
||||
public static Boolean L5_S9_Cost_Enable = false;
|
||||
public static Double L5_S9_Price = 0.00;
|
||||
public static Boolean L5_S9_Command_Enable = false;
|
||||
public static Boolean L5_S9_CommandAsConsole = false;
|
||||
public static String L5_S9_Command = "";
|
||||
public static Boolean L5_S9_Message_Enable = false;
|
||||
public static List<String> L5_S9_Message;
|
||||
public static Boolean L5_S9_Permission_Enable = false;
|
||||
public static String L5_S9_Permission = "commandgui.use.gui1.line5.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line6
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L6_S1_Enable = false;
|
||||
public static String L6_S1_Item = "";
|
||||
public static String L6_S1_Name = "";
|
||||
public static List L6_S1_Lore = Arrays.asList();
|
||||
public static Boolean L6_S1_Cost_Enable = false;
|
||||
public static Double L6_S1_Price = 0.00;
|
||||
public static Boolean L6_S1_Command_Enable = false;
|
||||
public static Boolean L6_S1_CommandAsConsole = false;
|
||||
public static String L6_S1_Command = "";
|
||||
public static Boolean L6_S1_Message_Enable = false;
|
||||
public static List<String> L6_S1_Message;
|
||||
public static Boolean L6_S1_Permission_Enable = false;
|
||||
public static String L6_S1_Permission = "commandgui.use.gui1.line6.slot1";
|
||||
|
||||
public static Boolean L6_S2_Enable = false;
|
||||
public static String L6_S2_Item = "";
|
||||
public static String L6_S2_Name = "";
|
||||
public static List L6_S2_Lore = Arrays.asList();
|
||||
public static Boolean L6_S2_Cost_Enable = false;
|
||||
public static Double L6_S2_Price = 0.00;
|
||||
public static Boolean L6_S2_Command_Enable = false;
|
||||
public static Boolean L6_S2_CommandAsConsole = false;
|
||||
public static String L6_S2_Command = "";
|
||||
public static Boolean L6_S2_Message_Enable = false;
|
||||
public static List<String> L6_S2_Message;
|
||||
public static Boolean L6_S2_Permission_Enable = false;
|
||||
public static String L6_S2_Permission = "commandgui.use.gui1.line6.slot2";
|
||||
|
||||
public static Boolean L6_S3_Enable = false;
|
||||
public static String L6_S3_Item = "";
|
||||
public static String L6_S3_Name = "";
|
||||
public static List L6_S3_Lore = Arrays.asList();
|
||||
public static Boolean L6_S3_Cost_Enable = false;
|
||||
public static Double L6_S3_Price = 0.00;
|
||||
public static Boolean L6_S3_Command_Enable = false;
|
||||
public static Boolean L6_S3_CommandAsConsole = false;
|
||||
public static String L6_S3_Command = "";
|
||||
public static Boolean L6_S3_Message_Enable = false;
|
||||
public static List<String> L6_S3_Message;
|
||||
public static Boolean L6_S3_Permission_Enable = false;
|
||||
public static String L6_S3_Permission = "commandgui.use.gui1.line6.slot3";
|
||||
|
||||
public static Boolean L6_S4_Enable = false;
|
||||
public static String L6_S4_Item = "";
|
||||
public static String L6_S4_Name = "";
|
||||
public static List L6_S4_Lore = Arrays.asList();
|
||||
public static Boolean L6_S4_Cost_Enable = false;
|
||||
public static Double L6_S4_Price = 0.00;
|
||||
public static Boolean L6_S4_Command_Enable = false;
|
||||
public static Boolean L6_S4_CommandAsConsole = false;
|
||||
public static String L6_S4_Command = "";
|
||||
public static Boolean L6_S4_Message_Enable = false;
|
||||
public static List<String> L6_S4_Message;
|
||||
public static Boolean L6_S4_Permission_Enable = false;
|
||||
public static String L6_S4_Permission = "commandgui.use.gui1.line6.slot4";
|
||||
|
||||
public static Boolean L6_S5_Enable = false;
|
||||
public static String L6_S5_Item = "";
|
||||
public static String L6_S5_Name = "";
|
||||
public static List L6_S5_Lore = Arrays.asList();
|
||||
public static Boolean L6_S5_Cost_Enable = false;
|
||||
public static Double L6_S5_Price = 0.00;
|
||||
public static Boolean L6_S5_Command_Enable = false;
|
||||
public static Boolean L6_S5_CommandAsConsole = false;
|
||||
public static String L6_S5_Command = "";
|
||||
public static Boolean L6_S5_Message_Enable = false;
|
||||
public static List<String> L6_S5_Message;
|
||||
public static Boolean L6_S5_Permission_Enable = false;
|
||||
public static String L6_S5_Permission = "commandgui.use.gui1.line6.slot5";
|
||||
|
||||
public static Boolean L6_S6_Enable = false;
|
||||
public static String L6_S6_Item = "";
|
||||
public static String L6_S6_Name = "";
|
||||
public static List L6_S6_Lore = Arrays.asList();
|
||||
public static Boolean L6_S6_Cost_Enable = false;
|
||||
public static Double L6_S6_Price = 0.00;
|
||||
public static Boolean L6_S6_Command_Enable = false;
|
||||
public static Boolean L6_S6_CommandAsConsole = false;
|
||||
public static String L6_S6_Command = "";
|
||||
public static Boolean L6_S6_Message_Enable = false;
|
||||
public static List<String> L6_S6_Message;
|
||||
public static Boolean L6_S6_Permission_Enable = false;
|
||||
public static String L6_S6_Permission = "commandgui.use.gui1.line6.slot6";
|
||||
|
||||
public static Boolean L6_S7_Enable = false;
|
||||
public static String L6_S7_Item = "";
|
||||
public static String L6_S7_Name = "";
|
||||
public static List L6_S7_Lore = Arrays.asList();
|
||||
public static Boolean L6_S7_Cost_Enable = false;
|
||||
public static Double L6_S7_Price = 0.00;
|
||||
public static Boolean L6_S7_Command_Enable = false;
|
||||
public static Boolean L6_S7_CommandAsConsole = false;
|
||||
public static String L6_S7_Command = "";
|
||||
public static Boolean L6_S7_Message_Enable = false;
|
||||
public static List<String> L6_S7_Message;
|
||||
public static Boolean L6_S7_Permission_Enable = false;
|
||||
public static String L6_S7_Permission = "commandgui.use.gui1.line6.slot7";
|
||||
|
||||
public static Boolean L6_S8_Enable = false;
|
||||
public static String L6_S8_Item = "";
|
||||
public static String L6_S8_Name = "";
|
||||
public static List L6_S8_Lore = Arrays.asList();
|
||||
public static Boolean L6_S8_Cost_Enable = false;
|
||||
public static Double L6_S8_Price = 0.00;
|
||||
public static Boolean L6_S8_Command_Enable = false;
|
||||
public static Boolean L6_S8_CommandAsConsole = false;
|
||||
public static String L6_S8_Command = "";
|
||||
public static Boolean L6_S8_Message_Enable = false;
|
||||
public static List<String> L6_S8_Message;
|
||||
public static Boolean L6_S8_Permission_Enable = false;
|
||||
public static String L6_S8_Permission = "commandgui.use.gui1.line6.slot8";
|
||||
|
||||
public static Boolean L6_S9_Enable = false;
|
||||
public static String L6_S9_Item = "";
|
||||
public static String L6_S9_Name = "";
|
||||
public static List L6_S9_Lore = Arrays.asList();
|
||||
public static Boolean L6_S9_Cost_Enable = false;
|
||||
public static Double L6_S9_Price = 0.00;
|
||||
public static Boolean L6_S9_Command_Enable = false;
|
||||
public static Boolean L6_S9_CommandAsConsole = false;
|
||||
public static String L6_S9_Command = "";
|
||||
public static Boolean L6_S9_Message_Enable = false;
|
||||
public static List<String> L6_S9_Message;
|
||||
public static Boolean L6_S9_Permission_Enable = false;
|
||||
public static String L6_S9_Permission = "commandgui.use.gui1.line6.slot9";
|
||||
}
|
@ -0,0 +1,833 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
// -----------------------------
|
||||
// _____ _____ _ _ _____
|
||||
// / ____/ ____| | | |_ _|
|
||||
// | | | | __| | | | | |
|
||||
// | | | | |_ | | | | | |
|
||||
// | |___| |__| | |__| |_| |_
|
||||
// \_____\_____|\____/|_____|
|
||||
// -----------------------------
|
||||
|
||||
package de.jatitv.commandgui.defaultValue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class DefaultValue_GUI_2 {
|
||||
|
||||
public static Boolean GiveUseItemOnFirstJoin = false;
|
||||
public static Boolean GiveUseItemOnFirstJoin_Permission_Enable = false;
|
||||
|
||||
public static Boolean GUI_Enable = false;
|
||||
|
||||
public static String GiveUseItemOnFirstJoin_Permission = "commandgui.giveuseitemonfirstjoin.gui2";
|
||||
public static String UseItem_Item = "PAPER";
|
||||
public static String UseItem_Name = "§7Open the: [guiname]";
|
||||
public static List UseItem_Lore = Arrays.asList();
|
||||
|
||||
public static String Command = "GUI2";
|
||||
public static Boolean Command_Permission_Enable = true;
|
||||
|
||||
public static String GUIName = "§9GUI §52";
|
||||
public static Boolean FillItem_Enable = true;
|
||||
public static String FillItem = "BLACK_STAINED_GLASS_PANE";
|
||||
public static short FillItem_1_8 = 15;
|
||||
public static Integer GUILines = 1;
|
||||
|
||||
public static Boolean Permission_Enable = false;
|
||||
public static String Permission = "commandgui.use.gui2";
|
||||
|
||||
|
||||
/**
|
||||
* line1
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L1_S1_Enable = false;
|
||||
public static Boolean L1_S1_Playerhead = true;
|
||||
public static String L1_S1_Item = "";
|
||||
public static String L1_S1_Name = "";
|
||||
public static List L1_S1_Lore = Arrays.asList();
|
||||
public static Boolean L1_S1_Cost_Enable = false;
|
||||
public static Double L1_S1_Price = 0.00;
|
||||
public static Boolean L1_S1_Command_Enable = false;
|
||||
public static Boolean L1_S1_CommandAsConsole = false;
|
||||
public static String L1_S1_Command = "";
|
||||
public static Boolean L1_S1_Message_Enable = false;
|
||||
public static List<String> L1_S1_Message;
|
||||
public static Boolean L1_S1_Permission_Enable = false;
|
||||
public static String L1_S1_Permission = "commandgui.use.gui2.line1.slot1";
|
||||
|
||||
public static Boolean L1_S2_Enable = false;
|
||||
public static String L1_S2_Item = "";
|
||||
public static String L1_S2_Name = "";
|
||||
public static List L1_S2_Lore = Arrays.asList();
|
||||
public static Boolean L1_S2_Cost_Enable = false;
|
||||
public static Double L1_S2_Price = 0.00;
|
||||
public static Boolean L1_S2_Command_Enable = false;
|
||||
public static Boolean L1_S2_CommandAsConsole = false;
|
||||
public static String L1_S2_Command = "";
|
||||
public static Boolean L1_S2_Message_Enable = false;
|
||||
public static List<String> L1_S2_Message;
|
||||
public static Boolean L1_S2_Permission_Enable = false;
|
||||
public static String L1_S2_Permission = "commandgui.use.gui2.line1.slot2";
|
||||
|
||||
public static Boolean L1_S3_Enable = false;
|
||||
public static String L1_S3_Item = "";
|
||||
public static String L1_S3_Name = "";
|
||||
public static List L1_S3_Lore = Arrays.asList();
|
||||
public static Boolean L1_S3_Cost_Enable = false;
|
||||
public static Double L1_S3_Price = 0.00;
|
||||
public static Boolean L1_S3_Command_Enable = false;
|
||||
public static Boolean L1_S3_CommandAsConsole = false;
|
||||
public static String L1_S3_Command = "";
|
||||
public static Boolean L1_S3_Message_Enable = false;
|
||||
public static List<String> L1_S3_Message;
|
||||
public static Boolean L1_S3_Permission_Enable = false;
|
||||
public static String L1_S3_Permission = "commandgui.use.gui2.line1.slot3";
|
||||
|
||||
public static Boolean L1_S4_Enable = false;
|
||||
public static String L1_S4_Item = "";
|
||||
public static String L1_S4_Name = "";
|
||||
public static List L1_S4_Lore = Arrays.asList();
|
||||
public static Boolean L1_S4_Cost_Enable = false;
|
||||
public static Double L1_S4_Price = 0.00;
|
||||
public static Boolean L1_S4_Command_Enable = false;
|
||||
public static Boolean L1_S4_CommandAsConsole = false;
|
||||
public static String L1_S4_Command = "";
|
||||
public static Boolean L1_S4_Message_Enable = false;
|
||||
public static List<String> L1_S4_Message;
|
||||
public static Boolean L1_S4_Permission_Enable = false;
|
||||
public static String L1_S4_Permission = "commandgui.use.gui2.line1.slot4";
|
||||
|
||||
public static Boolean L1_S5_Enable = false;
|
||||
public static String L1_S5_Item = "";
|
||||
public static String L1_S5_Name = "";
|
||||
public static List L1_S5_Lore = Arrays.asList();
|
||||
public static Boolean L1_S5_Cost_Enable = false;
|
||||
public static Double L1_S5_Price = 0.00;
|
||||
public static Boolean L1_S5_Command_Enable = false;
|
||||
public static Boolean L1_S5_CommandAsConsole = false;
|
||||
public static String L1_S5_Command = "";
|
||||
public static Boolean L1_S5_Message_Enable = false;
|
||||
public static List<String> L1_S5_Message;
|
||||
public static Boolean L1_S5_Permission_Enable = false;
|
||||
public static String L1_S5_Permission = "commandgui.use.gui2.line1.slot5";
|
||||
|
||||
public static Boolean L1_S6_Enable = false;
|
||||
public static String L1_S6_Item = "";
|
||||
public static String L1_S6_Name = "";
|
||||
public static List L1_S6_Lore = Arrays.asList();
|
||||
public static Boolean L1_S6_Cost_Enable = false;
|
||||
public static Double L1_S6_Price = 0.00;
|
||||
public static Boolean L1_S6_Command_Enable = false;
|
||||
public static Boolean L1_S6_CommandAsConsole = false;
|
||||
public static String L1_S6_Command = "";
|
||||
public static Boolean L1_S6_Message_Enable = false;
|
||||
public static List<String> L1_S6_Message;
|
||||
public static Boolean L1_S6_Permission_Enable = false;
|
||||
public static String L1_S6_Permission = "commandgui.use.gui2.line1.slot6";
|
||||
|
||||
public static Boolean L1_S7_Enable = false;
|
||||
public static String L1_S7_Item = "";
|
||||
public static String L1_S7_Name = "";
|
||||
public static List L1_S7_Lore = Arrays.asList();
|
||||
public static Boolean L1_S7_Cost_Enable = false;
|
||||
public static Double L1_S7_Price = 0.00;
|
||||
public static Boolean L1_S7_Command_Enable = false;
|
||||
public static Boolean L1_S7_CommandAsConsole = false;
|
||||
public static String L1_S7_Command = "";
|
||||
public static Boolean L1_S7_Message_Enable = false;
|
||||
public static List<String> L1_S7_Message;
|
||||
public static Boolean L1_S7_Permission_Enable = false;
|
||||
public static String L1_S7_Permission = "commandgui.use.gui2.line1.slot7";
|
||||
|
||||
public static Boolean L1_S8_Enable = false;
|
||||
public static String L1_S8_Item = "";
|
||||
public static String L1_S8_Name = "";
|
||||
public static List L1_S8_Lore = Arrays.asList();
|
||||
public static Boolean L1_S8_Cost_Enable = false;
|
||||
public static Double L1_S8_Price = 0.00;
|
||||
public static Boolean L1_S8_Command_Enable = false;
|
||||
public static Boolean L1_S8_CommandAsConsole = false;
|
||||
public static String L1_S8_Command = "";
|
||||
public static Boolean L1_S8_Message_Enable = false;
|
||||
public static List<String> L1_S8_Message;
|
||||
public static Boolean L1_S8_Permission_Enable = false;
|
||||
public static String L1_S8_Permission = "commandgui.use.gui2.line1.slot8";
|
||||
|
||||
public static Boolean L1_S9_Enable = false;
|
||||
public static String L1_S9_Item = "";
|
||||
public static String L1_S9_Name = "";
|
||||
public static List L1_S9_Lore = Arrays.asList();
|
||||
public static Boolean L1_S9_Cost_Enable = false;
|
||||
public static Double L1_S9_Price = 0.00;
|
||||
public static Boolean L1_S9_Command_Enable = false;
|
||||
public static Boolean L1_S9_CommandAsConsole = false;
|
||||
public static String L1_S9_Command = "";
|
||||
public static Boolean L1_S9_Message_Enable = false;
|
||||
public static List<String> L1_S9_Message;
|
||||
public static Boolean L1_S9_Permission_Enable = false;
|
||||
public static String L1_S9_Permission = "commandgui.use.gui2.line1.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line2
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L2_S1_Enable = false;
|
||||
public static String L2_S1_Item = "";
|
||||
public static String L2_S1_Name = "";
|
||||
public static List L2_S1_Lore = Arrays.asList();
|
||||
public static Boolean L2_S1_Cost_Enable = false;
|
||||
public static Double L2_S1_Price = 0.00;
|
||||
public static Boolean L2_S1_Command_Enable = false;
|
||||
public static Boolean L2_S1_CommandAsConsole = false;
|
||||
public static String L2_S1_Command = "";
|
||||
public static Boolean L2_S1_Message_Enable = false;
|
||||
public static List<String> L2_S1_Message;
|
||||
public static Boolean L2_S1_Permission_Enable = false;
|
||||
public static String L2_S1_Permission = "commandgui.use.gui2.line2.slot1";
|
||||
|
||||
public static Boolean L2_S2_Enable = false;
|
||||
public static String L2_S2_Item = "";
|
||||
public static String L2_S2_Name = "";
|
||||
public static List L2_S2_Lore = Arrays.asList();
|
||||
public static Boolean L2_S2_Cost_Enable = false;
|
||||
public static Double L2_S2_Price = 0.00;
|
||||
public static Boolean L2_S2_Command_Enable = false;
|
||||
public static Boolean L2_S2_CommandAsConsole = false;
|
||||
public static String L2_S2_Command = "";
|
||||
public static Boolean L2_S2_Message_Enable = false;
|
||||
public static List<String> L2_S2_Message;
|
||||
public static Boolean L2_S2_Permission_Enable = false;
|
||||
public static String L2_S2_Permission = "commandgui.use.gui2.line2.slot2";
|
||||
|
||||
public static Boolean L2_S3_Enable = false;
|
||||
public static String L2_S3_Item = "";
|
||||
public static String L2_S3_Name = "";
|
||||
public static List L2_S3_Lore = Arrays.asList();
|
||||
public static Boolean L2_S3_Cost_Enable = false;
|
||||
public static Double L2_S3_Price = 0.00;
|
||||
public static Boolean L2_S3_Command_Enable = false;
|
||||
public static Boolean L2_S3_CommandAsConsole = false;
|
||||
public static String L2_S3_Command = "";
|
||||
public static Boolean L2_S3_Message_Enable = false;
|
||||
public static List<String> L2_S3_Message;
|
||||
public static Boolean L2_S3_Permission_Enable = false;
|
||||
public static String L2_S3_Permission = "commandgui.use.gui2.line2.slot3";
|
||||
|
||||
public static Boolean L2_S4_Enable = false;
|
||||
public static String L2_S4_Item = "";
|
||||
public static String L2_S4_Name = "";
|
||||
public static List L2_S4_Lore = Arrays.asList();
|
||||
public static Boolean L2_S4_Cost_Enable = false;
|
||||
public static Double L2_S4_Price = 0.00;
|
||||
public static Boolean L2_S4_Command_Enable = false;
|
||||
public static Boolean L2_S4_CommandAsConsole = false;
|
||||
public static String L2_S4_Command = "";
|
||||
public static Boolean L2_S4_Message_Enable = false;
|
||||
public static List<String> L2_S4_Message;
|
||||
public static Boolean L2_S4_Permission_Enable = false;
|
||||
public static String L2_S4_Permission = "commandgui.use.gui2.line2.slot4";
|
||||
|
||||
public static Boolean L2_S5_Enable = false;
|
||||
public static String L2_S5_Item = "";
|
||||
public static String L2_S5_Name = "";
|
||||
public static List L2_S5_Lore = Arrays.asList();
|
||||
public static Boolean L2_S5_Cost_Enable = false;
|
||||
public static Double L2_S5_Price = 0.00;
|
||||
public static Boolean L2_S5_Command_Enable = false;
|
||||
public static Boolean L2_S5_CommandAsConsole = false;
|
||||
public static String L2_S5_Command = "";
|
||||
public static Boolean L2_S5_Message_Enable = false;
|
||||
public static List<String> L2_S5_Message;
|
||||
public static Boolean L2_S5_Permission_Enable = false;
|
||||
public static String L2_S5_Permission = "commandgui.use.gui2.line2.slot5";
|
||||
|
||||
public static Boolean L2_S6_Enable = false;
|
||||
public static String L2_S6_Item = "";
|
||||
public static String L2_S6_Name = "";
|
||||
public static List L2_S6_Lore = Arrays.asList();
|
||||
public static Boolean L2_S6_Cost_Enable = false;
|
||||
public static Double L2_S6_Price = 0.00;
|
||||
public static Boolean L2_S6_Command_Enable = false;
|
||||
public static Boolean L2_S6_CommandAsConsole = false;
|
||||
public static String L2_S6_Command = "";
|
||||
public static Boolean L2_S6_Message_Enable = false;
|
||||
public static List<String> L2_S6_Message;
|
||||
public static Boolean L2_S6_Permission_Enable = false;
|
||||
public static String L2_S6_Permission = "commandgui.use.gui2.line2.slot6";
|
||||
|
||||
public static Boolean L2_S7_Enable = false;
|
||||
public static String L2_S7_Item = "";
|
||||
public static String L2_S7_Name = "";
|
||||
public static List L2_S7_Lore = Arrays.asList();
|
||||
public static Boolean L2_S7_Cost_Enable = false;
|
||||
public static Double L2_S7_Price = 0.00;
|
||||
public static Boolean L2_S7_Command_Enable = false;
|
||||
public static Boolean L2_S7_CommandAsConsole = false;
|
||||
public static String L2_S7_Command = "";
|
||||
public static Boolean L2_S7_Message_Enable = false;
|
||||
public static List<String> L2_S7_Message;
|
||||
public static Boolean L2_S7_Permission_Enable = false;
|
||||
public static String L2_S7_Permission = "commandgui.use.gui2.line2.slot7";
|
||||
|
||||
public static Boolean L2_S8_Enable = false;
|
||||
public static String L2_S8_Item = "";
|
||||
public static String L2_S8_Name = "";
|
||||
public static List L2_S8_Lore = Arrays.asList();
|
||||
public static Boolean L2_S8_Cost_Enable = false;
|
||||
public static Double L2_S8_Price = 0.00;
|
||||
public static Boolean L2_S8_Command_Enable = false;
|
||||
public static Boolean L2_S8_CommandAsConsole = false;
|
||||
public static String L2_S8_Command = "";
|
||||
public static Boolean L2_S8_Message_Enable = false;
|
||||
public static List<String> L2_S8_Message;
|
||||
public static Boolean L2_S8_Permission_Enable = false;
|
||||
public static String L2_S8_Permission = "commandgui.use.gui2.line2.slot8";
|
||||
|
||||
public static Boolean L2_S9_Enable = false;
|
||||
public static String L2_S9_Item = "";
|
||||
public static String L2_S9_Name = "";
|
||||
public static List L2_S9_Lore = Arrays.asList();
|
||||
public static Boolean L2_S9_Cost_Enable = false;
|
||||
public static Double L2_S9_Price = 0.00;
|
||||
public static Boolean L2_S9_Command_Enable = false;
|
||||
public static Boolean L2_S9_CommandAsConsole = false;
|
||||
public static String L2_S9_Command = "";
|
||||
public static Boolean L2_S9_Message_Enable = false;
|
||||
public static List<String> L2_S9_Message;
|
||||
public static Boolean L2_S9_Permission_Enable = false;
|
||||
public static String L2_S9_Permission = "commandgui.use.gui2.line2.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line3
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L3_S1_Enable = false;
|
||||
public static String L3_S1_Item = "";
|
||||
public static String L3_S1_Name = "";
|
||||
public static List L3_S1_Lore = Arrays.asList();
|
||||
public static Boolean L3_S1_Cost_Enable = false;
|
||||
public static Double L3_S1_Price = 0.00;
|
||||
public static Boolean L3_S1_Command_Enable = false;
|
||||
public static Boolean L3_S1_CommandAsConsole = false;
|
||||
public static String L3_S1_Command = "";
|
||||
public static Boolean L3_S1_Message_Enable = false;
|
||||
public static List<String> L3_S1_Message;
|
||||
public static Boolean L3_S1_Permission_Enable = false;
|
||||
public static String L3_S1_Permission = "commandgui.use.gui2.line3.slot1";
|
||||
|
||||
public static Boolean L3_S2_Enable = false;
|
||||
public static String L3_S2_Item = "";
|
||||
public static String L3_S2_Name = "";
|
||||
public static List L3_S2_Lore = Arrays.asList();
|
||||
public static Boolean L3_S2_Cost_Enable = false;
|
||||
public static Double L3_S2_Price = 0.00;
|
||||
public static Boolean L3_S2_Command_Enable = false;
|
||||
public static Boolean L3_S2_CommandAsConsole = false;
|
||||
public static String L3_S2_Command = "";
|
||||
public static Boolean L3_S2_Message_Enable = false;
|
||||
public static List<String> L3_S2_Message;
|
||||
public static Boolean L3_S2_Permission_Enable = false;
|
||||
public static String L3_S2_Permission = "commandgui.use.gui2.line3.slot2";
|
||||
|
||||
public static Boolean L3_S3_Enable = false;
|
||||
public static String L3_S3_Item = "";
|
||||
public static String L3_S3_Name = "";
|
||||
public static List L3_S3_Lore = Arrays.asList();
|
||||
public static Boolean L3_S3_Cost_Enable = false;
|
||||
public static Double L3_S3_Price = 0.00;
|
||||
public static Boolean L3_S3_Command_Enable = false;
|
||||
public static Boolean L3_S3_CommandAsConsole = false;
|
||||
public static String L3_S3_Command = "";
|
||||
public static Boolean L3_S3_Message_Enable = false;
|
||||
public static List<String> L3_S3_Message;
|
||||
public static Boolean L3_S3_Permission_Enable = false;
|
||||
public static String L3_S3_Permission = "commandgui.use.gui2.line3.slot3";
|
||||
|
||||
public static Boolean L3_S4_Enable = false;
|
||||
public static String L3_S4_Item = "";
|
||||
public static String L3_S4_Name = "";
|
||||
public static List L3_S4_Lore = Arrays.asList();
|
||||
public static Boolean L3_S4_Cost_Enable = false;
|
||||
public static Double L3_S4_Price = 0.00;
|
||||
public static Boolean L3_S4_Command_Enable = false;
|
||||
public static Boolean L3_S4_CommandAsConsole = false;
|
||||
public static String L3_S4_Command = "";
|
||||
public static Boolean L3_S4_Message_Enable = false;
|
||||
public static List<String> L3_S4_Message;
|
||||
public static Boolean L3_S4_Permission_Enable = false;
|
||||
public static String L3_S4_Permission = "commandgui.use.gui2.line3.slot4";
|
||||
|
||||
public static Boolean L3_S5_Enable = false;
|
||||
public static String L3_S5_Item = "";
|
||||
public static String L3_S5_Name = "";
|
||||
public static List L3_S5_Lore = Arrays.asList();
|
||||
public static Boolean L3_S5_Cost_Enable = false;
|
||||
public static Double L3_S5_Price = 0.00;
|
||||
public static Boolean L3_S5_Command_Enable = false;
|
||||
public static Boolean L3_S5_CommandAsConsole = false;
|
||||
public static String L3_S5_Command = "";
|
||||
public static Boolean L3_S5_Message_Enable = false;
|
||||
public static List<String> L3_S5_Message;
|
||||
public static Boolean L3_S5_Permission_Enable = false;
|
||||
public static String L3_S5_Permission = "commandgui.use.gui2.line3.slot5";
|
||||
|
||||
public static Boolean L3_S6_Enable = false;
|
||||
public static String L3_S6_Item = "";
|
||||
public static String L3_S6_Name = "";
|
||||
public static List L3_S6_Lore = Arrays.asList();
|
||||
public static Boolean L3_S6_Cost_Enable = false;
|
||||
public static Double L3_S6_Price = 0.00;
|
||||
public static Boolean L3_S6_Command_Enable = false;
|
||||
public static Boolean L3_S6_CommandAsConsole = false;
|
||||
public static String L3_S6_Command = "";
|
||||
public static Boolean L3_S6_Message_Enable = false;
|
||||
public static List<String> L3_S6_Message;
|
||||
public static Boolean L3_S6_Permission_Enable = false;
|
||||
public static String L3_S6_Permission = "commandgui.use.gui2.line3.slot6";
|
||||
|
||||
public static Boolean L3_S7_Enable = false;
|
||||
public static String L3_S7_Item = "";
|
||||
public static String L3_S7_Name = "";
|
||||
public static List L3_S7_Lore = Arrays.asList();
|
||||
public static Boolean L3_S7_Cost_Enable = false;
|
||||
public static Double L3_S7_Price = 0.00;
|
||||
public static Boolean L3_S7_Command_Enable = false;
|
||||
public static Boolean L3_S7_CommandAsConsole = false;
|
||||
public static String L3_S7_Command = "";
|
||||
public static Boolean L3_S7_Message_Enable = false;
|
||||
public static List<String> L3_S7_Message;
|
||||
public static Boolean L3_S7_Permission_Enable = false;
|
||||
public static String L3_S7_Permission = "commandgui.use.gui2.line3.slot7";
|
||||
|
||||
public static Boolean L3_S8_Enable = false;
|
||||
public static String L3_S8_Item = "";
|
||||
public static String L3_S8_Name = "";
|
||||
public static List L3_S8_Lore = Arrays.asList();
|
||||
public static Boolean L3_S8_Cost_Enable = false;
|
||||
public static Double L3_S8_Price = 0.00;
|
||||
public static Boolean L3_S8_Command_Enable = false;
|
||||
public static Boolean L3_S8_CommandAsConsole = false;
|
||||
public static String L3_S8_Command = "";
|
||||
public static Boolean L3_S8_Message_Enable = false;
|
||||
public static List<String> L3_S8_Message;
|
||||
public static Boolean L3_S8_Permission_Enable = false;
|
||||
public static String L3_S8_Permission = "commandgui.use.gui2.line3.slot8";
|
||||
|
||||
public static Boolean L3_S9_Enable = false;
|
||||
public static String L3_S9_Item = "";
|
||||
public static String L3_S9_Name = "";
|
||||
public static List L3_S9_Lore = Arrays.asList();
|
||||
public static Boolean L3_S9_Cost_Enable = false;
|
||||
public static Double L3_S9_Price = 0.00;
|
||||
public static Boolean L3_S9_Command_Enable = false;
|
||||
public static Boolean L3_S9_CommandAsConsole = false;
|
||||
public static String L3_S9_Command = "";
|
||||
public static Boolean L3_S9_Message_Enable = false;
|
||||
public static List<String> L3_S9_Message;
|
||||
public static Boolean L3_S9_Permission_Enable = false;
|
||||
public static String L3_S9_Permission = "commandgui.use.gui2.line3.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line4
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L4_S1_Enable = false;
|
||||
public static String L4_S1_Item = "";
|
||||
public static String L4_S1_Name = "";
|
||||
public static List L4_S1_Lore = Arrays.asList();
|
||||
public static Boolean L4_S1_Cost_Enable = false;
|
||||
public static Double L4_S1_Price = 0.00;
|
||||
public static Boolean L4_S1_Command_Enable = false;
|
||||
public static Boolean L4_S1_CommandAsConsole = false;
|
||||
public static String L4_S1_Command = "";
|
||||
public static Boolean L4_S1_Message_Enable = false;
|
||||
public static List<String> L4_S1_Message;
|
||||
public static Boolean L4_S1_Permission_Enable = false;
|
||||
public static String L4_S1_Permission = "commandgui.use.gui2.line4.slot1";
|
||||
|
||||
public static Boolean L4_S2_Enable = false;
|
||||
public static String L4_S2_Item = "";
|
||||
public static String L4_S2_Name = "";
|
||||
public static List L4_S2_Lore = Arrays.asList();
|
||||
public static Boolean L4_S2_Cost_Enable = false;
|
||||
public static Double L4_S2_Price = 0.00;
|
||||
public static Boolean L4_S2_Command_Enable = false;
|
||||
public static Boolean L4_S2_CommandAsConsole = false;
|
||||
public static String L4_S2_Command = "";
|
||||
public static Boolean L4_S2_Message_Enable = false;
|
||||
public static List<String> L4_S2_Message;
|
||||
public static Boolean L4_S2_Permission_Enable = false;
|
||||
public static String L4_S2_Permission = "commandgui.use.gui2.line4.slot2";
|
||||
|
||||
public static Boolean L4_S3_Enable = false;
|
||||
public static String L4_S3_Item = "";
|
||||
public static String L4_S3_Name = "";
|
||||
public static List L4_S3_Lore = Arrays.asList();
|
||||
public static Boolean L4_S3_Cost_Enable = false;
|
||||
public static Double L4_S3_Price = 0.00;
|
||||
public static Boolean L4_S3_Command_Enable = false;
|
||||
public static Boolean L4_S3_CommandAsConsole = false;
|
||||
public static String L4_S3_Command = "";
|
||||
public static Boolean L4_S3_Message_Enable = false;
|
||||
public static List<String> L4_S3_Message;
|
||||
public static Boolean L4_S3_Permission_Enable = false;
|
||||
public static String L4_S3_Permission = "commandgui.use.gui2.line4.slot3";
|
||||
|
||||
public static Boolean L4_S4_Enable = false;
|
||||
public static String L4_S4_Item = "";
|
||||
public static String L4_S4_Name = "";
|
||||
public static List L4_S4_Lore = Arrays.asList();
|
||||
public static Boolean L4_S4_Cost_Enable = false;
|
||||
public static Double L4_S4_Price = 0.00;
|
||||
public static Boolean L4_S4_Command_Enable = false;
|
||||
public static Boolean L4_S4_CommandAsConsole = false;
|
||||
public static String L4_S4_Command = "";
|
||||
public static Boolean L4_S4_Message_Enable = false;
|
||||
public static List<String> L4_S4_Message;
|
||||
public static Boolean L4_S4_Permission_Enable = false;
|
||||
public static String L4_S4_Permission = "commandgui.use.gui2.line4.slot4";
|
||||
|
||||
public static Boolean L4_S5_Enable = false;
|
||||
public static String L4_S5_Item = "";
|
||||
public static String L4_S5_Name = "";
|
||||
public static List L4_S5_Lore = Arrays.asList();
|
||||
public static Boolean L4_S5_Cost_Enable = false;
|
||||
public static Double L4_S5_Price = 0.00;
|
||||
public static Boolean L4_S5_Command_Enable = false;
|
||||
public static Boolean L4_S5_CommandAsConsole = false;
|
||||
public static String L4_S5_Command = "";
|
||||
public static Boolean L4_S5_Message_Enable = false;
|
||||
public static List<String> L4_S5_Message;
|
||||
public static Boolean L4_S5_Permission_Enable = false;
|
||||
public static String L4_S5_Permission = "commandgui.use.gui2.line4.slot5";
|
||||
|
||||
public static Boolean L4_S6_Enable = false;
|
||||
public static String L4_S6_Item = "";
|
||||
public static String L4_S6_Name = "";
|
||||
public static List L4_S6_Lore = Arrays.asList();
|
||||
public static Boolean L4_S6_Cost_Enable = false;
|
||||
public static Double L4_S6_Price = 0.00;
|
||||
public static Boolean L4_S6_Command_Enable = false;
|
||||
public static Boolean L4_S6_CommandAsConsole = false;
|
||||
public static String L4_S6_Command = "";
|
||||
public static Boolean L4_S6_Message_Enable = false;
|
||||
public static List<String> L4_S6_Message;
|
||||
public static Boolean L4_S6_Permission_Enable = false;
|
||||
public static String L4_S6_Permission = "commandgui.use.gui2.line4.slot6";
|
||||
|
||||
public static Boolean L4_S7_Enable = false;
|
||||
public static String L4_S7_Item = "";
|
||||
public static String L4_S7_Name = "";
|
||||
public static List L4_S7_Lore = Arrays.asList();
|
||||
public static Boolean L4_S7_Cost_Enable = false;
|
||||
public static Double L4_S7_Price = 0.00;
|
||||
public static Boolean L4_S7_Command_Enable = false;
|
||||
public static Boolean L4_S7_CommandAsConsole = false;
|
||||
public static String L4_S7_Command = "";
|
||||
public static Boolean L4_S7_Message_Enable = false;
|
||||
public static List<String> L4_S7_Message;
|
||||
public static Boolean L4_S7_Permission_Enable = false;
|
||||
public static String L4_S7_Permission = "commandgui.use.gui2.line4.slot7";
|
||||
|
||||
public static Boolean L4_S8_Enable = false;
|
||||
public static String L4_S8_Item = "";
|
||||
public static String L4_S8_Name = "";
|
||||
public static List L4_S8_Lore = Arrays.asList();
|
||||
public static Boolean L4_S8_Cost_Enable = false;
|
||||
public static Double L4_S8_Price = 0.00;
|
||||
public static Boolean L4_S8_Command_Enable = false;
|
||||
public static Boolean L4_S8_CommandAsConsole = false;
|
||||
public static String L4_S8_Command = "";
|
||||
public static Boolean L4_S8_Message_Enable = false;
|
||||
public static List<String> L4_S8_Message;
|
||||
public static Boolean L4_S8_Permission_Enable = false;
|
||||
public static String L4_S8_Permission = "commandgui.use.gui2.line4.slot8";
|
||||
|
||||
public static Boolean L4_S9_Enable = false;
|
||||
public static String L4_S9_Item = "";
|
||||
public static String L4_S9_Name = "";
|
||||
public static List L4_S9_Lore = Arrays.asList();
|
||||
public static Boolean L4_S9_Cost_Enable = false;
|
||||
public static Double L4_S9_Price = 0.00;
|
||||
public static Boolean L4_S9_Command_Enable = false;
|
||||
public static Boolean L4_S9_CommandAsConsole = false;
|
||||
public static String L4_S9_Command = "";
|
||||
public static Boolean L4_S9_Message_Enable = false;
|
||||
public static List<String> L4_S9_Message;
|
||||
public static Boolean L4_S9_Permission_Enable = false;
|
||||
public static String L4_S9_Permission = "commandgui.use.gui2.line4.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line5
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L5_S1_Enable = false;
|
||||
public static String L5_S1_Item = "";
|
||||
public static String L5_S1_Name = "";
|
||||
public static List L5_S1_Lore = Arrays.asList();
|
||||
public static Boolean L5_S1_Cost_Enable = false;
|
||||
public static Double L5_S1_Price = 0.00;
|
||||
public static Boolean L5_S1_Command_Enable = false;
|
||||
public static Boolean L5_S1_CommandAsConsole = false;
|
||||
public static String L5_S1_Command = "";
|
||||
public static Boolean L5_S1_Message_Enable = false;
|
||||
public static List<String> L5_S1_Message;
|
||||
public static Boolean L5_S1_Permission_Enable = false;
|
||||
public static String L5_S1_Permission = "commandgui.use.gui2.line5.slot1";
|
||||
|
||||
public static Boolean L5_S2_Enable = false;
|
||||
public static String L5_S2_Item = "";
|
||||
public static String L5_S2_Name = "";
|
||||
public static List L5_S2_Lore = Arrays.asList();
|
||||
public static Boolean L5_S2_Cost_Enable = false;
|
||||
public static Double L5_S2_Price = 0.00;
|
||||
public static Boolean L5_S2_Command_Enable = false;
|
||||
public static Boolean L5_S2_CommandAsConsole = false;
|
||||
public static String L5_S2_Command = "";
|
||||
public static Boolean L5_S2_Message_Enable = false;
|
||||
public static List<String> L5_S2_Message;
|
||||
public static Boolean L5_S2_Permission_Enable = false;
|
||||
public static String L5_S2_Permission = "commandgui.use.gui2.line5.slot2";
|
||||
|
||||
public static Boolean L5_S3_Enable = false;
|
||||
public static String L5_S3_Item = "";
|
||||
public static String L5_S3_Name = "";
|
||||
public static List L5_S3_Lore = Arrays.asList();
|
||||
public static Boolean L5_S3_Cost_Enable = false;
|
||||
public static Double L5_S3_Price = 0.00;
|
||||
public static Boolean L5_S3_Command_Enable = false;
|
||||
public static Boolean L5_S3_CommandAsConsole = false;
|
||||
public static String L5_S3_Command = "";
|
||||
public static Boolean L5_S3_Message_Enable = false;
|
||||
public static List<String> L5_S3_Message;
|
||||
public static Boolean L5_S3_Permission_Enable = false;
|
||||
public static String L5_S3_Permission = "commandgui.use.gui2.line5.slot3";
|
||||
|
||||
public static Boolean L5_S4_Enable = false;
|
||||
public static String L5_S4_Item = "";
|
||||
public static String L5_S4_Name = "";
|
||||
public static List L5_S4_Lore = Arrays.asList();
|
||||
public static Boolean L5_S4_Cost_Enable = false;
|
||||
public static Double L5_S4_Price = 0.00;
|
||||
public static Boolean L5_S4_Command_Enable = false;
|
||||
public static Boolean L5_S4_CommandAsConsole = false;
|
||||
public static String L5_S4_Command = "";
|
||||
public static Boolean L5_S4_Message_Enable = false;
|
||||
public static List<String> L5_S4_Message;
|
||||
public static Boolean L5_S4_Permission_Enable = false;
|
||||
public static String L5_S4_Permission = "commandgui.use.gui2.line5.slot4";
|
||||
|
||||
public static Boolean L5_S5_Enable = false;
|
||||
public static String L5_S5_Item = "";
|
||||
public static String L5_S5_Name = "";
|
||||
public static List L5_S5_Lore = Arrays.asList();
|
||||
public static Boolean L5_S5_Cost_Enable = false;
|
||||
public static Double L5_S5_Price = 0.00;
|
||||
public static Boolean L5_S5_Command_Enable = false;
|
||||
public static Boolean L5_S5_CommandAsConsole = false;
|
||||
public static String L5_S5_Command = "";
|
||||
public static Boolean L5_S5_Message_Enable = false;
|
||||
public static List<String> L5_S5_Message;
|
||||
public static Boolean L5_S5_Permission_Enable = false;
|
||||
public static String L5_S5_Permission = "commandgui.use.gui2.line5.slot5";
|
||||
|
||||
public static Boolean L5_S6_Enable = false;
|
||||
public static String L5_S6_Item = "";
|
||||
public static String L5_S6_Name = "";
|
||||
public static List L5_S6_Lore = Arrays.asList();
|
||||
public static Boolean L5_S6_Cost_Enable = false;
|
||||
public static Double L5_S6_Price = 0.00;
|
||||
public static Boolean L5_S6_Command_Enable = false;
|
||||
public static Boolean L5_S6_CommandAsConsole = false;
|
||||
public static String L5_S6_Command = "";
|
||||
public static Boolean L5_S6_Message_Enable = false;
|
||||
public static List<String> L5_S6_Message;
|
||||
public static Boolean L5_S6_Permission_Enable = false;
|
||||
public static String L5_S6_Permission = "commandgui.use.gui2.line5.slot6";
|
||||
|
||||
public static Boolean L5_S7_Enable = false;
|
||||
public static String L5_S7_Item = "";
|
||||
public static String L5_S7_Name = "";
|
||||
public static List L5_S7_Lore = Arrays.asList();
|
||||
public static Boolean L5_S7_Cost_Enable = false;
|
||||
public static Double L5_S7_Price = 0.00;
|
||||
public static Boolean L5_S7_Command_Enable = false;
|
||||
public static Boolean L5_S7_CommandAsConsole = false;
|
||||
public static String L5_S7_Command = "";
|
||||
public static Boolean L5_S7_Message_Enable = false;
|
||||
public static List<String> L5_S7_Message;
|
||||
public static Boolean L5_S7_Permission_Enable = false;
|
||||
public static String L5_S7_Permission = "commandgui.use.gui2.line5.slot7";
|
||||
|
||||
public static Boolean L5_S8_Enable = false;
|
||||
public static String L5_S8_Item = "";
|
||||
public static String L5_S8_Name = "";
|
||||
public static List L5_S8_Lore = Arrays.asList();
|
||||
public static Boolean L5_S8_Cost_Enable = false;
|
||||
public static Double L5_S8_Price = 0.00;
|
||||
public static Boolean L5_S8_Command_Enable = false;
|
||||
public static Boolean L5_S8_CommandAsConsole = false;
|
||||
public static String L5_S8_Command = "";
|
||||
public static Boolean L5_S8_Message_Enable = false;
|
||||
public static List<String> L5_S8_Message;
|
||||
public static Boolean L5_S8_Permission_Enable = false;
|
||||
public static String L5_S8_Permission = "commandgui.use.gui2.line5.slot8";
|
||||
|
||||
public static Boolean L5_S9_Enable = false;
|
||||
public static String L5_S9_Item = "";
|
||||
public static String L5_S9_Name = "";
|
||||
public static List L5_S9_Lore = Arrays.asList();
|
||||
public static Boolean L5_S9_Cost_Enable = false;
|
||||
public static Double L5_S9_Price = 0.00;
|
||||
public static Boolean L5_S9_Command_Enable = false;
|
||||
public static Boolean L5_S9_CommandAsConsole = false;
|
||||
public static String L5_S9_Command = "";
|
||||
public static Boolean L5_S9_Message_Enable = false;
|
||||
public static List<String> L5_S9_Message;
|
||||
public static Boolean L5_S9_Permission_Enable = false;
|
||||
public static String L5_S9_Permission = "commandgui.use.gui2.line5.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line6
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L6_S1_Enable = false;
|
||||
public static String L6_S1_Item = "";
|
||||
public static String L6_S1_Name = "";
|
||||
public static List L6_S1_Lore = Arrays.asList();
|
||||
public static Boolean L6_S1_Cost_Enable = false;
|
||||
public static Double L6_S1_Price = 0.00;
|
||||
public static Boolean L6_S1_Command_Enable = false;
|
||||
public static Boolean L6_S1_CommandAsConsole = false;
|
||||
public static String L6_S1_Command = "";
|
||||
public static Boolean L6_S1_Message_Enable = false;
|
||||
public static List<String> L6_S1_Message;
|
||||
public static Boolean L6_S1_Permission_Enable = false;
|
||||
public static String L6_S1_Permission = "commandgui.use.gui2.line6.slot1";
|
||||
|
||||
public static Boolean L6_S2_Enable = false;
|
||||
public static String L6_S2_Item = "";
|
||||
public static String L6_S2_Name = "";
|
||||
public static List L6_S2_Lore = Arrays.asList();
|
||||
public static Boolean L6_S2_Cost_Enable = false;
|
||||
public static Double L6_S2_Price = 0.00;
|
||||
public static Boolean L6_S2_Command_Enable = false;
|
||||
public static Boolean L6_S2_CommandAsConsole = false;
|
||||
public static String L6_S2_Command = "";
|
||||
public static Boolean L6_S2_Message_Enable = false;
|
||||
public static List<String> L6_S2_Message;
|
||||
public static Boolean L6_S2_Permission_Enable = false;
|
||||
public static String L6_S2_Permission = "commandgui.use.gui2.line6.slot2";
|
||||
|
||||
public static Boolean L6_S3_Enable = false;
|
||||
public static String L6_S3_Item = "";
|
||||
public static String L6_S3_Name = "";
|
||||
public static List L6_S3_Lore = Arrays.asList();
|
||||
public static Boolean L6_S3_Cost_Enable = false;
|
||||
public static Double L6_S3_Price = 0.00;
|
||||
public static Boolean L6_S3_Command_Enable = false;
|
||||
public static Boolean L6_S3_CommandAsConsole = false;
|
||||
public static String L6_S3_Command = "";
|
||||
public static Boolean L6_S3_Message_Enable = false;
|
||||
public static List<String> L6_S3_Message;
|
||||
public static Boolean L6_S3_Permission_Enable = false;
|
||||
public static String L6_S3_Permission = "commandgui.use.gui2.line6.slot3";
|
||||
|
||||
public static Boolean L6_S4_Enable = false;
|
||||
public static String L6_S4_Item = "";
|
||||
public static String L6_S4_Name = "";
|
||||
public static List L6_S4_Lore = Arrays.asList();
|
||||
public static Boolean L6_S4_Cost_Enable = false;
|
||||
public static Double L6_S4_Price = 0.00;
|
||||
public static Boolean L6_S4_Command_Enable = false;
|
||||
public static Boolean L6_S4_CommandAsConsole = false;
|
||||
public static String L6_S4_Command = "";
|
||||
public static Boolean L6_S4_Message_Enable = false;
|
||||
public static List<String> L6_S4_Message;
|
||||
public static Boolean L6_S4_Permission_Enable = false;
|
||||
public static String L6_S4_Permission = "commandgui.use.gui2.line6.slot4";
|
||||
|
||||
public static Boolean L6_S5_Enable = false;
|
||||
public static String L6_S5_Item = "";
|
||||
public static String L6_S5_Name = "";
|
||||
public static List L6_S5_Lore = Arrays.asList();
|
||||
public static Boolean L6_S5_Cost_Enable = false;
|
||||
public static Double L6_S5_Price = 0.00;
|
||||
public static Boolean L6_S5_Command_Enable = false;
|
||||
public static Boolean L6_S5_CommandAsConsole = false;
|
||||
public static String L6_S5_Command = "";
|
||||
public static Boolean L6_S5_Message_Enable = false;
|
||||
public static List<String> L6_S5_Message;
|
||||
public static Boolean L6_S5_Permission_Enable = false;
|
||||
public static String L6_S5_Permission = "commandgui.use.gui2.line6.slot5";
|
||||
|
||||
public static Boolean L6_S6_Enable = false;
|
||||
public static String L6_S6_Item = "";
|
||||
public static String L6_S6_Name = "";
|
||||
public static List L6_S6_Lore = Arrays.asList();
|
||||
public static Boolean L6_S6_Cost_Enable = false;
|
||||
public static Double L6_S6_Price = 0.00;
|
||||
public static Boolean L6_S6_Command_Enable = false;
|
||||
public static Boolean L6_S6_CommandAsConsole = false;
|
||||
public static String L6_S6_Command = "";
|
||||
public static Boolean L6_S6_Message_Enable = false;
|
||||
public static List<String> L6_S6_Message;
|
||||
public static Boolean L6_S6_Permission_Enable = false;
|
||||
public static String L6_S6_Permission = "commandgui.use.gui2.line6.slot6";
|
||||
|
||||
public static Boolean L6_S7_Enable = false;
|
||||
public static String L6_S7_Item = "";
|
||||
public static String L6_S7_Name = "";
|
||||
public static List L6_S7_Lore = Arrays.asList();
|
||||
public static Boolean L6_S7_Cost_Enable = false;
|
||||
public static Double L6_S7_Price = 0.00;
|
||||
public static Boolean L6_S7_Command_Enable = false;
|
||||
public static Boolean L6_S7_CommandAsConsole = false;
|
||||
public static String L6_S7_Command = "";
|
||||
public static Boolean L6_S7_Message_Enable = false;
|
||||
public static List<String> L6_S7_Message;
|
||||
public static Boolean L6_S7_Permission_Enable = false;
|
||||
public static String L6_S7_Permission = "commandgui.use.gui2.line6.slot7";
|
||||
|
||||
public static Boolean L6_S8_Enable = false;
|
||||
public static String L6_S8_Item = "";
|
||||
public static String L6_S8_Name = "";
|
||||
public static List L6_S8_Lore = Arrays.asList();
|
||||
public static Boolean L6_S8_Cost_Enable = false;
|
||||
public static Double L6_S8_Price = 0.00;
|
||||
public static Boolean L6_S8_Command_Enable = false;
|
||||
public static Boolean L6_S8_CommandAsConsole = false;
|
||||
public static String L6_S8_Command = "";
|
||||
public static Boolean L6_S8_Message_Enable = false;
|
||||
public static List<String> L6_S8_Message;
|
||||
public static Boolean L6_S8_Permission_Enable = false;
|
||||
public static String L6_S8_Permission = "commandgui.use.gui2.line6.slot8";
|
||||
|
||||
public static Boolean L6_S9_Enable = false;
|
||||
public static String L6_S9_Item = "";
|
||||
public static String L6_S9_Name = "";
|
||||
public static List L6_S9_Lore = Arrays.asList();
|
||||
public static Boolean L6_S9_Cost_Enable = false;
|
||||
public static Double L6_S9_Price = 0.00;
|
||||
public static Boolean L6_S9_Command_Enable = false;
|
||||
public static Boolean L6_S9_CommandAsConsole = false;
|
||||
public static String L6_S9_Command = "";
|
||||
public static Boolean L6_S9_Message_Enable = false;
|
||||
public static List<String> L6_S9_Message;
|
||||
public static Boolean L6_S9_Permission_Enable = false;
|
||||
public static String L6_S9_Permission = "commandgui.use.gui2.line6.slot9";
|
||||
}
|
@ -0,0 +1,834 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
// -----------------------------
|
||||
// _____ _____ _ _ _____
|
||||
// / ____/ ____| | | |_ _|
|
||||
// | | | | __| | | | | |
|
||||
// | | | | |_ | | | | | |
|
||||
// | |___| |__| | |__| |_| |_
|
||||
// \_____\_____|\____/|_____|
|
||||
// -----------------------------
|
||||
|
||||
package de.jatitv.commandgui.defaultValue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class DefaultValue_GUI_3 {
|
||||
|
||||
public static Boolean GiveUseItemOnFirstJoin = false;
|
||||
public static Boolean GiveUseItemOnFirstJoin_Permission_Enable = false;
|
||||
|
||||
public static Boolean GUI_Enable = false;
|
||||
|
||||
public static String GiveUseItemOnFirstJoin_Permission = "commandgui.giveuseitemonfirstjoin.gui3";
|
||||
public static String UseItem_Item = "PAPER";
|
||||
public static String UseItem_Name = "§7Open the: [guiname]";
|
||||
public static List UseItem_Lore = Arrays.asList();
|
||||
|
||||
public static String Command = "GUI3";
|
||||
public static Boolean Command_Permission_Enable = true;
|
||||
|
||||
public static String GUIName = "§9GUI §53";
|
||||
public static Boolean FillItem_Enable = true;
|
||||
public static String FillItem = "BLACK_STAINED_GLASS_PANE";
|
||||
public static short FillItem_1_8 = 15;
|
||||
public static Integer GUILines = 1;
|
||||
|
||||
public static Boolean Permission_Enable = false;
|
||||
public static String Permission = "commandgui.use.gui3";
|
||||
|
||||
|
||||
/**
|
||||
* line1
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L1_S1_Enable = false;
|
||||
public static Boolean L1_S1_Playerhead = true;
|
||||
public static String L1_S1_Item = "";
|
||||
public static String L1_S1_Name = "";
|
||||
public static List L1_S1_Lore = Arrays.asList();
|
||||
public static Boolean L1_S1_Cost_Enable = false;
|
||||
public static Double L1_S1_Price = 0.00;
|
||||
public static Boolean L1_S1_Command_Enable = false;
|
||||
public static Boolean L1_S1_CommandAsConsole = false;
|
||||
public static String L1_S1_Command = "";
|
||||
public static Boolean L1_S1_Message_Enable = false;
|
||||
public static List<String> L1_S1_Message;
|
||||
public static Boolean L1_S1_Permission_Enable = false;
|
||||
public static String L1_S1_Permission = "commandgui.use.gui3.line1.slot1";
|
||||
|
||||
public static Boolean L1_S2_Enable = false;
|
||||
public static String L1_S2_Item = "";
|
||||
public static String L1_S2_Name = "";
|
||||
public static List L1_S2_Lore = Arrays.asList();
|
||||
public static Boolean L1_S2_Cost_Enable = false;
|
||||
public static Double L1_S2_Price = 0.00;
|
||||
public static Boolean L1_S2_Command_Enable = false;
|
||||
public static Boolean L1_S2_CommandAsConsole = false;
|
||||
public static String L1_S2_Command = "";
|
||||
public static Boolean L1_S2_Message_Enable = false;
|
||||
public static List<String> L1_S2_Message;
|
||||
public static Boolean L1_S2_Permission_Enable = false;
|
||||
public static String L1_S2_Permission = "commandgui.use.gui3.line1.slot2";
|
||||
|
||||
public static Boolean L1_S3_Enable = false;
|
||||
public static String L1_S3_Item = "";
|
||||
public static String L1_S3_Name = "";
|
||||
public static List L1_S3_Lore = Arrays.asList();
|
||||
public static Boolean L1_S3_Cost_Enable = false;
|
||||
public static Double L1_S3_Price = 0.00;
|
||||
public static Boolean L1_S3_Command_Enable = false;
|
||||
public static Boolean L1_S3_CommandAsConsole = false;
|
||||
public static String L1_S3_Command = "";
|
||||
public static Boolean L1_S3_Message_Enable = false;
|
||||
public static List<String> L1_S3_Message;
|
||||
public static Boolean L1_S3_Permission_Enable = false;
|
||||
public static String L1_S3_Permission = "commandgui.use.gui3.line1.slot3";
|
||||
|
||||
public static Boolean L1_S4_Enable = false;
|
||||
public static String L1_S4_Item = "";
|
||||
public static String L1_S4_Name = "";
|
||||
public static List L1_S4_Lore = Arrays.asList();
|
||||
public static Boolean L1_S4_Cost_Enable = false;
|
||||
public static Double L1_S4_Price = 0.00;
|
||||
public static Boolean L1_S4_Command_Enable = false;
|
||||
public static Boolean L1_S4_CommandAsConsole = false;
|
||||
public static String L1_S4_Command = "";
|
||||
public static Boolean L1_S4_Message_Enable = false;
|
||||
public static List<String> L1_S4_Message;
|
||||
public static Boolean L1_S4_Permission_Enable = false;
|
||||
public static String L1_S4_Permission = "commandgui.use.gui3.line1.slot4";
|
||||
|
||||
public static Boolean L1_S5_Enable = false;
|
||||
public static String L1_S5_Item = "";
|
||||
public static String L1_S5_Name = "";
|
||||
public static List L1_S5_Lore = Arrays.asList();
|
||||
public static Boolean L1_S5_Cost_Enable = false;
|
||||
public static Double L1_S5_Price = 0.00;
|
||||
public static Boolean L1_S5_Command_Enable = false;
|
||||
public static Boolean L1_S5_CommandAsConsole = false;
|
||||
public static String L1_S5_Command = "";
|
||||
public static Boolean L1_S5_Message_Enable = false;
|
||||
public static List<String> L1_S5_Message;
|
||||
public static Boolean L1_S5_Permission_Enable = false;
|
||||
public static String L1_S5_Permission = "commandgui.use.gui3.line1.slot5";
|
||||
|
||||
public static Boolean L1_S6_Enable = false;
|
||||
public static String L1_S6_Item = "";
|
||||
public static String L1_S6_Name = "";
|
||||
public static List L1_S6_Lore = Arrays.asList();
|
||||
public static Boolean L1_S6_Cost_Enable = false;
|
||||
public static Double L1_S6_Price = 0.00;
|
||||
public static Boolean L1_S6_Command_Enable = false;
|
||||
public static Boolean L1_S6_CommandAsConsole = false;
|
||||
public static String L1_S6_Command = "";
|
||||
public static Boolean L1_S6_Message_Enable = false;
|
||||
public static List<String> L1_S6_Message;
|
||||
public static Boolean L1_S6_Permission_Enable = false;
|
||||
public static String L1_S6_Permission = "commandgui.use.gui3.line1.slot6";
|
||||
|
||||
public static Boolean L1_S7_Enable = false;
|
||||
public static String L1_S7_Item = "";
|
||||
public static String L1_S7_Name = "";
|
||||
public static List L1_S7_Lore = Arrays.asList();
|
||||
public static Boolean L1_S7_Cost_Enable = false;
|
||||
public static Double L1_S7_Price = 0.00;
|
||||
public static Boolean L1_S7_Command_Enable = false;
|
||||
public static Boolean L1_S7_CommandAsConsole = false;
|
||||
public static String L1_S7_Command = "";
|
||||
public static Boolean L1_S7_Message_Enable = false;
|
||||
public static List<String> L1_S7_Message;
|
||||
public static Boolean L1_S7_Permission_Enable = false;
|
||||
public static String L1_S7_Permission = "commandgui.use.gui3.line1.slot7";
|
||||
|
||||
public static Boolean L1_S8_Enable = false;
|
||||
public static String L1_S8_Item = "";
|
||||
public static String L1_S8_Name = "";
|
||||
public static List L1_S8_Lore = Arrays.asList();
|
||||
public static Boolean L1_S8_Cost_Enable = false;
|
||||
public static Double L1_S8_Price = 0.00;
|
||||
public static Boolean L1_S8_Command_Enable = false;
|
||||
public static Boolean L1_S8_CommandAsConsole = false;
|
||||
public static String L1_S8_Command = "";
|
||||
public static Boolean L1_S8_Message_Enable = false;
|
||||
public static List<String> L1_S8_Message;
|
||||
public static Boolean L1_S8_Permission_Enable = false;
|
||||
public static String L1_S8_Permission = "commandgui.use.gui3.line1.slot8";
|
||||
|
||||
public static Boolean L1_S9_Enable = false;
|
||||
public static String L1_S9_Item = "";
|
||||
public static String L1_S9_Name = "";
|
||||
public static List L1_S9_Lore = Arrays.asList();
|
||||
public static Boolean L1_S9_Cost_Enable = false;
|
||||
public static Double L1_S9_Price = 0.00;
|
||||
public static Boolean L1_S9_Command_Enable = false;
|
||||
public static Boolean L1_S9_CommandAsConsole = false;
|
||||
public static String L1_S9_Command = "";
|
||||
public static Boolean L1_S9_Message_Enable = false;
|
||||
public static List<String> L1_S9_Message;
|
||||
public static Boolean L1_S9_Permission_Enable = false;
|
||||
public static String L1_S9_Permission = "commandgui.use.gui3.line1.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line2
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L2_S1_Enable = false;
|
||||
public static String L2_S1_Item = "";
|
||||
public static String L2_S1_Name = "";
|
||||
public static List L2_S1_Lore = Arrays.asList();
|
||||
public static Boolean L2_S1_Cost_Enable = false;
|
||||
public static Double L2_S1_Price = 0.00;
|
||||
public static Boolean L2_S1_Command_Enable = false;
|
||||
public static Boolean L2_S1_CommandAsConsole = false;
|
||||
public static String L2_S1_Command = "";
|
||||
public static Boolean L2_S1_Message_Enable = false;
|
||||
public static List<String> L2_S1_Message;
|
||||
public static Boolean L2_S1_Permission_Enable = false;
|
||||
public static String L2_S1_Permission = "commandgui.use.gui3.line2.slot1";
|
||||
|
||||
public static Boolean L2_S2_Enable = false;
|
||||
public static String L2_S2_Item = "";
|
||||
public static String L2_S2_Name = "";
|
||||
public static List L2_S2_Lore = Arrays.asList();
|
||||
public static Boolean L2_S2_Cost_Enable = false;
|
||||
public static Double L2_S2_Price = 0.00;
|
||||
public static Boolean L2_S2_Command_Enable = false;
|
||||
public static Boolean L2_S2_CommandAsConsole = false;
|
||||
public static String L2_S2_Command = "";
|
||||
public static Boolean L2_S2_Message_Enable = false;
|
||||
public static List<String> L2_S2_Message;
|
||||
public static Boolean L2_S2_Permission_Enable = false;
|
||||
public static String L2_S2_Permission = "commandgui.use.gui3.line2.slot2";
|
||||
|
||||
public static Boolean L2_S3_Enable = false;
|
||||
public static String L2_S3_Item = "";
|
||||
public static String L2_S3_Name = "";
|
||||
public static List L2_S3_Lore = Arrays.asList();
|
||||
public static Boolean L2_S3_Cost_Enable = false;
|
||||
public static Double L2_S3_Price = 0.00;
|
||||
public static Boolean L2_S3_Command_Enable = false;
|
||||
public static Boolean L2_S3_CommandAsConsole = false;
|
||||
public static String L2_S3_Command = "";
|
||||
public static Boolean L2_S3_Message_Enable = false;
|
||||
public static List<String> L2_S3_Message;
|
||||
public static Boolean L2_S3_Permission_Enable = false;
|
||||
public static String L2_S3_Permission = "commandgui.use.gui3.line2.slot3";
|
||||
|
||||
public static Boolean L2_S4_Enable = false;
|
||||
public static String L2_S4_Item = "";
|
||||
public static String L2_S4_Name = "";
|
||||
public static List L2_S4_Lore = Arrays.asList();
|
||||
public static Boolean L2_S4_Cost_Enable = false;
|
||||
public static Double L2_S4_Price = 0.00;
|
||||
public static Boolean L2_S4_Command_Enable = false;
|
||||
public static Boolean L2_S4_CommandAsConsole = false;
|
||||
public static String L2_S4_Command = "";
|
||||
public static Boolean L2_S4_Message_Enable = false;
|
||||
public static List<String> L2_S4_Message;
|
||||
public static Boolean L2_S4_Permission_Enable = false;
|
||||
public static String L2_S4_Permission = "commandgui.use.gui3.line2.slot4";
|
||||
|
||||
public static Boolean L2_S5_Enable = false;
|
||||
public static String L2_S5_Item = "";
|
||||
public static String L2_S5_Name = "";
|
||||
public static List L2_S5_Lore = Arrays.asList();
|
||||
public static Boolean L2_S5_Cost_Enable = false;
|
||||
public static Double L2_S5_Price = 0.00;
|
||||
public static Boolean L2_S5_Command_Enable = false;
|
||||
public static Boolean L2_S5_CommandAsConsole = false;
|
||||
public static String L2_S5_Command = "";
|
||||
public static Boolean L2_S5_Message_Enable = false;
|
||||
public static List<String> L2_S5_Message;
|
||||
public static Boolean L2_S5_Permission_Enable = false;
|
||||
public static String L2_S5_Permission = "commandgui.use.gui3.line2.slot5";
|
||||
|
||||
public static Boolean L2_S6_Enable = false;
|
||||
public static String L2_S6_Item = "";
|
||||
public static String L2_S6_Name = "";
|
||||
public static List L2_S6_Lore = Arrays.asList();
|
||||
public static Boolean L2_S6_Cost_Enable = false;
|
||||
public static Double L2_S6_Price = 0.00;
|
||||
public static Boolean L2_S6_Command_Enable = false;
|
||||
public static Boolean L2_S6_CommandAsConsole = false;
|
||||
public static String L2_S6_Command = "";
|
||||
public static Boolean L2_S6_Message_Enable = false;
|
||||
public static List<String> L2_S6_Message;
|
||||
public static Boolean L2_S6_Permission_Enable = false;
|
||||
public static String L2_S6_Permission = "commandgui.use.gui3.line2.slot6";
|
||||
|
||||
public static Boolean L2_S7_Enable = false;
|
||||
public static String L2_S7_Item = "";
|
||||
public static String L2_S7_Name = "";
|
||||
public static List L2_S7_Lore = Arrays.asList();
|
||||
public static Boolean L2_S7_Cost_Enable = false;
|
||||
public static Double L2_S7_Price = 0.00;
|
||||
public static Boolean L2_S7_Command_Enable = false;
|
||||
public static Boolean L2_S7_CommandAsConsole = false;
|
||||
public static String L2_S7_Command = "";
|
||||
public static Boolean L2_S7_Message_Enable = false;
|
||||
public static List<String> L2_S7_Message;
|
||||
public static Boolean L2_S7_Permission_Enable = false;
|
||||
public static String L2_S7_Permission = "commandgui.use.gui3.line2.slot7";
|
||||
|
||||
public static Boolean L2_S8_Enable = false;
|
||||
public static String L2_S8_Item = "";
|
||||
public static String L2_S8_Name = "";
|
||||
public static List L2_S8_Lore = Arrays.asList();
|
||||
public static Boolean L2_S8_Cost_Enable = false;
|
||||
public static Double L2_S8_Price = 0.00;
|
||||
public static Boolean L2_S8_Command_Enable = false;
|
||||
public static Boolean L2_S8_CommandAsConsole = false;
|
||||
public static String L2_S8_Command = "";
|
||||
public static Boolean L2_S8_Message_Enable = false;
|
||||
public static List<String> L2_S8_Message;
|
||||
public static Boolean L2_S8_Permission_Enable = false;
|
||||
public static String L2_S8_Permission = "commandgui.use.gui3.line2.slot8";
|
||||
|
||||
public static Boolean L2_S9_Enable = false;
|
||||
public static String L2_S9_Item = "";
|
||||
public static String L2_S9_Name = "";
|
||||
public static List L2_S9_Lore = Arrays.asList();
|
||||
public static Boolean L2_S9_Cost_Enable = false;
|
||||
public static Double L2_S9_Price = 0.00;
|
||||
public static Boolean L2_S9_Command_Enable = false;
|
||||
public static Boolean L2_S9_CommandAsConsole = false;
|
||||
public static String L2_S9_Command = "";
|
||||
public static Boolean L2_S9_Message_Enable = false;
|
||||
public static List<String> L2_S9_Message;
|
||||
public static Boolean L2_S9_Permission_Enable = false;
|
||||
public static String L2_S9_Permission = "commandgui.use.gui3.line2.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line3
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L3_S1_Enable = false;
|
||||
public static String L3_S1_Item = "";
|
||||
public static String L3_S1_Name = "";
|
||||
public static List L3_S1_Lore = Arrays.asList();
|
||||
public static Boolean L3_S1_Cost_Enable = false;
|
||||
public static Double L3_S1_Price = 0.00;
|
||||
public static Boolean L3_S1_Command_Enable = false;
|
||||
public static Boolean L3_S1_CommandAsConsole = false;
|
||||
public static String L3_S1_Command = "";
|
||||
public static Boolean L3_S1_Message_Enable = false;
|
||||
public static List<String> L3_S1_Message;
|
||||
public static Boolean L3_S1_Permission_Enable = false;
|
||||
public static String L3_S1_Permission = "commandgui.use.gui3.line3.slot1";
|
||||
|
||||
public static Boolean L3_S2_Enable = false;
|
||||
public static String L3_S2_Item = "";
|
||||
public static String L3_S2_Name = "";
|
||||
public static List L3_S2_Lore = Arrays.asList();
|
||||
public static Boolean L3_S2_Cost_Enable = false;
|
||||
public static Double L3_S2_Price = 0.00;
|
||||
public static Boolean L3_S2_Command_Enable = false;
|
||||
public static Boolean L3_S2_CommandAsConsole = false;
|
||||
public static String L3_S2_Command = "";
|
||||
public static Boolean L3_S2_Message_Enable = false;
|
||||
public static List<String> L3_S2_Message;
|
||||
public static Boolean L3_S2_Permission_Enable = false;
|
||||
public static String L3_S2_Permission = "commandgui.use.gui3.line3.slot2";
|
||||
|
||||
public static Boolean L3_S3_Enable = false;
|
||||
public static String L3_S3_Item = "";
|
||||
public static String L3_S3_Name = "";
|
||||
public static List L3_S3_Lore = Arrays.asList();
|
||||
public static Boolean L3_S3_Cost_Enable = false;
|
||||
public static Double L3_S3_Price = 0.00;
|
||||
public static Boolean L3_S3_Command_Enable = false;
|
||||
public static Boolean L3_S3_CommandAsConsole = false;
|
||||
public static String L3_S3_Command = "";
|
||||
public static Boolean L3_S3_Message_Enable = false;
|
||||
public static List<String> L3_S3_Message;
|
||||
public static Boolean L3_S3_Permission_Enable = false;
|
||||
public static String L3_S3_Permission = "commandgui.use.gui3.line3.slot3";
|
||||
|
||||
public static Boolean L3_S4_Enable = false;
|
||||
public static String L3_S4_Item = "";
|
||||
public static String L3_S4_Name = "";
|
||||
public static List L3_S4_Lore = Arrays.asList();
|
||||
public static Boolean L3_S4_Cost_Enable = false;
|
||||
public static Double L3_S4_Price = 0.00;
|
||||
public static Boolean L3_S4_Command_Enable = false;
|
||||
public static Boolean L3_S4_CommandAsConsole = false;
|
||||
public static String L3_S4_Command = "";
|
||||
public static Boolean L3_S4_Message_Enable = false;
|
||||
public static List<String> L3_S4_Message;
|
||||
public static Boolean L3_S4_Permission_Enable = false;
|
||||
public static String L3_S4_Permission = "commandgui.use.gui3.line3.slot4";
|
||||
|
||||
public static Boolean L3_S5_Enable = false;
|
||||
public static String L3_S5_Item = "";
|
||||
public static String L3_S5_Name = "";
|
||||
public static List L3_S5_Lore = Arrays.asList();
|
||||
public static Boolean L3_S5_Cost_Enable = false;
|
||||
public static Double L3_S5_Price = 0.00;
|
||||
public static Boolean L3_S5_Command_Enable = false;
|
||||
public static Boolean L3_S5_CommandAsConsole = false;
|
||||
public static String L3_S5_Command = "";
|
||||
public static Boolean L3_S5_Message_Enable = false;
|
||||
public static List<String> L3_S5_Message;
|
||||
public static Boolean L3_S5_Permission_Enable = false;
|
||||
public static String L3_S5_Permission = "commandgui.use.gui3.line3.slot5";
|
||||
|
||||
public static Boolean L3_S6_Enable = false;
|
||||
public static String L3_S6_Item = "";
|
||||
public static String L3_S6_Name = "";
|
||||
public static List L3_S6_Lore = Arrays.asList();
|
||||
public static Boolean L3_S6_Cost_Enable = false;
|
||||
public static Double L3_S6_Price = 0.00;
|
||||
public static Boolean L3_S6_Command_Enable = false;
|
||||
public static Boolean L3_S6_CommandAsConsole = false;
|
||||
public static String L3_S6_Command = "";
|
||||
public static Boolean L3_S6_Message_Enable = false;
|
||||
public static List<String> L3_S6_Message;
|
||||
public static Boolean L3_S6_Permission_Enable = false;
|
||||
public static String L3_S6_Permission = "commandgui.use.gui3.line3.slot6";
|
||||
|
||||
public static Boolean L3_S7_Enable = false;
|
||||
public static String L3_S7_Item = "";
|
||||
public static String L3_S7_Name = "";
|
||||
public static List L3_S7_Lore = Arrays.asList();
|
||||
public static Boolean L3_S7_Cost_Enable = false;
|
||||
public static Double L3_S7_Price = 0.00;
|
||||
public static Boolean L3_S7_Command_Enable = false;
|
||||
public static Boolean L3_S7_CommandAsConsole = false;
|
||||
public static String L3_S7_Command = "";
|
||||
public static Boolean L3_S7_Message_Enable = false;
|
||||
public static List<String> L3_S7_Message;
|
||||
public static Boolean L3_S7_Permission_Enable = false;
|
||||
public static String L3_S7_Permission = "commandgui.use.gui3.line3.slot7";
|
||||
|
||||
public static Boolean L3_S8_Enable = false;
|
||||
public static String L3_S8_Item = "";
|
||||
public static String L3_S8_Name = "";
|
||||
public static List L3_S8_Lore = Arrays.asList();
|
||||
public static Boolean L3_S8_Cost_Enable = false;
|
||||
public static Double L3_S8_Price = 0.00;
|
||||
public static Boolean L3_S8_Command_Enable = false;
|
||||
public static Boolean L3_S8_CommandAsConsole = false;
|
||||
public static String L3_S8_Command = "";
|
||||
public static Boolean L3_S8_Message_Enable = false;
|
||||
public static List<String> L3_S8_Message;
|
||||
public static Boolean L3_S8_Permission_Enable = false;
|
||||
public static String L3_S8_Permission = "commandgui.use.gui3.line3.slot8";
|
||||
|
||||
public static Boolean L3_S9_Enable = false;
|
||||
public static String L3_S9_Item = "";
|
||||
public static String L3_S9_Name = "";
|
||||
public static List L3_S9_Lore = Arrays.asList();
|
||||
public static Boolean L3_S9_Cost_Enable = false;
|
||||
public static Double L3_S9_Price = 0.00;
|
||||
public static Boolean L3_S9_Command_Enable = false;
|
||||
public static Boolean L3_S9_CommandAsConsole = false;
|
||||
public static String L3_S9_Command = "";
|
||||
public static Boolean L3_S9_Message_Enable = false;
|
||||
public static List<String> L3_S9_Message;
|
||||
public static Boolean L3_S9_Permission_Enable = false;
|
||||
public static String L3_S9_Permission = "commandgui.use.gui3.line3.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line4
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L4_S1_Enable = false;
|
||||
public static String L4_S1_Item = "";
|
||||
public static String L4_S1_Name = "";
|
||||
public static List L4_S1_Lore = Arrays.asList();
|
||||
public static Boolean L4_S1_Cost_Enable = false;
|
||||
public static Double L4_S1_Price = 0.00;
|
||||
public static Boolean L4_S1_Command_Enable = false;
|
||||
public static Boolean L4_S1_CommandAsConsole = false;
|
||||
public static String L4_S1_Command = "";
|
||||
public static Boolean L4_S1_Message_Enable = false;
|
||||
public static List<String> L4_S1_Message;
|
||||
public static Boolean L4_S1_Permission_Enable = false;
|
||||
public static String L4_S1_Permission = "commandgui.use.gui3.line4.slot1";
|
||||
|
||||
public static Boolean L4_S2_Enable = false;
|
||||
public static String L4_S2_Item = "";
|
||||
public static String L4_S2_Name = "";
|
||||
public static List L4_S2_Lore = Arrays.asList();
|
||||
public static Boolean L4_S2_Cost_Enable = false;
|
||||
public static Double L4_S2_Price = 0.00;
|
||||
public static Boolean L4_S2_Command_Enable = false;
|
||||
public static Boolean L4_S2_CommandAsConsole = false;
|
||||
public static String L4_S2_Command = "";
|
||||
public static Boolean L4_S2_Message_Enable = false;
|
||||
public static List<String> L4_S2_Message;
|
||||
public static Boolean L4_S2_Permission_Enable = false;
|
||||
public static String L4_S2_Permission = "commandgui.use.gui3.line4.slot2";
|
||||
|
||||
public static Boolean L4_S3_Enable = false;
|
||||
public static String L4_S3_Item = "";
|
||||
public static String L4_S3_Name = "";
|
||||
public static List L4_S3_Lore = Arrays.asList();
|
||||
public static Boolean L4_S3_Cost_Enable = false;
|
||||
public static Double L4_S3_Price = 0.00;
|
||||
public static Boolean L4_S3_Command_Enable = false;
|
||||
public static Boolean L4_S3_CommandAsConsole = false;
|
||||
public static String L4_S3_Command = "";
|
||||
public static Boolean L4_S3_Message_Enable = false;
|
||||
public static List<String> L4_S3_Message;
|
||||
public static Boolean L4_S3_Permission_Enable = false;
|
||||
public static String L4_S3_Permission = "commandgui.use.gui3.line4.slot3";
|
||||
|
||||
public static Boolean L4_S4_Enable = false;
|
||||
public static String L4_S4_Item = "";
|
||||
public static String L4_S4_Name = "";
|
||||
public static List L4_S4_Lore = Arrays.asList();
|
||||
public static Boolean L4_S4_Cost_Enable = false;
|
||||
public static Double L4_S4_Price = 0.00;
|
||||
public static Boolean L4_S4_Command_Enable = false;
|
||||
public static Boolean L4_S4_CommandAsConsole = false;
|
||||
public static String L4_S4_Command = "";
|
||||
public static Boolean L4_S4_Message_Enable = false;
|
||||
public static List<String> L4_S4_Message;
|
||||
public static Boolean L4_S4_Permission_Enable = false;
|
||||
public static String L4_S4_Permission = "commandgui.use.gui3.line4.slot4";
|
||||
|
||||
public static Boolean L4_S5_Enable = false;
|
||||
public static String L4_S5_Item = "";
|
||||
public static String L4_S5_Name = "";
|
||||
public static List L4_S5_Lore = Arrays.asList();
|
||||
public static Boolean L4_S5_Cost_Enable = false;
|
||||
public static Double L4_S5_Price = 0.00;
|
||||
public static Boolean L4_S5_Command_Enable = false;
|
||||
public static Boolean L4_S5_CommandAsConsole = false;
|
||||
public static String L4_S5_Command = "";
|
||||
public static Boolean L4_S5_Message_Enable = false;
|
||||
public static List<String> L4_S5_Message;
|
||||
public static Boolean L4_S5_Permission_Enable = false;
|
||||
public static String L4_S5_Permission = "commandgui.use.gui3.line4.slot5";
|
||||
|
||||
public static Boolean L4_S6_Enable = false;
|
||||
public static String L4_S6_Item = "";
|
||||
public static String L4_S6_Name = "";
|
||||
public static List L4_S6_Lore = Arrays.asList();
|
||||
public static Boolean L4_S6_Cost_Enable = false;
|
||||
public static Double L4_S6_Price = 0.00;
|
||||
public static Boolean L4_S6_Command_Enable = false;
|
||||
public static Boolean L4_S6_CommandAsConsole = false;
|
||||
public static String L4_S6_Command = "";
|
||||
public static Boolean L4_S6_Message_Enable = false;
|
||||
public static List<String> L4_S6_Message;
|
||||
public static Boolean L4_S6_Permission_Enable = false;
|
||||
public static String L4_S6_Permission = "commandgui.use.gui3.line4.slot6";
|
||||
|
||||
public static Boolean L4_S7_Enable = false;
|
||||
public static String L4_S7_Item = "";
|
||||
public static String L4_S7_Name = "";
|
||||
public static List L4_S7_Lore = Arrays.asList();
|
||||
public static Boolean L4_S7_Cost_Enable = false;
|
||||
public static Double L4_S7_Price = 0.00;
|
||||
public static Boolean L4_S7_Command_Enable = false;
|
||||
public static Boolean L4_S7_CommandAsConsole = false;
|
||||
public static String L4_S7_Command = "";
|
||||
public static Boolean L4_S7_Message_Enable = false;
|
||||
public static List<String> L4_S7_Message;
|
||||
public static Boolean L4_S7_Permission_Enable = false;
|
||||
public static String L4_S7_Permission = "commandgui.use.gui3.line4.slot7";
|
||||
|
||||
public static Boolean L4_S8_Enable = false;
|
||||
public static String L4_S8_Item = "";
|
||||
public static String L4_S8_Name = "";
|
||||
public static List L4_S8_Lore = Arrays.asList();
|
||||
public static Boolean L4_S8_Cost_Enable = false;
|
||||
public static Double L4_S8_Price = 0.00;
|
||||
public static Boolean L4_S8_Command_Enable = false;
|
||||
public static Boolean L4_S8_CommandAsConsole = false;
|
||||
public static String L4_S8_Command = "";
|
||||
public static Boolean L4_S8_Message_Enable = false;
|
||||
public static List<String> L4_S8_Message;
|
||||
public static Boolean L4_S8_Permission_Enable = false;
|
||||
public static String L4_S8_Permission = "commandgui.use.gui3.line4.slot8";
|
||||
|
||||
public static Boolean L4_S9_Enable = false;
|
||||
public static String L4_S9_Item = "";
|
||||
public static String L4_S9_Name = "";
|
||||
public static List L4_S9_Lore = Arrays.asList();
|
||||
public static Boolean L4_S9_Cost_Enable = false;
|
||||
public static Double L4_S9_Price = 0.00;
|
||||
public static Boolean L4_S9_Command_Enable = false;
|
||||
public static Boolean L4_S9_CommandAsConsole = false;
|
||||
public static String L4_S9_Command = "";
|
||||
public static Boolean L4_S9_Message_Enable = false;
|
||||
public static List<String> L4_S9_Message;
|
||||
public static Boolean L4_S9_Permission_Enable = false;
|
||||
public static String L4_S9_Permission = "commandgui.use.gui3.line4.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line5
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L5_S1_Enable = false;
|
||||
public static String L5_S1_Item = "";
|
||||
public static String L5_S1_Name = "";
|
||||
public static List L5_S1_Lore = Arrays.asList();
|
||||
public static Boolean L5_S1_Cost_Enable = false;
|
||||
public static Double L5_S1_Price = 0.00;
|
||||
public static Boolean L5_S1_Command_Enable = false;
|
||||
public static Boolean L5_S1_CommandAsConsole = false;
|
||||
public static String L5_S1_Command = "";
|
||||
public static Boolean L5_S1_Message_Enable = false;
|
||||
public static List<String> L5_S1_Message;
|
||||
public static Boolean L5_S1_Permission_Enable = false;
|
||||
public static String L5_S1_Permission = "commandgui.use.gui3.line5.slot1";
|
||||
|
||||
public static Boolean L5_S2_Enable = false;
|
||||
public static String L5_S2_Item = "";
|
||||
public static String L5_S2_Name = "";
|
||||
public static List L5_S2_Lore = Arrays.asList();
|
||||
public static Boolean L5_S2_Cost_Enable = false;
|
||||
public static Double L5_S2_Price = 0.00;
|
||||
public static Boolean L5_S2_Command_Enable = false;
|
||||
public static Boolean L5_S2_CommandAsConsole = false;
|
||||
public static String L5_S2_Command = "";
|
||||
public static Boolean L5_S2_Message_Enable = false;
|
||||
public static List<String> L5_S2_Message;
|
||||
public static Boolean L5_S2_Permission_Enable = false;
|
||||
public static String L5_S2_Permission = "commandgui.use.gui3.line5.slot2";
|
||||
|
||||
public static Boolean L5_S3_Enable = false;
|
||||
public static String L5_S3_Item = "";
|
||||
public static String L5_S3_Name = "";
|
||||
public static List L5_S3_Lore = Arrays.asList();
|
||||
public static Boolean L5_S3_Cost_Enable = false;
|
||||
public static Double L5_S3_Price = 0.00;
|
||||
public static Boolean L5_S3_Command_Enable = false;
|
||||
public static Boolean L5_S3_CommandAsConsole = false;
|
||||
public static String L5_S3_Command = "";
|
||||
public static Boolean L5_S3_Message_Enable = false;
|
||||
public static List<String> L5_S3_Message;
|
||||
public static Boolean L5_S3_Permission_Enable = false;
|
||||
public static String L5_S3_Permission = "commandgui.use.gui3.line5.slot3";
|
||||
|
||||
public static Boolean L5_S4_Enable = false;
|
||||
public static String L5_S4_Item = "";
|
||||
public static String L5_S4_Name = "";
|
||||
public static List L5_S4_Lore = Arrays.asList();
|
||||
public static Boolean L5_S4_Cost_Enable = false;
|
||||
public static Double L5_S4_Price = 0.00;
|
||||
public static Boolean L5_S4_Command_Enable = false;
|
||||
public static Boolean L5_S4_CommandAsConsole = false;
|
||||
public static String L5_S4_Command = "";
|
||||
public static Boolean L5_S4_Message_Enable = false;
|
||||
public static List<String> L5_S4_Message;
|
||||
public static Boolean L5_S4_Permission_Enable = false;
|
||||
public static String L5_S4_Permission = "commandgui.use.gui3.line5.slot4";
|
||||
|
||||
public static Boolean L5_S5_Enable = false;
|
||||
public static String L5_S5_Item = "";
|
||||
public static String L5_S5_Name = "";
|
||||
public static List L5_S5_Lore = Arrays.asList();
|
||||
public static Boolean L5_S5_Cost_Enable = false;
|
||||
public static Double L5_S5_Price = 0.00;
|
||||
public static Boolean L5_S5_Command_Enable = false;
|
||||
public static Boolean L5_S5_CommandAsConsole = false;
|
||||
public static String L5_S5_Command = "";
|
||||
public static Boolean L5_S5_Message_Enable = false;
|
||||
public static List<String> L5_S5_Message;
|
||||
public static Boolean L5_S5_Permission_Enable = false;
|
||||
public static String L5_S5_Permission = "commandgui.use.gui3.line5.slot5";
|
||||
|
||||
public static Boolean L5_S6_Enable = false;
|
||||
public static String L5_S6_Item = "";
|
||||
public static String L5_S6_Name = "";
|
||||
public static List L5_S6_Lore = Arrays.asList();
|
||||
public static Boolean L5_S6_Cost_Enable = false;
|
||||
public static Double L5_S6_Price = 0.00;
|
||||
public static Boolean L5_S6_Command_Enable = false;
|
||||
public static Boolean L5_S6_CommandAsConsole = false;
|
||||
public static String L5_S6_Command = "";
|
||||
public static Boolean L5_S6_Message_Enable = false;
|
||||
public static List<String> L5_S6_Message;
|
||||
public static Boolean L5_S6_Permission_Enable = false;
|
||||
public static String L5_S6_Permission = "commandgui.use.gui3.line5.slot6";
|
||||
|
||||
public static Boolean L5_S7_Enable = false;
|
||||
public static String L5_S7_Item = "";
|
||||
public static String L5_S7_Name = "";
|
||||
public static List L5_S7_Lore = Arrays.asList();
|
||||
public static Boolean L5_S7_Cost_Enable = false;
|
||||
public static Double L5_S7_Price = 0.00;
|
||||
public static Boolean L5_S7_Command_Enable = false;
|
||||
public static Boolean L5_S7_CommandAsConsole = false;
|
||||
public static String L5_S7_Command = "";
|
||||
public static Boolean L5_S7_Message_Enable = false;
|
||||
public static List<String> L5_S7_Message;
|
||||
public static Boolean L5_S7_Permission_Enable = false;
|
||||
public static String L5_S7_Permission = "commandgui.use.gui3.line5.slot7";
|
||||
|
||||
public static Boolean L5_S8_Enable = false;
|
||||
public static String L5_S8_Item = "";
|
||||
public static String L5_S8_Name = "";
|
||||
public static List L5_S8_Lore = Arrays.asList();
|
||||
public static Boolean L5_S8_Cost_Enable = false;
|
||||
public static Double L5_S8_Price = 0.00;
|
||||
public static Boolean L5_S8_Command_Enable = false;
|
||||
public static Boolean L5_S8_CommandAsConsole = false;
|
||||
public static String L5_S8_Command = "";
|
||||
public static Boolean L5_S8_Message_Enable = false;
|
||||
public static List<String> L5_S8_Message;
|
||||
public static Boolean L5_S8_Permission_Enable = false;
|
||||
public static String L5_S8_Permission = "commandgui.use.gui3.line5.slot8";
|
||||
|
||||
public static Boolean L5_S9_Enable = false;
|
||||
public static String L5_S9_Item = "";
|
||||
public static String L5_S9_Name = "";
|
||||
public static List L5_S9_Lore = Arrays.asList();
|
||||
public static Boolean L5_S9_Cost_Enable = false;
|
||||
public static Double L5_S9_Price = 0.00;
|
||||
public static Boolean L5_S9_Command_Enable = false;
|
||||
public static Boolean L5_S9_CommandAsConsole = false;
|
||||
public static String L5_S9_Command = "";
|
||||
public static Boolean L5_S9_Message_Enable = false;
|
||||
public static List<String> L5_S9_Message;
|
||||
public static Boolean L5_S9_Permission_Enable = false;
|
||||
public static String L5_S9_Permission = "commandgui.use.gui3.line5.slot9";
|
||||
|
||||
|
||||
/**
|
||||
* line6
|
||||
*/
|
||||
|
||||
|
||||
public static Boolean L6_S1_Enable = false;
|
||||
public static String L6_S1_Item = "";
|
||||
public static String L6_S1_Name = "";
|
||||
public static List L6_S1_Lore = Arrays.asList();
|
||||
public static Boolean L6_S1_Cost_Enable = false;
|
||||
public static Double L6_S1_Price = 0.00;
|
||||
public static Boolean L6_S1_Command_Enable = false;
|
||||
public static Boolean L6_S1_CommandAsConsole = false;
|
||||
public static String L6_S1_Command = "";
|
||||
public static Boolean L6_S1_Message_Enable = false;
|
||||
public static List<String> L6_S1_Message;
|
||||
public static Boolean L6_S1_Permission_Enable = false;
|
||||
public static String L6_S1_Permission = "commandgui.use.gui3.line6.slot1";
|
||||
|
||||
public static Boolean L6_S2_Enable = false;
|
||||
public static String L6_S2_Item = "";
|
||||
public static String L6_S2_Name = "";
|
||||
public static List L6_S2_Lore = Arrays.asList();
|
||||
public static Boolean L6_S2_Cost_Enable = false;
|
||||
public static Double L6_S2_Price = 0.00;
|
||||
public static Boolean L6_S2_Command_Enable = false;
|
||||
public static Boolean L6_S2_CommandAsConsole = false;
|
||||
public static String L6_S2_Command = "";
|
||||
public static Boolean L6_S2_Message_Enable = false;
|
||||
public static List<String> L6_S2_Message;
|
||||
public static Boolean L6_S2_Permission_Enable = false;
|
||||
public static String L6_S2_Permission = "commandgui.use.gui3.line6.slot2";
|
||||
|
||||
public static Boolean L6_S3_Enable = false;
|
||||
public static String L6_S3_Item = "";
|
||||
public static String L6_S3_Name = "";
|
||||
public static List L6_S3_Lore = Arrays.asList();
|
||||
public static Boolean L6_S3_Cost_Enable = false;
|
||||
public static Double L6_S3_Price = 0.00;
|
||||
public static Boolean L6_S3_Command_Enable = false;
|
||||
public static Boolean L6_S3_CommandAsConsole = false;
|
||||
public static String L6_S3_Command = "";
|
||||
public static Boolean L6_S3_Message_Enable = false;
|
||||
public static List<String> L6_S3_Message;
|
||||
public static Boolean L6_S3_Permission_Enable = false;
|
||||
public static String L6_S3_Permission = "commandgui.use.gui3.line6.slot3";
|
||||
|
||||
public static Boolean L6_S4_Enable = false;
|
||||
public static String L6_S4_Item = "";
|
||||
public static String L6_S4_Name = "";
|
||||
public static List L6_S4_Lore = Arrays.asList();
|
||||
public static Boolean L6_S4_Cost_Enable = false;
|
||||
public static Double L6_S4_Price = 0.00;
|
||||
public static Boolean L6_S4_Command_Enable = false;
|
||||
public static Boolean L6_S4_CommandAsConsole = false;
|
||||
public static String L6_S4_Command = "";
|
||||
public static Boolean L6_S4_Message_Enable = false;
|
||||
public static List<String> L6_S4_Message;
|
||||
public static Boolean L6_S4_Permission_Enable = false;
|
||||
public static String L6_S4_Permission = "commandgui.use.gui3.line6.slot4";
|
||||
|
||||
public static Boolean L6_S5_Enable = false;
|
||||
public static String L6_S5_Item = "";
|
||||
public static String L6_S5_Name = "";
|
||||
public static List L6_S5_Lore = Arrays.asList();
|
||||
public static Boolean L6_S5_Cost_Enable = false;
|
||||
public static Double L6_S5_Price = 0.00;
|
||||
public static Boolean L6_S5_Command_Enable = false;
|
||||
public static Boolean L6_S5_CommandAsConsole = false;
|
||||
public static String L6_S5_Command = "";
|
||||
public static Boolean L6_S5_Message_Enable = false;
|
||||
public static List<String> L6_S5_Message;
|
||||
public static Boolean L6_S5_Permission_Enable = false;
|
||||
public static String L6_S5_Permission = "commandgui.use.gui3.line6.slot5";
|
||||
|
||||
public static Boolean L6_S6_Enable = false;
|
||||
public static String L6_S6_Item = "";
|
||||
public static String L6_S6_Name = "";
|
||||
public static List L6_S6_Lore = Arrays.asList();
|
||||
public static Boolean L6_S6_Cost_Enable = false;
|
||||
public static Double L6_S6_Price = 0.00;
|
||||
public static Boolean L6_S6_Command_Enable = false;
|
||||
public static Boolean L6_S6_CommandAsConsole = false;
|
||||
public static String L6_S6_Command = "";
|
||||
public static Boolean L6_S6_Message_Enable = false;
|
||||
public static List<String> L6_S6_Message;
|
||||
public static Boolean L6_S6_Permission_Enable = false;
|
||||
public static String L6_S6_Permission = "commandgui.use.gui3.line6.slot6";
|
||||
|
||||
public static Boolean L6_S7_Enable = false;
|
||||
public static String L6_S7_Item = "";
|
||||
public static String L6_S7_Name = "";
|
||||
public static List L6_S7_Lore = Arrays.asList();
|
||||
public static Boolean L6_S7_Cost_Enable = false;
|
||||
public static Double L6_S7_Price = 0.00;
|
||||
public static Boolean L6_S7_Command_Enable = false;
|
||||
public static Boolean L6_S7_CommandAsConsole = false;
|
||||
public static String L6_S7_Command = "";
|
||||
public static Boolean L6_S7_Message_Enable = false;
|
||||
public static List<String> L6_S7_Message;
|
||||
public static Boolean L6_S7_Permission_Enable = false;
|
||||
public static String L6_S7_Permission = "commandgui.use.gui3.line6.slot7";
|
||||
|
||||
public static Boolean L6_S8_Enable = false;
|
||||
public static String L6_S8_Item = "";
|
||||
public static String L6_S8_Name = "";
|
||||
public static List L6_S8_Lore = Arrays.asList();
|
||||
public static Boolean L6_S8_Cost_Enable = false;
|
||||
public static Double L6_S8_Price = 0.00;
|
||||
public static Boolean L6_S8_Command_Enable = false;
|
||||
public static Boolean L6_S8_CommandAsConsole = false;
|
||||
public static String L6_S8_Command = "";
|
||||
public static Boolean L6_S8_Message_Enable = false;
|
||||
public static List<String> L6_S8_Message;
|
||||
public static Boolean L6_S8_Permission_Enable = false;
|
||||
public static String L6_S8_Permission = "commandgui.use.gui3.line6.slot8";
|
||||
|
||||
public static Boolean L6_S9_Enable = false;
|
||||
public static String L6_S9_Item = "";
|
||||
public static String L6_S9_Name = "";
|
||||
public static List L6_S9_Lore = Arrays.asList();
|
||||
public static Boolean L6_S9_Cost_Enable = false;
|
||||
public static Double L6_S9_Price = 0.00;
|
||||
public static Boolean L6_S9_Command_Enable = false;
|
||||
public static Boolean L6_S9_CommandAsConsole = false;
|
||||
public static String L6_S9_Command = "";
|
||||
public static Boolean L6_S9_Message_Enable = false;
|
||||
public static List<String> L6_S9_Message;
|
||||
public static Boolean L6_S9_Permission_Enable = false;
|
||||
public static String L6_S9_Permission = "commandgui.use.gui3.line6.slot9";
|
||||
|
||||
}
|
3642
CommandGUI V1/src/main/java/de/jatitv/commandgui/listener/GUI_1.java
Normal file
3642
CommandGUI V1/src/main/java/de/jatitv/commandgui/listener/GUI_1.java
Normal file
File diff suppressed because it is too large
Load Diff
3642
CommandGUI V1/src/main/java/de/jatitv/commandgui/listener/GUI_2.java
Normal file
3642
CommandGUI V1/src/main/java/de/jatitv/commandgui/listener/GUI_2.java
Normal file
File diff suppressed because it is too large
Load Diff
3642
CommandGUI V1/src/main/java/de/jatitv/commandgui/listener/GUI_3.java
Normal file
3642
CommandGUI V1/src/main/java/de/jatitv/commandgui/listener/GUI_3.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,80 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
// ___________________________________________________________________________________
|
||||
// __ __ _ ____ _____ _
|
||||
// \ \ / / | | | _ \ / ____| |
|
||||
// \ \ /\ / /__ _ __ __| | ___ _ __| |_) | __ _ __ _| (___ | |__ ___ _ __
|
||||
// \ \/ \/ / _ \| '_ \ / _` |/ _ \ '__| _ < / _` |/ _` |\___ \| '_ \ / _ \| '_ \
|
||||
// \ /\ / (_) | | | | (_| | __/ | | |_) | (_| | (_| |____) | | | | (_) | |_) |
|
||||
// \/ \/ \___/|_| |_|\__,_|\___|_| |____/ \__,_|\__, |_____/|_| |_|\___/| .__/
|
||||
// __/ | | |
|
||||
// |___/ |_|
|
||||
// ___________________________________________________________________________________
|
||||
|
||||
package de.jatitv.commandgui.listener;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.system.Main;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class JoinEvent implements Listener {
|
||||
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onJoinEvent(PlayerJoinEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
String foundVersion = Main.getPlugin().getDescription().getVersion();
|
||||
if (player.hasPermission("commandgui.admin") || player.isOp()) {
|
||||
if (!foundVersion.equals(Main.update_version)) {
|
||||
String updateFound = (DefaultValue.PrefixHC + "§6A new version of §8[§4Command§9GUI§8]§6 was found!");
|
||||
String yourVersion = (DefaultValue.PrefixHC + "§6Your version §c" + foundVersion);
|
||||
String currentVersion = (DefaultValue.PrefixHC + "§6Current version: §a" + Main.update_version);
|
||||
String downloadVersion = (DefaultValue.PrefixHC + "§6You can download it here: §e" + Main.Spigot);
|
||||
String discord = (DefaultValue.PrefixHC + "§6You can find more information about §8[§4Command§9GUI§8]§6 on Discord: §e" + Main.DiscordLink);
|
||||
String Snapshot = (DefaultValue.PrefixHC + "§4Please note!" +
|
||||
"\n" + DefaultValue.PrefixHC + "§cYou are using the §6" + foundVersion + " §cof §4Command§9GUI!" +
|
||||
"\n" + DefaultValue.PrefixHC + "§cThere may be errors and it is possible that not all functions work as they should!" +
|
||||
"\n" + DefaultValue.PrefixHC + "§2If there are any bugs, please report them to me via Discord so I can fix them." +
|
||||
"\n" + DefaultValue.PrefixHC + "§7" + Main.DiscordLink);
|
||||
if (Main.Snapshot) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.sendMessage("\n \n \n \n \n \n" + Snapshot);
|
||||
}
|
||||
}.runTaskLater(Main.getPlugin(), 100L);
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.sendMessage("\n ");
|
||||
player.sendMessage(updateFound);
|
||||
player.sendMessage(yourVersion);
|
||||
player.sendMessage(currentVersion);
|
||||
player.sendMessage(downloadVersion);
|
||||
player.sendMessage(discord);
|
||||
}
|
||||
}.runTaskLater(Main.getPlugin(), 200L);
|
||||
}
|
||||
if (DefaultValue.UpdateCheckOnJoin && !Main.Snapshot) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.sendMessage("\n ");
|
||||
player.sendMessage(updateFound);
|
||||
player.sendMessage(yourVersion);
|
||||
player.sendMessage(currentVersion);
|
||||
player.sendMessage(downloadVersion);
|
||||
player.sendMessage(discord);
|
||||
}
|
||||
}.runTaskLater(Main.getPlugin(), 200L);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package de.jatitv.commandgui.system;
|
||||
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_1;
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_2;
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_3;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import org.bukkit.craftbukkit.v1_13_R1.CraftServer;
|
||||
|
||||
public class CmdRegister_13 {
|
||||
public static void onregister(){
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_1.Command, new RegisterCommands_GUI_1(DefaultValue_GUI_1.Command));
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_2.Command, new RegisterCommands_GUI_2(DefaultValue_GUI_2.Command));
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_3.Command, new RegisterCommands_GUI_3(DefaultValue_GUI_3.Command));
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package de.jatitv.commandgui.system;
|
||||
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_1;
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_2;
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_3;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import org.bukkit.craftbukkit.v1_14_R1.CraftServer;
|
||||
|
||||
public class CmdRegister_14 {
|
||||
public static void onregister(){
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_1.Command, new RegisterCommands_GUI_1(DefaultValue_GUI_1.Command));
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_2.Command, new RegisterCommands_GUI_2(DefaultValue_GUI_2.Command));
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_3.Command, new RegisterCommands_GUI_3(DefaultValue_GUI_3.Command));
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package de.jatitv.commandgui.system;
|
||||
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_1;
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_2;
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_3;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import org.bukkit.craftbukkit.v1_15_R1.CraftServer;
|
||||
|
||||
public class CmdRegister_15 {
|
||||
public static void onregister(){
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_1.Command, new RegisterCommands_GUI_1(DefaultValue_GUI_1.Command));
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_2.Command, new RegisterCommands_GUI_2(DefaultValue_GUI_2.Command));
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_3.Command, new RegisterCommands_GUI_3(DefaultValue_GUI_3.Command));
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package de.jatitv.commandgui.system;
|
||||
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_1;
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_2;
|
||||
import de.jatitv.commandgui.commands.cmdManagement.RegisterCommands_GUI_3;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import org.bukkit.craftbukkit.v1_16_R3.CraftServer;
|
||||
|
||||
public class CmdRegister_16 {
|
||||
public static void onregister(){
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_1.Command, new RegisterCommands_GUI_1(DefaultValue_GUI_1.Command));
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_2.Command, new RegisterCommands_GUI_2(DefaultValue_GUI_2.Command));
|
||||
((CraftServer) Main.plugin.getServer()).getCommandMap().register(DefaultValue_GUI_3.Command, new RegisterCommands_GUI_3(DefaultValue_GUI_3.Command));
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.system;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
public class Disable {
|
||||
|
||||
public static void disableSend(String version){
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4-----------------------------------------------------------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4 _____ §9_____ _ _ _____");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4 / ____§9/ ____| | | |_ _|");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4| | §9| | __| | | | | |");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4| | §9| | |_ | | | | | |");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4| |___§9| |__| | |__| |_| |_");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4 \\_____§9\\_____|\\____/|_____|");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Autor: §6JaTiTV");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Version: §6" + version);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Plugin successfully disabled.");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4-----------------------------------------------------------------------------------");
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.system;
|
||||
|
||||
import de.jatitv.commandgui.config.*;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class Load {
|
||||
|
||||
public static void LoadSend(String version) throws InterruptedException {
|
||||
File configYML = new File(Main.thisp().getDataFolder().getPath(), "Config.yml");
|
||||
YamlConfiguration yamlConfiguration_config = YamlConfiguration.loadConfiguration(configYML);
|
||||
|
||||
if (yamlConfiguration_config.getInt("Plugin.Debug.DebugStage_(1-3)") > 3) {
|
||||
yamlConfiguration_config.set("Plugin.Debug.DebugStage_(1-3)", 3);
|
||||
}
|
||||
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2-----------------------------------------------------------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4 _____ §9_____ _ _ _____");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4 / ____§9/ ____| | | |_ _|");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4| | §9| | __| | | | | |");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4| | §9| | |_ | | | | | |");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4| |___§9| |__| | |__| |_| |_");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2 §4 \\_____§9\\_____|\\____/|_____|");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2Autor: §6JaTiTV");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2Version: §6" + version);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2Spigot: §6" + Main.Spigot);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2Discord: §6" + Main.DiscordLoad);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
/*
|
||||
if (yamlConfiguration_config.getBoolean("Plugin.Debug.Enable")) {
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4-------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Debugmodus is enable!!!");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4-------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4");
|
||||
Thread.sleep(5000);
|
||||
}
|
||||
|
||||
*/
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Plugin load...");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
if (Main.UpdateMSG) {
|
||||
String ver = (String) yamlConfiguration_config.get("Do_not_remove_or_change.Version");
|
||||
if (configYML.isFile()) {
|
||||
if (ver == null || !ver.equals(Main.getPlugin().getDescription().getVersion())) {
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4-------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(Main.UpdateInfo);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4-------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2");
|
||||
Thread.sleep(20000);
|
||||
}
|
||||
} else {
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§6Thanks for downloading and installing CommandGUI");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Thread.sleep(3000);
|
||||
}
|
||||
}
|
||||
|
||||
Config.configCreate(version);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Messages_EN.messagesCreate(version);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Messages_DE.messagesCreate(version);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Messages_FR.messagesCreate(version);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Messages_NO.messagesCreate(version);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
GUI_1.configCreate(version);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
GUI_2.configCreate(version);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
GUI_3.configCreate(version);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Messages_Select.selectCreate();
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Vault.loadVault();
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
if (Main.PaPi){
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2PlaceholderAPI successfully connected!");
|
||||
}else{
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4PlaceholderAPI could not be connected / found!");
|
||||
}
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§8-------------------------------");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2Plugin loaded successfully.");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2-----------------------------------------------------------------------------------");
|
||||
}
|
||||
}
|
@ -0,0 +1,205 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
// -----------------------------
|
||||
// _____ _____ _ _ _____
|
||||
// / ____/ ____| | | |_ _|
|
||||
// | | | | __| | | | | |
|
||||
// | | | | |_ | | | | | |
|
||||
// | |___| |__| | |__| |_| |_
|
||||
// \_____\_____|\____/|_____|
|
||||
// -----------------------------
|
||||
|
||||
package de.jatitv.commandgui.system;
|
||||
|
||||
import de.jatitv.commandgui.commands.cmdManagement.*;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import de.jatitv.commandgui.listener.GUI_1;
|
||||
import de.jatitv.commandgui.listener.GUI_2;
|
||||
import de.jatitv.commandgui.listener.GUI_3;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import org.bukkit.craftbukkit.v1_16_R3.CraftServer;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public final class Main extends JavaPlugin {
|
||||
|
||||
// Debug Settings
|
||||
|
||||
public static Boolean Bstats = true;
|
||||
|
||||
public static Boolean Snapshot = false;
|
||||
|
||||
public static Boolean UpdateMSG = false;
|
||||
public static String UpdateInfo = DefaultValue.PrefixHC + "";
|
||||
|
||||
public static String Autor = "JaTiTV";
|
||||
public static String Spigot = "https://www.spigotmc.org/resources/commandgui-cgui.90671/";
|
||||
public static String DiscordLink = "https://discord.gg/vRyXFFterJ";
|
||||
public static String DiscordMSG = "You want to discuss and decide about current bugs, planned updates, new features?\n" +
|
||||
"Then come to our Discord ➙ " + DiscordLink;
|
||||
public static String DiscordLoad = "https://discord.gg/vRyXFFterJ";
|
||||
|
||||
// ---------------------------------------------
|
||||
|
||||
public static Main plugin;
|
||||
public static Plugin a;
|
||||
public static Economy eco = null;
|
||||
public static String update_version = null;
|
||||
public static Boolean PaPi = false;
|
||||
public static boolean minecraft1_8;
|
||||
public static boolean minecraft1_9;
|
||||
public static boolean minecraft1_10;
|
||||
public static boolean minecraft1_11;
|
||||
public static boolean minecraft1_12;
|
||||
public static boolean minecraft1_13;
|
||||
public static boolean minecraft1_14;
|
||||
public static boolean minecraft1_15;
|
||||
public static boolean minecraft1_16;
|
||||
|
||||
public static Main getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
public static Plugin thisp() {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
|
||||
// Plugin startup logic
|
||||
Logger logger = this.getLogger();
|
||||
plugin = this;
|
||||
a = this;
|
||||
minecraft1_8 = Bukkit.getServer().getClass().getPackage().getName().contains("1_8");
|
||||
minecraft1_9 = Bukkit.getServer().getClass().getPackage().getName().contains("1_9");
|
||||
minecraft1_10 = Bukkit.getServer().getClass().getPackage().getName().contains("1_10");
|
||||
minecraft1_11 = Bukkit.getServer().getClass().getPackage().getName().contains("1_11");
|
||||
minecraft1_12 = Bukkit.getServer().getClass().getPackage().getName().contains("1_12");
|
||||
minecraft1_13 = Bukkit.getServer().getClass().getPackage().getName().contains("1_13");
|
||||
minecraft1_14 = Bukkit.getServer().getClass().getPackage().getName().contains("1_14");
|
||||
minecraft1_15 = Bukkit.getServer().getClass().getPackage().getName().contains("1_15");
|
||||
minecraft1_16 = Bukkit.getServer().getClass().getPackage().getName().contains("1_16");
|
||||
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
|
||||
PaPi = true;
|
||||
}
|
||||
|
||||
try {
|
||||
Load.LoadSend(getDescription().getVersion());
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
getCommand("commandgui").setExecutor(new CmdExecuter());
|
||||
getCommand("commandgui").setTabCompleter(new TabComplete());
|
||||
if (minecraft1_13) {
|
||||
CmdRegister_13.onregister();
|
||||
} else if (minecraft1_14) {
|
||||
CmdRegister_14.onregister();
|
||||
} else if (minecraft1_15) {
|
||||
CmdRegister_15.onregister();
|
||||
} else if (minecraft1_16) {
|
||||
CmdRegister_16.onregister();
|
||||
}
|
||||
|
||||
|
||||
Permissions.addPermission();
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new GUI_1(), this);
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new GUI_2(), this);
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new GUI_3(), this);
|
||||
|
||||
if (Main.Bstats) {
|
||||
int pluginId = 10840; // <-- Replace with the id of your plugin!
|
||||
Metrics metrics = new Metrics(this, pluginId);
|
||||
metrics.addCustomChart(new Metrics.SimplePie("updatecheckonjoin", () -> String.valueOf(DefaultValue.UpdateCheckOnJoin)));
|
||||
} else {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4\n" + DefaultValue.PrefixHC + "§4Bstats is disabled!");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
}
|
||||
}.runTaskLater(Main.getPlugin(), 200L);
|
||||
}
|
||||
|
||||
// Optional: Add custom charts
|
||||
// metrics.addCustomChart(new Metrics.SimplePie("chart_id", () -> "My value"));
|
||||
|
||||
int taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
|
||||
public void run() {
|
||||
(new UpdateChecker((JavaPlugin) Main.thisp(), 90671)).getVersion((version) -> {
|
||||
String foundVersion = Main.thisp().getDescription().getVersion();
|
||||
update_version = version;
|
||||
if (!foundVersion.equalsIgnoreCase(version)) {
|
||||
String updateFound = (DefaultValue.PrefixHC + "§6A new version of §8[§4Command§9GUI§8]§6 was found!");
|
||||
String yourVersion = (DefaultValue.PrefixHC + "§6Your version §c" + foundVersion);
|
||||
String currentVersion = (DefaultValue.PrefixHC + "§6Current version: §a" + version);
|
||||
String downloadVersion = (DefaultValue.PrefixHC + "§6You can download it here: §e" + Spigot);
|
||||
String discord = (DefaultValue.PrefixHC + "§6You can find more information about §8[§4Command§9GUI§8]§6 on Discord: §e" + DiscordLink);
|
||||
String SnapshotConsole = (DefaultValue.PrefixHC + "§6" +
|
||||
"\n" + DefaultValue.PrefixHC + "§4Please note!§6" +
|
||||
"\n" + DefaultValue.PrefixHC + "§4You are using the §6" + foundVersion + " §4of §4Command§9GUI!§6" +
|
||||
"\n" + DefaultValue.PrefixHC + "§4There may be errors and it is possible that not all functions work as they should!§6" +
|
||||
"\n" + DefaultValue.PrefixHC + "§2If there are any bugs, please report them to me via Discord so I can fix them!§6" +
|
||||
"\n" + DefaultValue.PrefixHC + "§7" + DiscordLink);
|
||||
|
||||
if (Main.Snapshot) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
Bukkit.getConsoleSender().sendMessage(SnapshotConsole);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
}
|
||||
}.runTaskLater(Main.getPlugin(), 300L);
|
||||
}
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
Bukkit.getConsoleSender().sendMessage(updateFound);
|
||||
Bukkit.getConsoleSender().sendMessage(yourVersion);
|
||||
Bukkit.getConsoleSender().sendMessage(currentVersion);
|
||||
Bukkit.getConsoleSender().sendMessage(downloadVersion);
|
||||
Bukkit.getConsoleSender().sendMessage(discord);
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + " ");
|
||||
}
|
||||
}.runTaskLater(Main.getPlugin(), 600L);
|
||||
} else {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2No update found");
|
||||
}
|
||||
}.runTaskLater(Main.getPlugin(), 120L);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}, 0L, 20 * 60 * 60L);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
// Plugin shutdown logic
|
||||
Disable.disableSend(getDescription().getVersion());
|
||||
}
|
||||
}
|
@ -0,0 +1,852 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.system;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Metrics {
|
||||
|
||||
private final Plugin plugin;
|
||||
|
||||
private final MetricsBase metricsBase;
|
||||
|
||||
/**
|
||||
* Creates a new Metrics instance.
|
||||
*
|
||||
* @param plugin Your plugin instance.
|
||||
* @param serviceId The id of the service. It can be found at <a
|
||||
* href="https://bstats.org/what-is-my-plugin-id">What is my plugin id?</a>
|
||||
*/
|
||||
public Metrics(JavaPlugin plugin, int serviceId) {
|
||||
this.plugin = plugin;
|
||||
// Get the config file
|
||||
File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
|
||||
File configFile = new File(bStatsFolder, "config.yml");
|
||||
YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile);
|
||||
if (!config.isSet("serverUuid")) {
|
||||
config.addDefault("enabled", true);
|
||||
config.addDefault("serverUuid", UUID.randomUUID().toString());
|
||||
config.addDefault("logFailedRequests", false);
|
||||
config.addDefault("logSentData", false);
|
||||
config.addDefault("logResponseStatusText", false);
|
||||
// Inform the server owners about bStats
|
||||
config
|
||||
.options()
|
||||
.header(
|
||||
"bStats (https://bStats.org) collects some basic information for plugin authors, like how\n"
|
||||
+ "many people use their plugin and their total player count. It's recommended to keep bStats\n"
|
||||
+ "enabled, but if you're not comfortable with this, you can turn this setting off. There is no\n"
|
||||
+ "performance penalty associated with having metrics enabled, and data sent to bStats is fully\n"
|
||||
+ "anonymous.")
|
||||
.copyDefaults(true);
|
||||
try {
|
||||
config.save(configFile);
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
// Load the data
|
||||
boolean enabled = config.getBoolean("enabled", true);
|
||||
String serverUUID = config.getString("serverUuid");
|
||||
boolean logErrors = config.getBoolean("logFailedRequests", false);
|
||||
boolean logSentData = config.getBoolean("logSentData", false);
|
||||
boolean logResponseStatusText = config.getBoolean("logResponseStatusText", false);
|
||||
metricsBase =
|
||||
new MetricsBase(
|
||||
"bukkit",
|
||||
serverUUID,
|
||||
serviceId,
|
||||
enabled,
|
||||
this::appendPlatformData,
|
||||
this::appendServiceData,
|
||||
submitDataTask -> Bukkit.getScheduler().runTask(plugin, submitDataTask),
|
||||
plugin::isEnabled,
|
||||
(message, error) -> this.plugin.getLogger().log(Level.WARNING, message, error),
|
||||
(message) -> this.plugin.getLogger().log(Level.INFO, message),
|
||||
logErrors,
|
||||
logSentData,
|
||||
logResponseStatusText);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a custom chart.
|
||||
*
|
||||
* @param chart The chart to add.
|
||||
*/
|
||||
public void addCustomChart(CustomChart chart) {
|
||||
metricsBase.addCustomChart(chart);
|
||||
}
|
||||
|
||||
private void appendPlatformData(JsonObjectBuilder builder) {
|
||||
builder.appendField("playerAmount", getPlayerAmount());
|
||||
builder.appendField("onlineMode", Bukkit.getOnlineMode() ? 1 : 0);
|
||||
builder.appendField("bukkitVersion", Bukkit.getVersion());
|
||||
builder.appendField("bukkitName", Bukkit.getName());
|
||||
builder.appendField("javaVersion", System.getProperty("java.version"));
|
||||
builder.appendField("osName", System.getProperty("os.name"));
|
||||
builder.appendField("osArch", System.getProperty("os.arch"));
|
||||
builder.appendField("osVersion", System.getProperty("os.version"));
|
||||
builder.appendField("coreCount", Runtime.getRuntime().availableProcessors());
|
||||
}
|
||||
|
||||
private void appendServiceData(JsonObjectBuilder builder) {
|
||||
builder.appendField("pluginVersion", plugin.getDescription().getVersion());
|
||||
}
|
||||
|
||||
private int getPlayerAmount() {
|
||||
try {
|
||||
// Around MC 1.8 the return type was changed from an array to a collection,
|
||||
// This fixes java.lang.NoSuchMethodError:
|
||||
// org.bukkit.Bukkit.getOnlinePlayers()Ljava/util/Collection;
|
||||
Method onlinePlayersMethod = Class.forName("org.bukkit.Server").getMethod("getOnlinePlayers");
|
||||
return onlinePlayersMethod.getReturnType().equals(Collection.class)
|
||||
? ((Collection<?>) onlinePlayersMethod.invoke(Bukkit.getServer())).size()
|
||||
: ((Player[]) onlinePlayersMethod.invoke(Bukkit.getServer())).length;
|
||||
} catch (Exception e) {
|
||||
// Just use the new method if the reflection failed
|
||||
return Bukkit.getOnlinePlayers().size();
|
||||
}
|
||||
}
|
||||
|
||||
public static class MetricsBase {
|
||||
|
||||
/** The version of the Metrics class. */
|
||||
public static final String METRICS_VERSION = "2.2.1";
|
||||
|
||||
private static final ScheduledExecutorService scheduler =
|
||||
Executors.newScheduledThreadPool(1, task -> new Thread(task, "bStats-Metrics"));
|
||||
|
||||
private static final String REPORT_URL = "https://bStats.org/api/v2/data/%s";
|
||||
|
||||
private final String platform;
|
||||
|
||||
private final String serverUuid;
|
||||
|
||||
private final int serviceId;
|
||||
|
||||
private final Consumer<JsonObjectBuilder> appendPlatformDataConsumer;
|
||||
|
||||
private final Consumer<JsonObjectBuilder> appendServiceDataConsumer;
|
||||
|
||||
private final Consumer<Runnable> submitTaskConsumer;
|
||||
|
||||
private final Supplier<Boolean> checkServiceEnabledSupplier;
|
||||
|
||||
private final BiConsumer<String, Throwable> errorLogger;
|
||||
|
||||
private final Consumer<String> infoLogger;
|
||||
|
||||
private final boolean logErrors;
|
||||
|
||||
private final boolean logSentData;
|
||||
|
||||
private final boolean logResponseStatusText;
|
||||
|
||||
private final Set<CustomChart> customCharts = new HashSet<>();
|
||||
|
||||
private final boolean enabled;
|
||||
|
||||
/**
|
||||
* Creates a new MetricsBase class instance.
|
||||
*
|
||||
* @param platform The platform of the service.
|
||||
* @param serviceId The id of the service.
|
||||
* @param serverUuid The server uuid.
|
||||
* @param enabled Whether or not data sending is enabled.
|
||||
* @param appendPlatformDataConsumer A consumer that receives a {@code JsonObjectBuilder} and
|
||||
* appends all platform-specific data.
|
||||
* @param appendServiceDataConsumer A consumer that receives a {@code JsonObjectBuilder} and
|
||||
* appends all service-specific data.
|
||||
* @param submitTaskConsumer A consumer that takes a runnable with the submit task. This can be
|
||||
* used to delegate the data collection to a another thread to prevent errors caused by
|
||||
* concurrency. Can be {@code null}.
|
||||
* @param checkServiceEnabledSupplier A supplier to check if the service is still enabled.
|
||||
* @param errorLogger A consumer that accepts log message and an error.
|
||||
* @param infoLogger A consumer that accepts info log messages.
|
||||
* @param logErrors Whether or not errors should be logged.
|
||||
* @param logSentData Whether or not the sent data should be logged.
|
||||
* @param logResponseStatusText Whether or not the response status text should be logged.
|
||||
*/
|
||||
public MetricsBase(
|
||||
String platform,
|
||||
String serverUuid,
|
||||
int serviceId,
|
||||
boolean enabled,
|
||||
Consumer<JsonObjectBuilder> appendPlatformDataConsumer,
|
||||
Consumer<JsonObjectBuilder> appendServiceDataConsumer,
|
||||
Consumer<Runnable> submitTaskConsumer,
|
||||
Supplier<Boolean> checkServiceEnabledSupplier,
|
||||
BiConsumer<String, Throwable> errorLogger,
|
||||
Consumer<String> infoLogger,
|
||||
boolean logErrors,
|
||||
boolean logSentData,
|
||||
boolean logResponseStatusText) {
|
||||
this.platform = platform;
|
||||
this.serverUuid = serverUuid;
|
||||
this.serviceId = serviceId;
|
||||
this.enabled = enabled;
|
||||
this.appendPlatformDataConsumer = appendPlatformDataConsumer;
|
||||
this.appendServiceDataConsumer = appendServiceDataConsumer;
|
||||
this.submitTaskConsumer = submitTaskConsumer;
|
||||
this.checkServiceEnabledSupplier = checkServiceEnabledSupplier;
|
||||
this.errorLogger = errorLogger;
|
||||
this.infoLogger = infoLogger;
|
||||
this.logErrors = logErrors;
|
||||
this.logSentData = logSentData;
|
||||
this.logResponseStatusText = logResponseStatusText;
|
||||
checkRelocation();
|
||||
if (enabled) {
|
||||
startSubmitting();
|
||||
}
|
||||
}
|
||||
|
||||
public void addCustomChart(CustomChart chart) {
|
||||
this.customCharts.add(chart);
|
||||
}
|
||||
|
||||
private void startSubmitting() {
|
||||
final Runnable submitTask =
|
||||
() -> {
|
||||
if (!enabled || !checkServiceEnabledSupplier.get()) {
|
||||
// Submitting data or service is disabled
|
||||
scheduler.shutdown();
|
||||
return;
|
||||
}
|
||||
if (submitTaskConsumer != null) {
|
||||
submitTaskConsumer.accept(this::submitData);
|
||||
} else {
|
||||
this.submitData();
|
||||
}
|
||||
};
|
||||
// Many servers tend to restart at a fixed time at xx:00 which causes an uneven distribution
|
||||
// of requests on the
|
||||
// bStats backend. To circumvent this problem, we introduce some randomness into the initial
|
||||
// and second delay.
|
||||
// WARNING: You must not modify and part of this Metrics class, including the submit delay or
|
||||
// frequency!
|
||||
// WARNING: Modifying this code will get your plugin banned on bStats. Just don't do it!
|
||||
long initialDelay = (long) (1000 * 60 * (3 + Math.random() * 3));
|
||||
long secondDelay = (long) (1000 * 60 * (Math.random() * 30));
|
||||
scheduler.schedule(submitTask, initialDelay, TimeUnit.MILLISECONDS);
|
||||
scheduler.scheduleAtFixedRate(
|
||||
submitTask, initialDelay + secondDelay, 1000 * 60 * 30, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
private void submitData() {
|
||||
final JsonObjectBuilder baseJsonBuilder = new JsonObjectBuilder();
|
||||
appendPlatformDataConsumer.accept(baseJsonBuilder);
|
||||
final JsonObjectBuilder serviceJsonBuilder = new JsonObjectBuilder();
|
||||
appendServiceDataConsumer.accept(serviceJsonBuilder);
|
||||
JsonObjectBuilder.JsonObject[] chartData =
|
||||
customCharts.stream()
|
||||
.map(customChart -> customChart.getRequestJsonObject(errorLogger, logErrors))
|
||||
.filter(Objects::nonNull)
|
||||
.toArray(JsonObjectBuilder.JsonObject[]::new);
|
||||
serviceJsonBuilder.appendField("id", serviceId);
|
||||
serviceJsonBuilder.appendField("customCharts", chartData);
|
||||
baseJsonBuilder.appendField("service", serviceJsonBuilder.build());
|
||||
baseJsonBuilder.appendField("serverUUID", serverUuid);
|
||||
baseJsonBuilder.appendField("metricsVersion", METRICS_VERSION);
|
||||
JsonObjectBuilder.JsonObject data = baseJsonBuilder.build();
|
||||
scheduler.execute(
|
||||
() -> {
|
||||
try {
|
||||
// Send the data
|
||||
sendData(data);
|
||||
} catch (Exception e) {
|
||||
// Something went wrong! :(
|
||||
if (logErrors) {
|
||||
errorLogger.accept("Could not submit bStats metrics data", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sendData(JsonObjectBuilder.JsonObject data) throws Exception {
|
||||
if (logSentData) {
|
||||
infoLogger.accept("Sent bStats metrics data: " + data.toString());
|
||||
}
|
||||
String url = String.format(REPORT_URL, platform);
|
||||
HttpsURLConnection connection = (HttpsURLConnection) new URL(url).openConnection();
|
||||
// Compress the data to save bandwidth
|
||||
byte[] compressedData = compress(data.toString());
|
||||
connection.setRequestMethod("POST");
|
||||
connection.addRequestProperty("Accept", "application/json");
|
||||
connection.addRequestProperty("Connection", "close");
|
||||
connection.addRequestProperty("Content-Encoding", "gzip");
|
||||
connection.addRequestProperty("Content-Length", String.valueOf(compressedData.length));
|
||||
connection.setRequestProperty("Content-Type", "application/json");
|
||||
connection.setRequestProperty("User-Agent", "Metrics-Service/1");
|
||||
connection.setDoOutput(true);
|
||||
try (DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream())) {
|
||||
outputStream.write(compressedData);
|
||||
}
|
||||
StringBuilder builder = new StringBuilder();
|
||||
try (BufferedReader bufferedReader =
|
||||
new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
|
||||
String line;
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
builder.append(line);
|
||||
}
|
||||
}
|
||||
if (logResponseStatusText) {
|
||||
infoLogger.accept("Sent data to bStats and received response: " + builder);
|
||||
}
|
||||
}
|
||||
|
||||
/** Checks that the class was properly relocated. */
|
||||
private void checkRelocation() {
|
||||
// You can use the property to disable the check in your test environment
|
||||
if (System.getProperty("bstats.relocatecheck") == null
|
||||
|| !System.getProperty("bstats.relocatecheck").equals("false")) {
|
||||
// Maven's Relocate is clever and changes strings, too. So we have to use this little
|
||||
// "trick" ... :D
|
||||
final String defaultPackage =
|
||||
new String(new byte[] {'o', 'r', 'g', '.', 'b', 's', 't', 'a', 't', 's'});
|
||||
final String examplePackage =
|
||||
new String(new byte[] {'y', 'o', 'u', 'r', '.', 'p', 'a', 'c', 'k', 'a', 'g', 'e'});
|
||||
// We want to make sure no one just copy & pastes the example and uses the wrong package
|
||||
// names
|
||||
if (MetricsBase.class.getPackage().getName().startsWith(defaultPackage)
|
||||
|| MetricsBase.class.getPackage().getName().startsWith(examplePackage)) {
|
||||
throw new IllegalStateException("bStats Metrics class has not been relocated correctly!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gzips the given string.
|
||||
*
|
||||
* @param str The string to gzip.
|
||||
* @return The gzipped string.
|
||||
*/
|
||||
private static byte[] compress(final String str) throws IOException {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
try (GZIPOutputStream gzip = new GZIPOutputStream(outputStream)) {
|
||||
gzip.write(str.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static class AdvancedBarChart extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, int[]>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public AdvancedBarChart(String chartId, Callable<Map<String, int[]>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, int[]> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, int[]> entry : map.entrySet()) {
|
||||
if (entry.getValue().length == 0) {
|
||||
// Skip this invalid
|
||||
continue;
|
||||
}
|
||||
allSkipped = false;
|
||||
valuesBuilder.appendField(entry.getKey(), entry.getValue());
|
||||
}
|
||||
if (allSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class SimpleBarChart extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Integer>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public SimpleBarChart(String chartId, Callable<Map<String, Integer>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Integer> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||
valuesBuilder.appendField(entry.getKey(), new int[] {entry.getValue()});
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class MultiLineChart extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Integer>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public MultiLineChart(String chartId, Callable<Map<String, Integer>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Integer> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||
if (entry.getValue() == 0) {
|
||||
// Skip this invalid
|
||||
continue;
|
||||
}
|
||||
allSkipped = false;
|
||||
valuesBuilder.appendField(entry.getKey(), entry.getValue());
|
||||
}
|
||||
if (allSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class AdvancedPie extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Integer>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public AdvancedPie(String chartId, Callable<Map<String, Integer>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Integer> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||
if (entry.getValue() == 0) {
|
||||
// Skip this invalid
|
||||
continue;
|
||||
}
|
||||
allSkipped = false;
|
||||
valuesBuilder.appendField(entry.getKey(), entry.getValue());
|
||||
}
|
||||
if (allSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract static class CustomChart {
|
||||
|
||||
private final String chartId;
|
||||
|
||||
protected CustomChart(String chartId) {
|
||||
if (chartId == null) {
|
||||
throw new IllegalArgumentException("chartId must not be null");
|
||||
}
|
||||
this.chartId = chartId;
|
||||
}
|
||||
|
||||
public JsonObjectBuilder.JsonObject getRequestJsonObject(
|
||||
BiConsumer<String, Throwable> errorLogger, boolean logErrors) {
|
||||
JsonObjectBuilder builder = new JsonObjectBuilder();
|
||||
builder.appendField("chartId", chartId);
|
||||
try {
|
||||
JsonObjectBuilder.JsonObject data = getChartData();
|
||||
if (data == null) {
|
||||
// If the data is null we don't send the chart.
|
||||
return null;
|
||||
}
|
||||
builder.appendField("data", data);
|
||||
} catch (Throwable t) {
|
||||
if (logErrors) {
|
||||
errorLogger.accept("Failed to get data for custom chart with id " + chartId, t);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
protected abstract JsonObjectBuilder.JsonObject getChartData() throws Exception;
|
||||
}
|
||||
|
||||
public static class SingleLineChart extends CustomChart {
|
||||
|
||||
private final Callable<Integer> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public SingleLineChart(String chartId, Callable<Integer> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
int value = callable.call();
|
||||
if (value == 0) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("value", value).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class SimplePie extends CustomChart {
|
||||
|
||||
private final Callable<String> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public SimplePie(String chartId, Callable<String> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
String value = callable.call();
|
||||
if (value == null || value.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("value", value).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class DrilldownPie extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Map<String, Integer>>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public DrilldownPie(String chartId, Callable<Map<String, Map<String, Integer>>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Map<String, Integer>> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean reallyAllSkipped = true;
|
||||
for (Map.Entry<String, Map<String, Integer>> entryValues : map.entrySet()) {
|
||||
JsonObjectBuilder valueBuilder = new JsonObjectBuilder();
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, Integer> valueEntry : map.get(entryValues.getKey()).entrySet()) {
|
||||
valueBuilder.appendField(valueEntry.getKey(), valueEntry.getValue());
|
||||
allSkipped = false;
|
||||
}
|
||||
if (!allSkipped) {
|
||||
reallyAllSkipped = false;
|
||||
valuesBuilder.appendField(entryValues.getKey(), valueBuilder.build());
|
||||
}
|
||||
}
|
||||
if (reallyAllSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An extremely simple JSON builder.
|
||||
*
|
||||
* <p>While this class is neither feature-rich nor the most performant one, it's sufficient enough
|
||||
* for its use-case.
|
||||
*/
|
||||
public static class JsonObjectBuilder {
|
||||
|
||||
private StringBuilder builder = new StringBuilder();
|
||||
|
||||
private boolean hasAtLeastOneField = false;
|
||||
|
||||
public JsonObjectBuilder() {
|
||||
builder.append("{");
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a null field to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendNull(String key) {
|
||||
appendFieldUnescaped(key, "null");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a string field to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param value The value of the field.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, String value) {
|
||||
if (value == null) {
|
||||
throw new IllegalArgumentException("JSON value must not be null");
|
||||
}
|
||||
appendFieldUnescaped(key, "\"" + escape(value) + "\"");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an integer field to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param value The value of the field.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, int value) {
|
||||
appendFieldUnescaped(key, String.valueOf(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an object to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param object The object.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, JsonObject object) {
|
||||
if (object == null) {
|
||||
throw new IllegalArgumentException("JSON object must not be null");
|
||||
}
|
||||
appendFieldUnescaped(key, object.toString());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a string array to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param values The string array.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, String[] values) {
|
||||
if (values == null) {
|
||||
throw new IllegalArgumentException("JSON values must not be null");
|
||||
}
|
||||
String escapedValues =
|
||||
Arrays.stream(values)
|
||||
.map(value -> "\"" + escape(value) + "\"")
|
||||
.collect(Collectors.joining(","));
|
||||
appendFieldUnescaped(key, "[" + escapedValues + "]");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an integer array to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param values The integer array.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, int[] values) {
|
||||
if (values == null) {
|
||||
throw new IllegalArgumentException("JSON values must not be null");
|
||||
}
|
||||
String escapedValues =
|
||||
Arrays.stream(values).mapToObj(String::valueOf).collect(Collectors.joining(","));
|
||||
appendFieldUnescaped(key, "[" + escapedValues + "]");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an object array to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param values The integer array.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, JsonObject[] values) {
|
||||
if (values == null) {
|
||||
throw new IllegalArgumentException("JSON values must not be null");
|
||||
}
|
||||
String escapedValues =
|
||||
Arrays.stream(values).map(JsonObject::toString).collect(Collectors.joining(","));
|
||||
appendFieldUnescaped(key, "[" + escapedValues + "]");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a field to the object.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param escapedValue The escaped value of the field.
|
||||
*/
|
||||
private void appendFieldUnescaped(String key, String escapedValue) {
|
||||
if (builder == null) {
|
||||
throw new IllegalStateException("JSON has already been built");
|
||||
}
|
||||
if (key == null) {
|
||||
throw new IllegalArgumentException("JSON key must not be null");
|
||||
}
|
||||
if (hasAtLeastOneField) {
|
||||
builder.append(",");
|
||||
}
|
||||
builder.append("\"").append(escape(key)).append("\":").append(escapedValue);
|
||||
hasAtLeastOneField = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the JSON string and invalidates this builder.
|
||||
*
|
||||
* @return The built JSON string.
|
||||
*/
|
||||
public JsonObject build() {
|
||||
if (builder == null) {
|
||||
throw new IllegalStateException("JSON has already been built");
|
||||
}
|
||||
JsonObject object = new JsonObject(builder.append("}").toString());
|
||||
builder = null;
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes the given string like stated in https://www.ietf.org/rfc/rfc4627.txt.
|
||||
*
|
||||
* <p>This method escapes only the necessary characters '"', '\'. and '\u0000' - '\u001F'.
|
||||
* Compact escapes are not used (e.g., '\n' is escaped as "\u000a" and not as "\n").
|
||||
*
|
||||
* @param value The value to escape.
|
||||
* @return The escaped value.
|
||||
*/
|
||||
private static String escape(String value) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
char c = value.charAt(i);
|
||||
if (c == '"') {
|
||||
builder.append("\\\"");
|
||||
} else if (c == '\\') {
|
||||
builder.append("\\\\");
|
||||
} else if (c <= '\u000F') {
|
||||
builder.append("\\u000").append(Integer.toHexString(c));
|
||||
} else if (c <= '\u001F') {
|
||||
builder.append("\\u00").append(Integer.toHexString(c));
|
||||
} else {
|
||||
builder.append(c);
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* A super simple representation of a JSON object.
|
||||
*
|
||||
* <p>This class only exists to make methods of the {@link JsonObjectBuilder} type-safe and not
|
||||
* allow a raw string inputs for methods like {@link JsonObjectBuilder#appendField(String,
|
||||
* JsonObject)}.
|
||||
*/
|
||||
public static class JsonObject {
|
||||
|
||||
private final String value;
|
||||
|
||||
private JsonObject(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,221 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.system;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_1;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_2;
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue_GUI_3;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.permissions.Permission;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
public class Permissions extends JavaPlugin {
|
||||
|
||||
public static void addPermission(){
|
||||
|
||||
if (DefaultValue_GUI_1.Command_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.command.gui1"));
|
||||
if (DefaultValue_GUI_2.Command_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.command.gui2"));
|
||||
if (DefaultValue_GUI_3.Command_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.command.gui3"));
|
||||
|
||||
if (DefaultValue_GUI_1.GiveUseItemOnFirstJoin_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.giveuseitemonfirstjoin.gui1"));
|
||||
if (DefaultValue_GUI_2.GiveUseItemOnFirstJoin_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.giveuseitemonfirstjoin.gui2"));
|
||||
if (DefaultValue_GUI_3.GiveUseItemOnFirstJoin_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.giveuseitemonfirstjoin.gui3"));
|
||||
|
||||
if (DefaultValue_GUI_1.Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1"));
|
||||
if (DefaultValue_GUI_2.Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2"));
|
||||
if (DefaultValue_GUI_3.Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3"));
|
||||
|
||||
if (DefaultValue_GUI_1.L1_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line1.slot1"));
|
||||
if (DefaultValue_GUI_1.L1_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line1.slot2"));
|
||||
if (DefaultValue_GUI_1.L1_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line1.slot3"));
|
||||
if (DefaultValue_GUI_1.L1_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line1.slot4"));
|
||||
if (DefaultValue_GUI_1.L1_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line1.slot5"));
|
||||
if (DefaultValue_GUI_1.L1_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line1.slot6"));
|
||||
if (DefaultValue_GUI_1.L1_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line1.slot7"));
|
||||
if (DefaultValue_GUI_1.L1_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line1.slot8"));
|
||||
if (DefaultValue_GUI_1.L1_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line1.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_1.L2_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line2.slot1"));
|
||||
if (DefaultValue_GUI_1.L2_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line2.slot2"));
|
||||
if (DefaultValue_GUI_1.L2_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line2.slot3"));
|
||||
if (DefaultValue_GUI_1.L2_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line2.slot4"));
|
||||
if (DefaultValue_GUI_1.L2_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line2.slot5"));
|
||||
if (DefaultValue_GUI_1.L2_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line2.slot6"));
|
||||
if (DefaultValue_GUI_1.L2_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line2.slot7"));
|
||||
if (DefaultValue_GUI_1.L2_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line2.slot8"));
|
||||
if (DefaultValue_GUI_1.L2_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line2.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_1.L3_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line3.slot1"));
|
||||
if (DefaultValue_GUI_1.L3_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line3.slot2"));
|
||||
if (DefaultValue_GUI_1.L3_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line3.slot3"));
|
||||
if (DefaultValue_GUI_1.L3_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line3.slot4"));
|
||||
if (DefaultValue_GUI_1.L3_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line3.slot5"));
|
||||
if (DefaultValue_GUI_1.L3_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line3.slot6"));
|
||||
if (DefaultValue_GUI_1.L3_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line3.slot7"));
|
||||
if (DefaultValue_GUI_1.L3_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line3.slot8"));
|
||||
if (DefaultValue_GUI_1.L3_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line3.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_1.L4_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line4.slot1"));
|
||||
if (DefaultValue_GUI_1.L4_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line4.slot2"));
|
||||
if (DefaultValue_GUI_1.L4_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line4.slot3"));
|
||||
if (DefaultValue_GUI_1.L4_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line4.slot4"));
|
||||
if (DefaultValue_GUI_1.L4_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line4.slot5"));
|
||||
if (DefaultValue_GUI_1.L4_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line4.slot6"));
|
||||
if (DefaultValue_GUI_1.L4_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line4.slot7"));
|
||||
if (DefaultValue_GUI_1.L4_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line4.slot8"));
|
||||
if (DefaultValue_GUI_1.L4_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line4.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_1.L5_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line5.slot1"));
|
||||
if (DefaultValue_GUI_1.L5_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line5.slot2"));
|
||||
if (DefaultValue_GUI_1.L5_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line5.slot3"));
|
||||
if (DefaultValue_GUI_1.L5_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line5.slot4"));
|
||||
if (DefaultValue_GUI_1.L5_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line5.slot5"));
|
||||
if (DefaultValue_GUI_1.L5_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line5.slot6"));
|
||||
if (DefaultValue_GUI_1.L5_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line5.slot7"));
|
||||
if (DefaultValue_GUI_1.L5_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line5.slot8"));
|
||||
if (DefaultValue_GUI_1.L5_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line5.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_1.L6_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line6.slot1"));
|
||||
if (DefaultValue_GUI_1.L6_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line6.slot2"));
|
||||
if (DefaultValue_GUI_1.L6_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line6.slot3"));
|
||||
if (DefaultValue_GUI_1.L6_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line6.slot4"));
|
||||
if (DefaultValue_GUI_1.L6_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line6.slot5"));
|
||||
if (DefaultValue_GUI_1.L6_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line6.slot6"));
|
||||
if (DefaultValue_GUI_1.L6_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line6.slot7"));
|
||||
if (DefaultValue_GUI_1.L6_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line6.slot8"));
|
||||
if (DefaultValue_GUI_1.L6_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui1.line6.slot9"));
|
||||
|
||||
|
||||
/**
|
||||
* GUI2
|
||||
*/
|
||||
|
||||
if (DefaultValue_GUI_2.L1_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line1.slot1"));
|
||||
if (DefaultValue_GUI_2.L1_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line1.slot2"));
|
||||
if (DefaultValue_GUI_2.L1_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line1.slot3"));
|
||||
if (DefaultValue_GUI_2.L1_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line1.slot4"));
|
||||
if (DefaultValue_GUI_2.L1_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line1.slot5"));
|
||||
if (DefaultValue_GUI_2.L1_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line1.slot6"));
|
||||
if (DefaultValue_GUI_2.L1_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line1.slot7"));
|
||||
if (DefaultValue_GUI_2.L1_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line1.slot8"));
|
||||
if (DefaultValue_GUI_2.L1_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line1.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_2.L2_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line2.slot1"));
|
||||
if (DefaultValue_GUI_2.L2_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line2.slot2"));
|
||||
if (DefaultValue_GUI_2.L2_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line2.slot3"));
|
||||
if (DefaultValue_GUI_2.L2_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line2.slot4"));
|
||||
if (DefaultValue_GUI_2.L2_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line2.slot5"));
|
||||
if (DefaultValue_GUI_2.L2_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line2.slot6"));
|
||||
if (DefaultValue_GUI_2.L2_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line2.slot7"));
|
||||
if (DefaultValue_GUI_2.L2_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line2.slot8"));
|
||||
if (DefaultValue_GUI_2.L2_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line2.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_2.L3_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line3.slot1"));
|
||||
if (DefaultValue_GUI_2.L3_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line3.slot2"));
|
||||
if (DefaultValue_GUI_2.L3_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line3.slot3"));
|
||||
if (DefaultValue_GUI_2.L3_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line3.slot4"));
|
||||
if (DefaultValue_GUI_2.L3_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line3.slot5"));
|
||||
if (DefaultValue_GUI_2.L3_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line3.slot6"));
|
||||
if (DefaultValue_GUI_2.L3_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line3.slot7"));
|
||||
if (DefaultValue_GUI_2.L3_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line3.slot8"));
|
||||
if (DefaultValue_GUI_2.L3_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line3.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_2.L4_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line4.slot1"));
|
||||
if (DefaultValue_GUI_2.L4_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line4.slot2"));
|
||||
if (DefaultValue_GUI_2.L4_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line4.slot3"));
|
||||
if (DefaultValue_GUI_2.L4_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line4.slot4"));
|
||||
if (DefaultValue_GUI_2.L4_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line4.slot5"));
|
||||
if (DefaultValue_GUI_2.L4_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line4.slot6"));
|
||||
if (DefaultValue_GUI_2.L4_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line4.slot7"));
|
||||
if (DefaultValue_GUI_2.L4_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line4.slot8"));
|
||||
if (DefaultValue_GUI_2.L4_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line4.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_2.L5_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line5.slot1"));
|
||||
if (DefaultValue_GUI_2.L5_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line5.slot2"));
|
||||
if (DefaultValue_GUI_2.L5_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line5.slot3"));
|
||||
if (DefaultValue_GUI_2.L5_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line5.slot4"));
|
||||
if (DefaultValue_GUI_2.L5_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line5.slot5"));
|
||||
if (DefaultValue_GUI_2.L5_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line5.slot6"));
|
||||
if (DefaultValue_GUI_2.L5_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line5.slot7"));
|
||||
if (DefaultValue_GUI_2.L5_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line5.slot8"));
|
||||
if (DefaultValue_GUI_2.L5_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line5.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_2.L6_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line6.slot1"));
|
||||
if (DefaultValue_GUI_2.L6_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line6.slot2"));
|
||||
if (DefaultValue_GUI_2.L6_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line6.slot3"));
|
||||
if (DefaultValue_GUI_2.L6_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line6.slot4"));
|
||||
if (DefaultValue_GUI_2.L6_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line6.slot5"));
|
||||
if (DefaultValue_GUI_2.L6_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line6.slot6"));
|
||||
if (DefaultValue_GUI_2.L6_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line6.slot7"));
|
||||
if (DefaultValue_GUI_2.L6_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line6.slot8"));
|
||||
if (DefaultValue_GUI_2.L6_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui2.line6.slot9"));
|
||||
|
||||
|
||||
/**
|
||||
* GUI3
|
||||
*/
|
||||
|
||||
if (DefaultValue_GUI_3.L1_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line1.slot1"));
|
||||
if (DefaultValue_GUI_3.L1_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line1.slot2"));
|
||||
if (DefaultValue_GUI_3.L1_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line1.slot3"));
|
||||
if (DefaultValue_GUI_3.L1_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line1.slot4"));
|
||||
if (DefaultValue_GUI_3.L1_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line1.slot5"));
|
||||
if (DefaultValue_GUI_3.L1_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line1.slot6"));
|
||||
if (DefaultValue_GUI_3.L1_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line1.slot7"));
|
||||
if (DefaultValue_GUI_3.L1_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line1.slot8"));
|
||||
if (DefaultValue_GUI_3.L1_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line1.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_3.L2_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line2.slot1"));
|
||||
if (DefaultValue_GUI_3.L2_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line2.slot2"));
|
||||
if (DefaultValue_GUI_3.L2_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line2.slot3"));
|
||||
if (DefaultValue_GUI_3.L2_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line2.slot4"));
|
||||
if (DefaultValue_GUI_3.L2_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line2.slot5"));
|
||||
if (DefaultValue_GUI_3.L2_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line2.slot6"));
|
||||
if (DefaultValue_GUI_3.L2_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line2.slot7"));
|
||||
if (DefaultValue_GUI_3.L2_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line2.slot8"));
|
||||
if (DefaultValue_GUI_3.L2_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line2.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_3.L3_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line3.slot1"));
|
||||
if (DefaultValue_GUI_3.L3_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line3.slot2"));
|
||||
if (DefaultValue_GUI_3.L3_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line3.slot3"));
|
||||
if (DefaultValue_GUI_3.L3_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line3.slot4"));
|
||||
if (DefaultValue_GUI_3.L3_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line3.slot5"));
|
||||
if (DefaultValue_GUI_3.L3_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line3.slot6"));
|
||||
if (DefaultValue_GUI_3.L3_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line3.slot7"));
|
||||
if (DefaultValue_GUI_3.L3_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line3.slot8"));
|
||||
if (DefaultValue_GUI_3.L3_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line3.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_3.L4_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line4.slot1"));
|
||||
if (DefaultValue_GUI_3.L4_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line4.slot2"));
|
||||
if (DefaultValue_GUI_3.L4_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line4.slot3"));
|
||||
if (DefaultValue_GUI_3.L4_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line4.slot4"));
|
||||
if (DefaultValue_GUI_3.L4_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line4.slot5"));
|
||||
if (DefaultValue_GUI_3.L4_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line4.slot6"));
|
||||
if (DefaultValue_GUI_3.L4_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line4.slot7"));
|
||||
if (DefaultValue_GUI_3.L4_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line4.slot8"));
|
||||
if (DefaultValue_GUI_3.L4_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line4.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_3.L5_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line5.slot1"));
|
||||
if (DefaultValue_GUI_3.L5_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line5.slot2"));
|
||||
if (DefaultValue_GUI_3.L5_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line5.slot3"));
|
||||
if (DefaultValue_GUI_3.L5_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line5.slot4"));
|
||||
if (DefaultValue_GUI_3.L5_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line5.slot5"));
|
||||
if (DefaultValue_GUI_3.L5_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line5.slot6"));
|
||||
if (DefaultValue_GUI_3.L5_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line5.slot7"));
|
||||
if (DefaultValue_GUI_3.L5_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line5.slot8"));
|
||||
if (DefaultValue_GUI_3.L5_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line5.slot9"));
|
||||
|
||||
if (DefaultValue_GUI_3.L6_S1_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line6.slot1"));
|
||||
if (DefaultValue_GUI_3.L6_S2_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line6.slot2"));
|
||||
if (DefaultValue_GUI_3.L6_S3_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line6.slot3"));
|
||||
if (DefaultValue_GUI_3.L6_S4_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line6.slot4"));
|
||||
if (DefaultValue_GUI_3.L6_S5_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line6.slot5"));
|
||||
if (DefaultValue_GUI_3.L6_S6_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line6.slot6"));
|
||||
if (DefaultValue_GUI_3.L6_S7_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line6.slot7"));
|
||||
if (DefaultValue_GUI_3.L6_S8_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line6.slot8"));
|
||||
if (DefaultValue_GUI_3.L6_S9_Permission_Enable) Bukkit.getPluginManager().addPermission(new Permission("commandgui.use.gui3.line6.slot9"));
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
// -----------------------------
|
||||
// _____ _____ _ _ _____
|
||||
// / ____/ ____| | | |_ _|
|
||||
// | | | | __| | | | | |
|
||||
// | | | | |_ | | | | | |
|
||||
// | |___| |__| | |__| |_| |_
|
||||
// \_____\_____|\____/|_____|
|
||||
// -----------------------------
|
||||
|
||||
package de.jatitv.commandgui.system;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.Scanner;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class UpdateChecker {
|
||||
|
||||
private JavaPlugin plugin;
|
||||
private int resourceId;
|
||||
|
||||
public UpdateChecker(JavaPlugin plugin, int resourceId) {
|
||||
this.plugin = plugin;
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
|
||||
public void getVersion(Consumer<String> consumer) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
||||
try {
|
||||
InputStream inputStream = (new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.resourceId)).openStream();
|
||||
try {
|
||||
Scanner scanner = new Scanner(inputStream);
|
||||
|
||||
try {
|
||||
if (scanner.hasNext()) {
|
||||
consumer.accept(scanner.next());
|
||||
}
|
||||
} catch (Throwable var8) {
|
||||
try {
|
||||
scanner.close();
|
||||
} catch (Throwable var7) {
|
||||
var8.addSuppressed(var7);
|
||||
}
|
||||
throw var8;
|
||||
}
|
||||
scanner.close();
|
||||
} catch (Throwable var9) {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (Throwable var6) {
|
||||
var9.addSuppressed(var6);
|
||||
}
|
||||
}
|
||||
throw var9;
|
||||
}
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
}
|
||||
} catch (IOException var10) {
|
||||
this.plugin.getLogger().severe(DefaultValue.PrefixHC + "§4 Cannot look for updates: " + var10.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandgui.system;
|
||||
|
||||
import de.jatitv.commandgui.defaultValue.DefaultValue;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
|
||||
public class Vault {
|
||||
|
||||
public static void loadVault() throws InterruptedException {
|
||||
if(Main.a.getServer().getPluginManager().getPlugin("Vault") != null){
|
||||
RegisteredServiceProvider<Economy> rsp = Main.a.getServer().getServicesManager().getRegistration(Economy.class);
|
||||
if(rsp != null){
|
||||
Main.eco = rsp.getProvider();
|
||||
if(Main.eco != null){
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§2Vault / Economy successfully connected!");
|
||||
}else{
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Economy could not be connected / found!");
|
||||
}
|
||||
}else{
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Economy could not be connected / found!");
|
||||
}
|
||||
}else{
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Vault / Economy could not be connected / found!");
|
||||
}
|
||||
}
|
||||
public static void vaultDisable(){
|
||||
Bukkit.getConsoleSender().sendMessage(DefaultValue.PrefixHC + "§4Vault / Economy successfully deactivated.");
|
||||
}
|
||||
}
|
25
CommandGUI V1/src/main/resources/plugin.yml
Normal file
25
CommandGUI V1/src/main/resources/plugin.yml
Normal file
@ -0,0 +1,25 @@
|
||||
name: CommandGUI
|
||||
version: 1.2.2
|
||||
api-version: 1.13
|
||||
main: de.jatitv.commandgui.system.Main
|
||||
authors: [ JaTiTV ]
|
||||
softdepend:
|
||||
- Vault
|
||||
- Economy
|
||||
- EssentialsX
|
||||
- CMI
|
||||
- PlaceholderAPI
|
||||
commands:
|
||||
commandgui:
|
||||
description: Open the CGUI
|
||||
aliases: [cgui]
|
||||
|
||||
permissions:
|
||||
commandgui.command:
|
||||
default: op
|
||||
commandgui.command.info:
|
||||
default: op
|
||||
commandgui.command.give:
|
||||
default: op
|
||||
commandgui.admin:
|
||||
default: op
|
113
CommandGUI V2/.gitignore
vendored
Normal file
113
CommandGUI V2/.gitignore
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
# User-specific stuff
|
||||
.idea/
|
||||
|
||||
*.iml
|
||||
*.ipr
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
|
||||
*~
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
target/
|
||||
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
.mvn/wrapper/maven-wrapper.jar
|
||||
.flattened-pom.xml
|
||||
|
||||
# Common working directory
|
||||
run/
|
172
CommandGUI V2/pom.xml
Normal file
172
CommandGUI V2/pom.xml
Normal file
@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
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>net.t2code</groupId>
|
||||
<artifactId>CommandGUI_V2</artifactId>
|
||||
<version>2.5.12</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>CommandGUI</name>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>8</source>
|
||||
<target>8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>Builders-Paradise</id>
|
||||
<url>https://repo.t2code.net/repository/Builders-Paradise/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>T2Code</id>
|
||||
<url>https://repo.t2code.net/repository/T2Code/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>bungee</artifactId>
|
||||
<version>1615</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>PlugmanGUI</artifactId>
|
||||
<version>3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>T2CodeLib</artifactId>
|
||||
<version>7.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_18.r1</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.18r1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_17.r1</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.17r1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_16.r3</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.16r3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_16.r2</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.16r2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_16.r1</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.16r1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_15.r1</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.15r1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_14.r1</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.14r1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_13.r2</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.13r2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_13.r1</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.13r1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_12.r1</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.12r1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_11.r1</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.11r1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_10.r1</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.10r1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_9.r2</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.9r2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_9.r1</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.9r1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_8.r3</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.8r3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_8.r2</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.8r2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.t2code.minecraft.1_8.r1</groupId>
|
||||
<artifactId>spigot</artifactId>
|
||||
<version>1.8r1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
86
CommandGUI V2/src/main/Planned changes/default.yml
Normal file
86
CommandGUI V2/src/main/Planned changes/default.yml
Normal file
@ -0,0 +1,86 @@
|
||||
GUI:
|
||||
Enable: true
|
||||
Lines: 1
|
||||
Name: '&5default &9GUI'
|
||||
FillItem:
|
||||
Enable: true
|
||||
Item: BLACK_STAINED_GLASS_PANE
|
||||
Command:
|
||||
Alias: true
|
||||
Permission:
|
||||
Required: true
|
||||
Slots:
|
||||
Example:
|
||||
Slot: 5
|
||||
Enable: true
|
||||
Item:
|
||||
Empty: false
|
||||
Amount: 1
|
||||
PlayerHead:
|
||||
Enable: true
|
||||
Base64:
|
||||
Enable: true
|
||||
Base64Value: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg3M2MxMmJmZmI1MjUxYTBiODhkNWFlNzVjNzI0N2NiMzlhNzVmZjFhODFjYmU0YzhhMzliMzExZGRlZGEifX19
|
||||
PlayerWhoHasOpenedTheGUI: false
|
||||
PlayerName: ''
|
||||
Material: ''
|
||||
Name: '&3Support Discord'
|
||||
Lore:
|
||||
- '&8-----------------'
|
||||
- '&bIf you need help setting up the plugin,'
|
||||
- '&bfeel free to contact me on the Suport Discord.'
|
||||
- '&8-----------------'
|
||||
- '&eIf you find any errors or bugs,'
|
||||
- '&eplease contact me so I can fix them.'
|
||||
- '&8-----------------'
|
||||
- '&5Discord: §7https://discord.gg/vRyXFFterJ'
|
||||
CustomSound:
|
||||
Enable: false
|
||||
NoSound: false
|
||||
Sound: ''
|
||||
Cost:
|
||||
Enable: false
|
||||
Price: 0.0
|
||||
Command:
|
||||
Enable: false
|
||||
BungeeCommand: false
|
||||
CommandAsConsole: false
|
||||
Command:
|
||||
- ''
|
||||
OpenGUI:
|
||||
Enable: false
|
||||
GUI: ''
|
||||
Message:
|
||||
Enable: true
|
||||
Message:
|
||||
- '&6You can find more information on Discord: &ehttps://discord.gg/vRyXFFterJ'
|
||||
Permission:
|
||||
Required: false
|
||||
ServerChange:
|
||||
Enable: false
|
||||
Server: ''
|
||||
SetConfig:
|
||||
Enable: false
|
||||
File:
|
||||
Path: ''
|
||||
Option:
|
||||
Path: ''
|
||||
Premat: String
|
||||
Value:
|
||||
LeftClick:
|
||||
ChatInput: false
|
||||
String: ''
|
||||
Boolean: false
|
||||
Integer: 0
|
||||
Double: 0.0
|
||||
List: []
|
||||
RightClick:
|
||||
ChatInput: false
|
||||
String: ''
|
||||
Boolean: false
|
||||
Integer: 0
|
||||
Double: 0.0
|
||||
List: []
|
||||
PluginReload:
|
||||
Enable: false
|
||||
Command: ''
|
@ -0,0 +1,42 @@
|
||||
package de.jatitv.commandguiv2.Bungee;
|
||||
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
import net.md_5.bungee.config.ConfigurationProvider;
|
||||
import net.md_5.bungee.config.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
|
||||
public class BConfig {
|
||||
|
||||
public static void create() {
|
||||
|
||||
if (!BMain.plugin.getDataFolder().exists())
|
||||
BMain.plugin.getDataFolder().mkdir();
|
||||
|
||||
File file = new File(BMain.plugin.getDataFolder(), "config.yml");
|
||||
|
||||
|
||||
if (!file.exists()) {
|
||||
try (InputStream in = BMain.plugin.getResourceAsStream("config.yml")) {
|
||||
Files.copy(in, file.toPath());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
try {
|
||||
Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(BMain.plugin.getDataFolder(), "config.yml"));
|
||||
BMySQL.ip = configuration.getString("MySQL.IP");
|
||||
BMySQL.port = configuration.getInt("MySQL.Port");
|
||||
BMySQL.database = configuration.getString("MySQL.Database");
|
||||
BMySQL.user = configuration.getString("MySQL.User");
|
||||
BMySQL.password = configuration.getString("MySQL.Password");
|
||||
BMySQL.SSL = configuration.getBoolean("MySQL.SSL");
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,86 @@
|
||||
package de.jatitv.commandguiv2.Bungee;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
|
||||
import net.md_5.bungee.BungeeCord;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
|
||||
import net.md_5.bungee.api.event.PluginMessageEvent;
|
||||
import net.md_5.bungee.api.event.PostLoginEvent;
|
||||
import net.md_5.bungee.api.plugin.Listener;
|
||||
import net.md_5.bungee.event.EventHandler;
|
||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public class BListener implements Listener {
|
||||
@EventHandler
|
||||
public void onPluginmessage(PluginMessageEvent event) {
|
||||
if (event.getTag().equalsIgnoreCase("cgui:bungee")) {
|
||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(event.getData()));
|
||||
try {
|
||||
String channel = stream.readUTF();
|
||||
String input = stream.readUTF();
|
||||
ProxiedPlayer player = BungeeCord.getInstance().getPlayer(channel);
|
||||
|
||||
|
||||
if (player != null) {
|
||||
BungeeCord.getInstance().getPluginManager().dispatchCommand(player, input);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onJoin(PostLoginEvent e) {
|
||||
ProxiedPlayer player = e.getPlayer();
|
||||
sendToSpigotPlayer(player.getName(), true);
|
||||
BMySQL.query("INSERT INTO `gui-bungeeplayer` (`UUID`, `Name`, `Online`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
||||
+ "', 'true') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Online` = 'true';");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onDisconnect(PlayerDisconnectEvent e) {
|
||||
ProxiedPlayer player = e.getPlayer();
|
||||
sendToSpigotPlayer(e.getPlayer().getName(), false);
|
||||
BMySQL.query("INSERT INTO `gui-bungeeplayer` (`UUID`, `Name`, `Online`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
||||
+ "', 'true') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Online` = 'false';");
|
||||
}
|
||||
|
||||
public static void sendToSpigotPlayer(String name, Boolean join) {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
DataOutputStream output = new DataOutputStream(stream);
|
||||
try {
|
||||
if (join) {
|
||||
output.writeUTF("join");
|
||||
} else {
|
||||
output.writeUTF("left");
|
||||
}
|
||||
output.writeUTF(name);
|
||||
} catch (IOException e) {
|
||||
Logger.getLogger(e.getMessage());
|
||||
}
|
||||
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
|
||||
server.sendData("cgui:onlineplayers", stream.toByteArray());
|
||||
});
|
||||
}
|
||||
|
||||
public static void sendToSpigotDeleteAll() {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
DataOutputStream output = new DataOutputStream(stream);
|
||||
try {
|
||||
output.writeUTF("clear");
|
||||
output.writeUTF("");
|
||||
} catch (IOException e) {
|
||||
Logger.getLogger(e.getMessage());
|
||||
}
|
||||
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
|
||||
server.sendData("cgui:onlineplayers", stream.toByteArray());
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package de.jatitv.commandguiv2.Bungee;
|
||||
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public final class BMain extends Plugin {
|
||||
private boolean enable = false;
|
||||
public static Plugin plugin;
|
||||
public static String update_version = null;
|
||||
|
||||
public static String prefix = "§8[§4C§9GUI§8]";
|
||||
|
||||
public static String version;
|
||||
public static String autor;
|
||||
public static Integer spigotID = 90671;
|
||||
public static Integer bstatsID = 10840;
|
||||
public static String spigot = "https://www.spigotmc.org/resources/" + spigotID;
|
||||
public static String discord = "http://dc.t2code.net";
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// Plugin startup logic
|
||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||
plugin = this;
|
||||
autor = plugin.getDescription().getAuthor();
|
||||
version = plugin.getDescription().getVersion();
|
||||
if (pluginNotFound("T2CodeLib", 96388, Util.requiredT2CodeLibVersion)) return;
|
||||
Bsend.console(prefix + "§4============================= §8[§4Command§9GUI§5BUNGEE§8] §4=============================");
|
||||
Bsend.console(prefix + "§4 _____ §9_____ _ _ _____ §e ___ ");
|
||||
Bsend.console(prefix + "§4 / ____§9/ ____| | | |_ _|§e |__ \\ ");
|
||||
Bsend.console(prefix + "§4 | | §9| | __| | | | | |§e_ __ ) |");
|
||||
Bsend.console(prefix + "§4 | | §9| | |_ | | | | | §e\\ \\ / // / ");
|
||||
Bsend.console(prefix + "§4 | |___§9| |__| | |__| |_| |§e\\ V // /_ ");
|
||||
Bsend.console(prefix + "§4 \\_____§9\\_____|\\____/|_____§e\\_/|____|");
|
||||
Bsend.console(prefix);
|
||||
Bsend.console(prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
||||
Bsend.console(prefix + " §2Version: §6" + version);
|
||||
Bsend.console(prefix + " §2Spigot: §6" + spigot);
|
||||
Bsend.console(prefix + " §2Discord: §6" + discord);
|
||||
BConfig.create();
|
||||
|
||||
plugin.getProxy().registerChannel("cgui:bungee");
|
||||
plugin.getProxy().getPluginManager().registerListener(plugin, new BListener());
|
||||
BListener.sendToSpigotDeleteAll();
|
||||
BMetrics metrics = new BMetrics(this, bstatsID);
|
||||
|
||||
BMySQL.main();
|
||||
BMySQL.query("CREATE TABLE IF NOT EXISTS `gui-bungeeplayer` (" +
|
||||
" `UUID` VARCHAR(191) NOT NULL COLLATE 'utf8mb4_general_ci'," +
|
||||
" `Name` TINYTEXT NOT NULL COLLATE 'utf8mb4_general_ci'," +
|
||||
" `Online` TINYTEXT NOT NULL COLLATE 'utf8mb4_general_ci'," +
|
||||
" UNIQUE INDEX `UUID` (`UUID`)" +
|
||||
")" +
|
||||
"COLLATE='utf8mb4_general_ci'" +
|
||||
"ENGINE=InnoDB" +
|
||||
";");
|
||||
|
||||
Bsend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
Bsend.console(prefix + "§4==============================================================================");
|
||||
BUpdateChecker.onUpdateCheck();
|
||||
BUpdateChecker.onUpdateCheckTimer();
|
||||
enable = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
// Plugin shutdown logic
|
||||
if (!enable) {
|
||||
return;
|
||||
}
|
||||
Bsend.console(prefix + "§4============================= §8[§4Command§9GUI§5BUNGEE§8] §4=============================");
|
||||
Bsend.console(prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
||||
Bsend.console(prefix + " §2Version: §6" + version);
|
||||
Bsend.console(prefix + " §2Spigot: §6" + spigot);
|
||||
Bsend.console(prefix + " §2Discord: §6" + discord);
|
||||
Bsend.console(prefix + " §4Plugin successfully disabled.");
|
||||
Bsend.console(prefix + "§4==============================================================================");
|
||||
}
|
||||
|
||||
public static Boolean pluginNotFound(String pl, Integer spigotID, double ver) {
|
||||
|
||||
if (ProxyServer.getInstance().getPluginManager().getPlugin(pl) == null) {
|
||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||
ProxyServer.getInstance().getConsole().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
||||
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
||||
// BMain.plugin.getPluginLoader().disablePlugin(BMain.plugin);
|
||||
BMain.plugin.onDisable();
|
||||
return true;
|
||||
} else {
|
||||
if (Double.parseDouble(ProxyServer.getInstance().getPluginManager().getPlugin(pl).getDescription().getVersion()) < ver) {
|
||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||
ProxyServer.getInstance().getConsole().sendMessage(prefix + " §e" + pl + " §4is out of date! This plugin requires at least version §2" + ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to use this version of " + plugin.getDescription().getName() + ".");
|
||||
// BMain.plugin.getPluginLoader().disablePlugin(BMain.plugin);
|
||||
BMain.plugin.onDisable();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,857 @@
|
||||
package de.jatitv.commandguiv2.Bungee;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.md_5.bungee.config.Configuration;
|
||||
import net.md_5.bungee.config.ConfigurationProvider;
|
||||
import net.md_5.bungee.config.YamlConfiguration;
|
||||
|
||||
public class BMetrics {
|
||||
|
||||
private final Plugin plugin;
|
||||
|
||||
private final MetricsBase metricsBase;
|
||||
|
||||
private boolean enabled;
|
||||
|
||||
private String serverUUID;
|
||||
|
||||
private boolean logErrors = false;
|
||||
|
||||
private boolean logSentData;
|
||||
|
||||
private boolean logResponseStatusText;
|
||||
|
||||
/**
|
||||
* Creates a new Metrics instance.
|
||||
*
|
||||
* @param plugin Your plugin instance.
|
||||
* @param serviceId The id of the service. It can be found at <a
|
||||
* href="https://bstats.org/what-is-my-plugin-id">What is my plugin id?</a>
|
||||
*/
|
||||
public BMetrics(Plugin plugin, int serviceId) {
|
||||
this.plugin = plugin;
|
||||
try {
|
||||
loadConfig();
|
||||
} catch (IOException e) {
|
||||
// Failed to load configuration
|
||||
plugin.getLogger().log(Level.WARNING, "Failed to load bStats config!", e);
|
||||
metricsBase = null;
|
||||
return;
|
||||
}
|
||||
metricsBase =
|
||||
new MetricsBase(
|
||||
"bungeecord",
|
||||
serverUUID,
|
||||
serviceId,
|
||||
enabled,
|
||||
this::appendPlatformData,
|
||||
this::appendServiceData,
|
||||
null,
|
||||
() -> true,
|
||||
(message, error) -> this.plugin.getLogger().log(Level.WARNING, message, error),
|
||||
(message) -> this.plugin.getLogger().log(Level.INFO, message),
|
||||
logErrors,
|
||||
logSentData,
|
||||
logResponseStatusText);
|
||||
}
|
||||
|
||||
/** Loads the bStats configuration. */
|
||||
private void loadConfig() throws IOException {
|
||||
File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
|
||||
bStatsFolder.mkdirs();
|
||||
File configFile = new File(bStatsFolder, "config.yml");
|
||||
if (!configFile.exists()) {
|
||||
writeFile(
|
||||
configFile,
|
||||
"# bStats (https://bStats.org) collects some basic information for plugin authors, like how",
|
||||
"# many people use their plugin and their total player count. It's recommended to keep bStats",
|
||||
"# enabled, but if you're not comfortable with this, you can turn this setting off. There is no",
|
||||
"# performance penalty associated with having metrics enabled, and data sent to bStats is fully",
|
||||
"# anonymous.",
|
||||
"enabled: true",
|
||||
"serverUuid: \"" + UUID.randomUUID() + "\"",
|
||||
"logFailedRequests: false",
|
||||
"logSentData: false",
|
||||
"logResponseStatusText: false");
|
||||
}
|
||||
Configuration configuration =
|
||||
ConfigurationProvider.getProvider(YamlConfiguration.class).load(configFile);
|
||||
// Load configuration
|
||||
enabled = configuration.getBoolean("enabled", true);
|
||||
serverUUID = configuration.getString("serverUuid");
|
||||
logErrors = configuration.getBoolean("logFailedRequests", false);
|
||||
logSentData = configuration.getBoolean("logSentData", false);
|
||||
logResponseStatusText = configuration.getBoolean("logResponseStatusText", false);
|
||||
}
|
||||
|
||||
private void writeFile(File file, String... lines) throws IOException {
|
||||
try (BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file))) {
|
||||
for (String line : lines) {
|
||||
bufferedWriter.write(line);
|
||||
bufferedWriter.newLine();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a custom chart.
|
||||
*
|
||||
* @param chart The chart to add.
|
||||
*/
|
||||
public void addCustomChart(CustomChart chart) {
|
||||
metricsBase.addCustomChart(chart);
|
||||
}
|
||||
|
||||
private void appendPlatformData(JsonObjectBuilder builder) {
|
||||
builder.appendField("playerAmount", plugin.getProxy().getOnlineCount());
|
||||
builder.appendField("managedServers", plugin.getProxy().getServers().size());
|
||||
builder.appendField("onlineMode", plugin.getProxy().getConfig().isOnlineMode() ? 1 : 0);
|
||||
builder.appendField("bungeecordVersion", plugin.getProxy().getVersion());
|
||||
builder.appendField("javaVersion", System.getProperty("java.version"));
|
||||
builder.appendField("osName", System.getProperty("os.name"));
|
||||
builder.appendField("osArch", System.getProperty("os.arch"));
|
||||
builder.appendField("osVersion", System.getProperty("os.version"));
|
||||
builder.appendField("coreCount", Runtime.getRuntime().availableProcessors());
|
||||
}
|
||||
|
||||
private void appendServiceData(JsonObjectBuilder builder) {
|
||||
builder.appendField("pluginVersion", plugin.getDescription().getVersion());
|
||||
}
|
||||
|
||||
public static class MetricsBase {
|
||||
|
||||
/** The version of the Metrics class. */
|
||||
public static final String METRICS_VERSION = "2.2.1";
|
||||
|
||||
private static final ScheduledExecutorService scheduler =
|
||||
Executors.newScheduledThreadPool(1, task -> new Thread(task, "bStats-Metrics"));
|
||||
|
||||
private static final String REPORT_URL = "https://bStats.org/api/v2/data/%s";
|
||||
|
||||
private final String platform;
|
||||
|
||||
private final String serverUuid;
|
||||
|
||||
private final int serviceId;
|
||||
|
||||
private final Consumer<JsonObjectBuilder> appendPlatformDataConsumer;
|
||||
|
||||
private final Consumer<JsonObjectBuilder> appendServiceDataConsumer;
|
||||
|
||||
private final Consumer<Runnable> submitTaskConsumer;
|
||||
|
||||
private final Supplier<Boolean> checkServiceEnabledSupplier;
|
||||
|
||||
private final BiConsumer<String, Throwable> errorLogger;
|
||||
|
||||
private final Consumer<String> infoLogger;
|
||||
|
||||
private final boolean logErrors;
|
||||
|
||||
private final boolean logSentData;
|
||||
|
||||
private final boolean logResponseStatusText;
|
||||
|
||||
private final Set<CustomChart> customCharts = new HashSet<>();
|
||||
|
||||
private final boolean enabled;
|
||||
|
||||
/**
|
||||
* Creates a new MetricsBase class instance.
|
||||
*
|
||||
* @param platform The platform of the service.
|
||||
* @param serviceId The id of the service.
|
||||
* @param serverUuid The server uuid.
|
||||
* @param enabled Whether or not data sending is enabled.
|
||||
* @param appendPlatformDataConsumer A consumer that receives a {@code JsonObjectBuilder} and
|
||||
* appends all platform-specific data.
|
||||
* @param appendServiceDataConsumer A consumer that receives a {@code JsonObjectBuilder} and
|
||||
* appends all service-specific data.
|
||||
* @param submitTaskConsumer A consumer that takes a runnable with the submit task. This can be
|
||||
* used to delegate the data collection to a another thread to prevent errors caused by
|
||||
* concurrency. Can be {@code null}.
|
||||
* @param checkServiceEnabledSupplier A supplier to check if the service is still enabled.
|
||||
* @param errorLogger A consumer that accepts log message and an error.
|
||||
* @param infoLogger A consumer that accepts info log messages.
|
||||
* @param logErrors Whether or not errors should be logged.
|
||||
* @param logSentData Whether or not the sent data should be logged.
|
||||
* @param logResponseStatusText Whether or not the response status text should be logged.
|
||||
*/
|
||||
public MetricsBase(
|
||||
String platform,
|
||||
String serverUuid,
|
||||
int serviceId,
|
||||
boolean enabled,
|
||||
Consumer<JsonObjectBuilder> appendPlatformDataConsumer,
|
||||
Consumer<JsonObjectBuilder> appendServiceDataConsumer,
|
||||
Consumer<Runnable> submitTaskConsumer,
|
||||
Supplier<Boolean> checkServiceEnabledSupplier,
|
||||
BiConsumer<String, Throwable> errorLogger,
|
||||
Consumer<String> infoLogger,
|
||||
boolean logErrors,
|
||||
boolean logSentData,
|
||||
boolean logResponseStatusText) {
|
||||
this.platform = platform;
|
||||
this.serverUuid = serverUuid;
|
||||
this.serviceId = serviceId;
|
||||
this.enabled = enabled;
|
||||
this.appendPlatformDataConsumer = appendPlatformDataConsumer;
|
||||
this.appendServiceDataConsumer = appendServiceDataConsumer;
|
||||
this.submitTaskConsumer = submitTaskConsumer;
|
||||
this.checkServiceEnabledSupplier = checkServiceEnabledSupplier;
|
||||
this.errorLogger = errorLogger;
|
||||
this.infoLogger = infoLogger;
|
||||
this.logErrors = logErrors;
|
||||
this.logSentData = logSentData;
|
||||
this.logResponseStatusText = logResponseStatusText;
|
||||
checkRelocation();
|
||||
if (enabled) {
|
||||
startSubmitting();
|
||||
}
|
||||
}
|
||||
|
||||
public void addCustomChart(CustomChart chart) {
|
||||
this.customCharts.add(chart);
|
||||
}
|
||||
|
||||
private void startSubmitting() {
|
||||
final Runnable submitTask =
|
||||
() -> {
|
||||
if (!enabled || !checkServiceEnabledSupplier.get()) {
|
||||
// Submitting data or service is disabled
|
||||
scheduler.shutdown();
|
||||
return;
|
||||
}
|
||||
if (submitTaskConsumer != null) {
|
||||
submitTaskConsumer.accept(this::submitData);
|
||||
} else {
|
||||
this.submitData();
|
||||
}
|
||||
};
|
||||
// Many servers tend to restart at a fixed time at xx:00 which causes an uneven distribution
|
||||
// of requests on the
|
||||
// bStats backend. To circumvent this problem, we introduce some randomness into the initial
|
||||
// and second delay.
|
||||
// WARNING: You must not modify and part of this Metrics class, including the submit delay or
|
||||
// frequency!
|
||||
// WARNING: Modifying this code will get your plugin banned on bStats. Just don't do it!
|
||||
long initialDelay = (long) (1000 * 60 * (3 + Math.random() * 3));
|
||||
long secondDelay = (long) (1000 * 60 * (Math.random() * 30));
|
||||
scheduler.schedule(submitTask, initialDelay, TimeUnit.MILLISECONDS);
|
||||
scheduler.scheduleAtFixedRate(
|
||||
submitTask, initialDelay + secondDelay, 1000 * 60 * 30, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
private void submitData() {
|
||||
final JsonObjectBuilder baseJsonBuilder = new JsonObjectBuilder();
|
||||
appendPlatformDataConsumer.accept(baseJsonBuilder);
|
||||
final JsonObjectBuilder serviceJsonBuilder = new JsonObjectBuilder();
|
||||
appendServiceDataConsumer.accept(serviceJsonBuilder);
|
||||
JsonObjectBuilder.JsonObject[] chartData =
|
||||
customCharts.stream()
|
||||
.map(customChart -> customChart.getRequestJsonObject(errorLogger, logErrors))
|
||||
.filter(Objects::nonNull)
|
||||
.toArray(JsonObjectBuilder.JsonObject[]::new);
|
||||
serviceJsonBuilder.appendField("id", serviceId);
|
||||
serviceJsonBuilder.appendField("customCharts", chartData);
|
||||
baseJsonBuilder.appendField("service", serviceJsonBuilder.build());
|
||||
baseJsonBuilder.appendField("serverUUID", serverUuid);
|
||||
baseJsonBuilder.appendField("metricsVersion", METRICS_VERSION);
|
||||
JsonObjectBuilder.JsonObject data = baseJsonBuilder.build();
|
||||
scheduler.execute(
|
||||
() -> {
|
||||
try {
|
||||
// Send the data
|
||||
sendData(data);
|
||||
} catch (Exception e) {
|
||||
// Something went wrong! :(
|
||||
if (logErrors) {
|
||||
errorLogger.accept("Could not submit bStats metrics data", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sendData(JsonObjectBuilder.JsonObject data) throws Exception {
|
||||
if (logSentData) {
|
||||
infoLogger.accept("Sent bStats metrics data: " + data.toString());
|
||||
}
|
||||
String url = String.format(REPORT_URL, platform);
|
||||
HttpsURLConnection connection = (HttpsURLConnection) new URL(url).openConnection();
|
||||
// Compress the data to save bandwidth
|
||||
byte[] compressedData = compress(data.toString());
|
||||
connection.setRequestMethod("POST");
|
||||
connection.addRequestProperty("Accept", "application/json");
|
||||
connection.addRequestProperty("Connection", "close");
|
||||
connection.addRequestProperty("Content-Encoding", "gzip");
|
||||
connection.addRequestProperty("Content-Length", String.valueOf(compressedData.length));
|
||||
connection.setRequestProperty("Content-Type", "application/json");
|
||||
connection.setRequestProperty("User-Agent", "Metrics-Service/1");
|
||||
connection.setDoOutput(true);
|
||||
try (DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream())) {
|
||||
outputStream.write(compressedData);
|
||||
}
|
||||
StringBuilder builder = new StringBuilder();
|
||||
try (BufferedReader bufferedReader =
|
||||
new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
|
||||
String line;
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
builder.append(line);
|
||||
}
|
||||
}
|
||||
if (logResponseStatusText) {
|
||||
infoLogger.accept("Sent data to bStats and received response: " + builder);
|
||||
}
|
||||
}
|
||||
|
||||
/** Checks that the class was properly relocated. */
|
||||
private void checkRelocation() {
|
||||
// You can use the property to disable the check in your test environment
|
||||
if (System.getProperty("bstats.relocatecheck") == null
|
||||
|| !System.getProperty("bstats.relocatecheck").equals("false")) {
|
||||
// Maven's Relocate is clever and changes strings, too. So we have to use this little
|
||||
// "trick" ... :D
|
||||
final String defaultPackage =
|
||||
new String(new byte[] {'o', 'r', 'g', '.', 'b', 's', 't', 'a', 't', 's'});
|
||||
final String examplePackage =
|
||||
new String(new byte[] {'y', 'o', 'u', 'r', '.', 'p', 'a', 'c', 'k', 'a', 'g', 'e'});
|
||||
// We want to make sure no one just copy & pastes the example and uses the wrong package
|
||||
// names
|
||||
if (MetricsBase.class.getPackage().getName().startsWith(defaultPackage)
|
||||
|| MetricsBase.class.getPackage().getName().startsWith(examplePackage)) {
|
||||
throw new IllegalStateException("bStats Metrics class has not been relocated correctly!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gzips the given string.
|
||||
*
|
||||
* @param str The string to gzip.
|
||||
* @return The gzipped string.
|
||||
*/
|
||||
private static byte[] compress(final String str) throws IOException {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
try (GZIPOutputStream gzip = new GZIPOutputStream(outputStream)) {
|
||||
gzip.write(str.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static class AdvancedBarChart extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, int[]>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public AdvancedBarChart(String chartId, Callable<Map<String, int[]>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, int[]> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, int[]> entry : map.entrySet()) {
|
||||
if (entry.getValue().length == 0) {
|
||||
// Skip this invalid
|
||||
continue;
|
||||
}
|
||||
allSkipped = false;
|
||||
valuesBuilder.appendField(entry.getKey(), entry.getValue());
|
||||
}
|
||||
if (allSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class SimpleBarChart extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Integer>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public SimpleBarChart(String chartId, Callable<Map<String, Integer>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Integer> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||
valuesBuilder.appendField(entry.getKey(), new int[] {entry.getValue()});
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class MultiLineChart extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Integer>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public MultiLineChart(String chartId, Callable<Map<String, Integer>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Integer> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||
if (entry.getValue() == 0) {
|
||||
// Skip this invalid
|
||||
continue;
|
||||
}
|
||||
allSkipped = false;
|
||||
valuesBuilder.appendField(entry.getKey(), entry.getValue());
|
||||
}
|
||||
if (allSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class AdvancedPie extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Integer>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public AdvancedPie(String chartId, Callable<Map<String, Integer>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Integer> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||
if (entry.getValue() == 0) {
|
||||
// Skip this invalid
|
||||
continue;
|
||||
}
|
||||
allSkipped = false;
|
||||
valuesBuilder.appendField(entry.getKey(), entry.getValue());
|
||||
}
|
||||
if (allSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract static class CustomChart {
|
||||
|
||||
private final String chartId;
|
||||
|
||||
protected CustomChart(String chartId) {
|
||||
if (chartId == null) {
|
||||
throw new IllegalArgumentException("chartId must not be null");
|
||||
}
|
||||
this.chartId = chartId;
|
||||
}
|
||||
|
||||
public JsonObjectBuilder.JsonObject getRequestJsonObject(
|
||||
BiConsumer<String, Throwable> errorLogger, boolean logErrors) {
|
||||
JsonObjectBuilder builder = new JsonObjectBuilder();
|
||||
builder.appendField("chartId", chartId);
|
||||
try {
|
||||
JsonObjectBuilder.JsonObject data = getChartData();
|
||||
if (data == null) {
|
||||
// If the data is null we don't send the chart.
|
||||
return null;
|
||||
}
|
||||
builder.appendField("data", data);
|
||||
} catch (Throwable t) {
|
||||
if (logErrors) {
|
||||
errorLogger.accept("Failed to get data for custom chart with id " + chartId, t);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
protected abstract JsonObjectBuilder.JsonObject getChartData() throws Exception;
|
||||
}
|
||||
|
||||
public static class SingleLineChart extends CustomChart {
|
||||
|
||||
private final Callable<Integer> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public SingleLineChart(String chartId, Callable<Integer> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
int value = callable.call();
|
||||
if (value == 0) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("value", value).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class SimplePie extends CustomChart {
|
||||
|
||||
private final Callable<String> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public SimplePie(String chartId, Callable<String> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
String value = callable.call();
|
||||
if (value == null || value.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("value", value).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class DrilldownPie extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Map<String, Integer>>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public DrilldownPie(String chartId, Callable<Map<String, Map<String, Integer>>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Map<String, Integer>> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean reallyAllSkipped = true;
|
||||
for (Map.Entry<String, Map<String, Integer>> entryValues : map.entrySet()) {
|
||||
JsonObjectBuilder valueBuilder = new JsonObjectBuilder();
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, Integer> valueEntry : map.get(entryValues.getKey()).entrySet()) {
|
||||
valueBuilder.appendField(valueEntry.getKey(), valueEntry.getValue());
|
||||
allSkipped = false;
|
||||
}
|
||||
if (!allSkipped) {
|
||||
reallyAllSkipped = false;
|
||||
valuesBuilder.appendField(entryValues.getKey(), valueBuilder.build());
|
||||
}
|
||||
}
|
||||
if (reallyAllSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An extremely simple JSON builder.
|
||||
*
|
||||
* <p>While this class is neither feature-rich nor the most performant one, it's sufficient enough
|
||||
* for its use-case.
|
||||
*/
|
||||
public static class JsonObjectBuilder {
|
||||
|
||||
private StringBuilder builder = new StringBuilder();
|
||||
|
||||
private boolean hasAtLeastOneField = false;
|
||||
|
||||
public JsonObjectBuilder() {
|
||||
builder.append("{");
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a null field to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendNull(String key) {
|
||||
appendFieldUnescaped(key, "null");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a string field to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param value The value of the field.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, String value) {
|
||||
if (value == null) {
|
||||
throw new IllegalArgumentException("JSON value must not be null");
|
||||
}
|
||||
appendFieldUnescaped(key, "\"" + escape(value) + "\"");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an integer field to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param value The value of the field.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, int value) {
|
||||
appendFieldUnescaped(key, String.valueOf(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an object to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param object The object.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, JsonObject object) {
|
||||
if (object == null) {
|
||||
throw new IllegalArgumentException("JSON object must not be null");
|
||||
}
|
||||
appendFieldUnescaped(key, object.toString());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a string array to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param values The string array.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, String[] values) {
|
||||
if (values == null) {
|
||||
throw new IllegalArgumentException("JSON values must not be null");
|
||||
}
|
||||
String escapedValues =
|
||||
Arrays.stream(values)
|
||||
.map(value -> "\"" + escape(value) + "\"")
|
||||
.collect(Collectors.joining(","));
|
||||
appendFieldUnescaped(key, "[" + escapedValues + "]");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an integer array to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param values The integer array.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, int[] values) {
|
||||
if (values == null) {
|
||||
throw new IllegalArgumentException("JSON values must not be null");
|
||||
}
|
||||
String escapedValues =
|
||||
Arrays.stream(values).mapToObj(String::valueOf).collect(Collectors.joining(","));
|
||||
appendFieldUnescaped(key, "[" + escapedValues + "]");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an object array to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param values The integer array.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, JsonObject[] values) {
|
||||
if (values == null) {
|
||||
throw new IllegalArgumentException("JSON values must not be null");
|
||||
}
|
||||
String escapedValues =
|
||||
Arrays.stream(values).map(JsonObject::toString).collect(Collectors.joining(","));
|
||||
appendFieldUnescaped(key, "[" + escapedValues + "]");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a field to the object.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param escapedValue The escaped value of the field.
|
||||
*/
|
||||
private void appendFieldUnescaped(String key, String escapedValue) {
|
||||
if (builder == null) {
|
||||
throw new IllegalStateException("JSON has already been built");
|
||||
}
|
||||
if (key == null) {
|
||||
throw new IllegalArgumentException("JSON key must not be null");
|
||||
}
|
||||
if (hasAtLeastOneField) {
|
||||
builder.append(",");
|
||||
}
|
||||
builder.append("\"").append(escape(key)).append("\":").append(escapedValue);
|
||||
hasAtLeastOneField = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the JSON string and invalidates this builder.
|
||||
*
|
||||
* @return The built JSON string.
|
||||
*/
|
||||
public JsonObject build() {
|
||||
if (builder == null) {
|
||||
throw new IllegalStateException("JSON has already been built");
|
||||
}
|
||||
JsonObject object = new JsonObject(builder.append("}").toString());
|
||||
builder = null;
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes the given string like stated in https://www.ietf.org/rfc/rfc4627.txt.
|
||||
*
|
||||
* <p>This method escapes only the necessary characters '"', '\'. and '\u0000' - '\u001F'.
|
||||
* Compact escapes are not used (e.g., '\n' is escaped as "\u000a" and not as "\n").
|
||||
*
|
||||
* @param value The value to escape.
|
||||
* @return The escaped value.
|
||||
*/
|
||||
private static String escape(String value) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
char c = value.charAt(i);
|
||||
if (c == '"') {
|
||||
builder.append("\\\"");
|
||||
} else if (c == '\\') {
|
||||
builder.append("\\\\");
|
||||
} else if (c <= '\u000F') {
|
||||
builder.append("\\u000").append(Integer.toHexString(c));
|
||||
} else if (c <= '\u001F') {
|
||||
builder.append("\\u00").append(Integer.toHexString(c));
|
||||
} else {
|
||||
builder.append(c);
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* A super simple representation of a JSON object.
|
||||
*
|
||||
* <p>This class only exists to make methods of the {@link JsonObjectBuilder} type-safe and not
|
||||
* allow a raw string inputs for methods like {@link JsonObjectBuilder#appendField(String,
|
||||
* JsonObject)}.
|
||||
*/
|
||||
public static class JsonObject {
|
||||
|
||||
private final String value;
|
||||
|
||||
private JsonObject(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package de.jatitv.commandguiv2.Bungee;
|
||||
|
||||
|
||||
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
||||
|
||||
import java.sql.*;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class BMySQL {
|
||||
private static Plugin plugin = BMain.plugin;
|
||||
protected static String ip = "localhost";
|
||||
protected static Integer port = 3306;
|
||||
protected static String database;
|
||||
protected static String user = "root";
|
||||
protected static String password = "";
|
||||
protected static String url;
|
||||
protected static Boolean SSL;
|
||||
|
||||
public static void main() {
|
||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||
Calendar now = Calendar.getInstance();
|
||||
ZoneId timeZone = now.getTimeZone().toZoneId();
|
||||
Bsend.debug(plugin, "Server TimeZone is : " + timeZone);
|
||||
url = "jdbc:mysql://" + ip + ":" + port + "/" + database + "?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=" + timeZone;
|
||||
// Europe/Berlin
|
||||
if (SSL) {
|
||||
url = url + "&useSSL=true";
|
||||
} else url = url + "&useSSL=false";
|
||||
Bsend.debug(plugin, url);
|
||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
||||
Statement stmt = con.createStatement();
|
||||
stmt.close();
|
||||
Bsend.console(BMain.prefix + " §2MySQL successfully connected." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
} catch (SQLException ex) {
|
||||
Bsend.console(BMain.prefix + " §4MySQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
Bsend.error(plugin, ex.getMessage() + " --- " + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
}
|
||||
}
|
||||
|
||||
public static void query(String query) {
|
||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
||||
Statement stmt = con.createStatement();
|
||||
stmt.execute(query);
|
||||
stmt.close();
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static ArrayList<String> selectAll(String query) {
|
||||
ArrayList<String> Result = new ArrayList<>();
|
||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
||||
Statement stmt = con.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(query);
|
||||
int columns = rs.getMetaData().getColumnCount();
|
||||
while (rs.next()) {
|
||||
Result.add(rs.getString(1));
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
public static String select(String query) {
|
||||
String Ausgabe = "";
|
||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
||||
Statement stmt = con.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(query);
|
||||
int columns = rs.getMetaData().getColumnCount();
|
||||
while (rs.next()) {
|
||||
Ausgabe = String.valueOf(rs.getString(1));
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
return Ausgabe;
|
||||
}
|
||||
|
||||
public static int count(String query) {
|
||||
Integer count = 0;
|
||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
||||
Statement stmt = con.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(query);
|
||||
int columns = rs.getMetaData().getColumnCount();
|
||||
while (rs.next()) {
|
||||
count++;
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
// -----------------------------
|
||||
// _____ _____ _ _ _____
|
||||
// / ____/ ____| | | |_ _|
|
||||
// | | | | __| | | | | |
|
||||
// | | | | |_ | | | | | |
|
||||
// | |___| |__| | |__| |_| |_
|
||||
// \_____\_____|\____/|_____|
|
||||
// -----------------------------
|
||||
|
||||
package de.jatitv.commandguiv2.Bungee;
|
||||
|
||||
import net.md_5.bungee.api.ProxyServer;
|
||||
import net.md_5.bungee.api.plugin.Plugin;
|
||||
import net.t2code.lib.Bungee.Lib.messages.Bsend;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.util.Scanner;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class BUpdateChecker {
|
||||
|
||||
public static void sendUpdateMsg(String Prefix, String foundVersion, String update_version) {
|
||||
Bsend.console("§4=========== " + Prefix + " §4===========");
|
||||
Bsend.console("§6A new version was found!");
|
||||
Bsend.console("§6Your version: §c" + foundVersion + " §7- §6Current version: §a" + update_version+"_Bungee");
|
||||
Bsend.console("§6You can download it here: §e" + BMain.spigot);
|
||||
Bsend.console("§6You can find more information on Discord: §e" + BMain.discord);
|
||||
Bsend.console("§4=========== " + Prefix + " §4===========");
|
||||
}
|
||||
|
||||
|
||||
public static void onUpdateCheckTimer() {
|
||||
ProxyServer.getInstance().getScheduler().schedule(BMain.plugin, new Runnable() {
|
||||
public void run() {
|
||||
(new BUpdateChecker(BMain.plugin, BMain.spigotID)).getVersion((update_version) -> {
|
||||
String foundVersion = BMain.plugin.getDescription().getVersion();
|
||||
BMain.update_version = update_version;
|
||||
if (!foundVersion.replace("_Bungee", "").equalsIgnoreCase(update_version)) {
|
||||
sendUpdateMsg(BMain.prefix, foundVersion, update_version);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 0, 20 * 60 * 60L, TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
public static void onUpdateCheck() {
|
||||
(new BUpdateChecker(BMain.plugin, BMain.spigotID)).getVersion((update_version) -> {
|
||||
String foundVersion = BMain.plugin.getDescription().getVersion();
|
||||
BMain.update_version = update_version;
|
||||
if (foundVersion.replace("_Bungee", "").equalsIgnoreCase(update_version)) {
|
||||
Bsend.console(BMain.prefix + " §2No update found.");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private Plugin plugin;
|
||||
private int resourceId;
|
||||
|
||||
public BUpdateChecker(Plugin plugin, int resourceId) {
|
||||
this.plugin = plugin;
|
||||
this.resourceId = resourceId;
|
||||
}
|
||||
|
||||
public void getVersion(Consumer<String> consumer) {
|
||||
ProxyServer.getInstance().getScheduler().runAsync(this.plugin, () -> {
|
||||
try {
|
||||
InputStream inputStream = (new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.resourceId)).openStream();
|
||||
try {
|
||||
Scanner scanner = new Scanner(inputStream);
|
||||
|
||||
try {
|
||||
if (scanner.hasNext()) {
|
||||
consumer.accept(scanner.next());
|
||||
}
|
||||
} catch (Throwable var8) {
|
||||
try {
|
||||
scanner.close();
|
||||
} catch (Throwable var7) {
|
||||
var8.addSuppressed(var7);
|
||||
}
|
||||
throw var8;
|
||||
}
|
||||
scanner.close();
|
||||
} catch (Throwable var9) {
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (Throwable var6) {
|
||||
var9.addSuppressed(var6);
|
||||
}
|
||||
}
|
||||
throw var9;
|
||||
}
|
||||
if (inputStream != null) {
|
||||
inputStream.close();
|
||||
}
|
||||
} catch (IOException var10) {
|
||||
this.plugin.getLogger().severe(BMain.prefix + "§4 Cannot look for updates: " + var10.getMessage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Slot;
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class ConfigChat implements Listener {
|
||||
public static HashMap<Player, String> EditChat = new HashMap<>();
|
||||
|
||||
@EventHandler
|
||||
public void onChat(AsyncPlayerChatEvent playerChatEvent) {
|
||||
Player player = playerChatEvent.getPlayer();
|
||||
if (EditChat.containsKey(player)) {
|
||||
if (playerChatEvent.getMessage().equals("cancel")) {
|
||||
//player.sendMessage(DefaultValue.SettingsGUIchatIsCanceled.replace("[setting]", EditChat.get(player)));
|
||||
} else {
|
||||
for (Object gui : Main.guiHashMap.values()) {
|
||||
for (Slot slot : gui.GUI_Slots) {
|
||||
if (slot.ConfigOptionPath.equals(EditChat.get(player))) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,396 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Slot;
|
||||
import de.jatitv.commandguiv2.Spigot.system.Bungee_Sender_Reciver;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||
import net.t2code.lib.Spigot.Lib.vault.Vault;
|
||||
import net.t2code.lib.Util;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class GUI_Listener implements Listener {
|
||||
|
||||
private static String prefix = Util.Prefix;
|
||||
public static String GUICode;
|
||||
private static Plugin plugin = Main.plugin;
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryClick(InventoryClickEvent e) {
|
||||
Player player = (Player) e.getWhoClicked();
|
||||
if (e.getInventory() != null && e.getCurrentItem() != null) {
|
||||
for (Object gui : Main.guiHashMap.values()) {
|
||||
if (player.getOpenInventory().getTitle().equals(Replace.replace(prefix, GUICode + gui.GUI_Name))
|
||||
|| (Main.PaPi && player.getOpenInventory().getTitle().equals(Replace.replace(prefix, player, GUICode + gui.GUI_Name)))) {
|
||||
e.setCancelled(true);
|
||||
for (Slot slot : gui.GUI_Slots) {
|
||||
/* if (!slot.ItemsRemovable) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
*/
|
||||
|
||||
if (e.getSlot() == slot.Slot) {
|
||||
|
||||
if (!slot.Perm || player.hasPermission("commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1))
|
||||
|| player.hasPermission("commandgui.admin")) {
|
||||
|
||||
if (slot.Enable) {
|
||||
if (e.getCurrentItem().getItemMeta().getDisplayName().equals(Replace.replace(prefix, slot.Name))) {
|
||||
if (e.getCurrentItem().getType() == ItemVersion.Head || e.getCurrentItem().getType() == Material.valueOf(slot.Item.toUpperCase().replace(".", "_"))) {
|
||||
if (slot.Cost_Enable) {
|
||||
if (slot.Command_Enable || slot.Message_Enable || slot.OpenGUI_Enable || slot.ServerChange) {
|
||||
if (Vault.buy(prefix, player, slot.Price)) {
|
||||
player.sendMessage(SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, slot.Name))
|
||||
.replace("[price]", slot.Price + " " + SelectConfig.Currency));
|
||||
if (slot.Command_Enable) {
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (slot.Command_BungeeCommand && SelectConfig.Bungee) {
|
||||
for (String cmd : slot.Command) {
|
||||
Bungee_Sender_Reciver.sendToBungee(player, player.getName(), cmd.replace("[player]", player.getName()));
|
||||
}
|
||||
} else {
|
||||
if (slot.CommandAsConsole) {
|
||||
for (String cmd : slot.Command) {
|
||||
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), cmd.replace("[player]", player.getName()));
|
||||
}
|
||||
} else {
|
||||
for (String cmd : slot.Command) {
|
||||
player.chat("/" + cmd.replace("[player]", player.getName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskLater(plugin, 2L);
|
||||
}
|
||||
if (slot.OpenGUI_Enable) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
OpenGUI.openGUI(player, Main.guiHashMap.get(slot.OpenGUI), slot.OpenGUI);
|
||||
}
|
||||
}.runTaskLater(plugin, 2L);
|
||||
}
|
||||
if (slot.Message_Enable) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
|
||||
for (String msg : slot.Message) {
|
||||
if (Main.PaPi) {
|
||||
player.sendMessage(Replace.replacePrice(prefix, player, msg, slot.Price + " " + SelectConfig.Currency));
|
||||
} else
|
||||
player.sendMessage(Replace.replacePrice(prefix, msg, slot.Price + " " + SelectConfig.Currency));
|
||||
}
|
||||
}
|
||||
if (slot.ServerChange) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
|
||||
send.player(player, SelectMessages.onServerChange.replace("[server]", slot.ServerChangeServer));
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ServerChange.send(player, slot.ServerChangeServer);
|
||||
}
|
||||
}.runTaskLater(Main.plugin, 20L);
|
||||
}
|
||||
if (slot.SetConfigEnable) {
|
||||
File config = new File(slot.ConfigFilePath);
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
/*if (slot.ConfigChatInput){
|
||||
ConfigChat.EditChat.put(player, slot.ConfigOptionPath);
|
||||
player.sendMessage(DefaultValue.SettingsGUIchatSet.replace("[setting]", "Shop Name Chest small"));
|
||||
player.sendMessage(DefaultValue.SettingsGUIchatCancel);
|
||||
} else
|
||||
{
|
||||
*/
|
||||
if (e.isLeftClick()) {
|
||||
if (slot.ConfigOptionPremat.equals("String")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueLeft);
|
||||
} else if (slot.ConfigOptionPremat.equals("Boolean")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigBooleanValueLeft);
|
||||
} else if (slot.ConfigOptionPremat.equals("Integer")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigIntegerValueLeft);
|
||||
} else if (slot.ConfigOptionPremat.equals("Double")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigDoubleValueLeft);
|
||||
} else if (slot.ConfigOptionPremat.equals("List")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigListValueLeft);
|
||||
} else {
|
||||
player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||
}
|
||||
}
|
||||
if (e.isRightClick()) {
|
||||
if (slot.ConfigOptionPremat.equals("String")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueRight);
|
||||
} else if (slot.ConfigOptionPremat.equals("Boolean")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigBooleanValueRight);
|
||||
} else if (slot.ConfigOptionPremat.equals("Integer")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigIntegerValueRight);
|
||||
} else if (slot.ConfigOptionPremat.equals("Double")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigDoubleValueRight);
|
||||
} else if (slot.ConfigOptionPremat.equals("List")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigListValueRight);
|
||||
} else {
|
||||
player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||
}
|
||||
}
|
||||
try {
|
||||
yamlConfiguration.save(config);
|
||||
} catch (IOException tac) {
|
||||
tac.printStackTrace();
|
||||
}
|
||||
if (slot.PluginReloadEnable) {
|
||||
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), slot.PluginReloadCommand);
|
||||
}
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
}
|
||||
|
||||
if (SelectConfig.Sound_Enable && SelectConfig.Sound_Click_Enable) {
|
||||
if (slot.CustomSound_Enable) {
|
||||
if (!slot.CustomSound_NoSound) {
|
||||
try {
|
||||
player.playSound(player.getLocation(), Sound.valueOf(slot.CustomSound_Sound.toUpperCase().replace(".", "_")), 3, 1);
|
||||
|
||||
} catch (Exception e1) {
|
||||
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", prefix)
|
||||
.replace("[sound]", "§6GUI: §e" + Replace.replace(prefix, gui.GUI_Name) + "§r §6Slot: §e" + slot.Slot + " §6CustomSound: §9" + slot.CustomSound_Sound));
|
||||
player.playSound(player.getLocation(), SelectConfig.Sound_Click, 3, 1);
|
||||
}
|
||||
}
|
||||
} else
|
||||
player.playSound(player.getLocation(), SelectConfig.Sound_Click, 3, 1);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
|
||||
player.sendMessage(SelectMessages.No_money);
|
||||
if (SelectConfig.Sound_NoMoney_Enable && SelectConfig.Sound_Enable) {
|
||||
player.playSound(player.getLocation(), SelectConfig.Sound_NoMoney, 3, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (slot.Command_Enable) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (slot.Command_BungeeCommand) {
|
||||
if (SelectConfig.Bungee) {
|
||||
for (String cmd : slot.Command) {
|
||||
Bungee_Sender_Reciver.sendToBungee(player, player.getName(), cmd.replace("[player]", player.getName()));
|
||||
}
|
||||
} else {
|
||||
send.console(prefix + " §4To use bungee commands, enable the Bungee option in the config.");
|
||||
send.player(player, prefix + " §4To use bungee commands, enable the Bungee option in the config.");
|
||||
}
|
||||
|
||||
} else {
|
||||
if (slot.CommandAsConsole) {
|
||||
for (String cmd : slot.Command) {
|
||||
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), cmd.replace("[player]", player.getName()));
|
||||
}
|
||||
} else {
|
||||
for (String cmd : slot.Command) {
|
||||
player.chat("/" + cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskLater(plugin, 2L);
|
||||
}
|
||||
if (slot.OpenGUI_Enable) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
OpenGUI.openGUI(player, Main.guiHashMap.get(slot.OpenGUI), slot.OpenGUI);
|
||||
}
|
||||
}.runTaskLater(plugin, 2L);
|
||||
}
|
||||
if (slot.Message_Enable) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
|
||||
|
||||
for (String msg : slot.Message) {
|
||||
if (Main.PaPi) {
|
||||
player.sendMessage(Replace.replace(prefix, player, msg.replace("[prefix]", prefix)));
|
||||
} else
|
||||
player.sendMessage(Replace.replace(prefix, msg.replace("[prefix]", prefix)));
|
||||
}
|
||||
}
|
||||
if (slot.ServerChange) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
|
||||
send.player(player, SelectMessages.onServerChange.replace("[server]", slot.ServerChangeServer));
|
||||
|
||||
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ServerChange.send(player, slot.ServerChangeServer);
|
||||
}
|
||||
}.runTaskLater(Main.plugin, 20L);
|
||||
}
|
||||
if (slot.SetConfigEnable) {
|
||||
File config = new File(slot.ConfigFilePath);
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
/*if (slot.ConfigChatInput){
|
||||
ConfigChat.EditChat.put(player, slot.ConfigOptionPath);
|
||||
player.sendMessage(DefaultValue.SettingsGUIchatSet.replace("[setting]", "Shop Name Chest small"));
|
||||
player.sendMessage(DefaultValue.SettingsGUIchatCancel);
|
||||
} else
|
||||
{
|
||||
*/
|
||||
if (e.isLeftClick()) {
|
||||
if (slot.ConfigOptionPremat.equals("String")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueLeft);
|
||||
} else if (slot.ConfigOptionPremat.equals("Boolean")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigBooleanValueLeft);
|
||||
} else if (slot.ConfigOptionPremat.equals("Integer")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigIntegerValueLeft);
|
||||
} else if (slot.ConfigOptionPremat.equals("Double")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigDoubleValueLeft);
|
||||
} else if (slot.ConfigOptionPremat.equals("List")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigListValueLeft);
|
||||
} else {
|
||||
player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||
}
|
||||
}
|
||||
if (e.isRightClick()) {
|
||||
if (slot.ConfigOptionPremat.equals("String")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigStringValueRight);
|
||||
} else if (slot.ConfigOptionPremat.equals("Boolean")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigBooleanValueRight);
|
||||
} else if (slot.ConfigOptionPremat.equals("Integer")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigIntegerValueRight);
|
||||
} else if (slot.ConfigOptionPremat.equals("Double")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigDoubleValueRight);
|
||||
} else if (slot.ConfigOptionPremat.equals("List")) {
|
||||
yamlConfiguration.set(slot.ConfigOptionPath.replace("/", "."), slot.ConfigListValueRight);
|
||||
} else {
|
||||
player.sendMessage("§cCheck the Option §6SetConfig/Option/Premat"); //todo
|
||||
}
|
||||
}
|
||||
try {
|
||||
yamlConfiguration.save(config);
|
||||
} catch (IOException tac) {
|
||||
tac.printStackTrace();
|
||||
}
|
||||
if (slot.PluginReloadEnable) {
|
||||
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), slot.PluginReloadCommand);
|
||||
}
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
player.closeInventory();
|
||||
}
|
||||
}.runTaskLater(plugin, 1L);
|
||||
}
|
||||
if (SelectConfig.Sound_Enable && SelectConfig.Sound_Click_Enable) {
|
||||
if (slot.CustomSound_Enable) {
|
||||
if (!slot.CustomSound_NoSound) {
|
||||
try {
|
||||
player.playSound(player.getLocation(), Sound.valueOf(slot.CustomSound_Sound.toUpperCase().replace(".", "_")), 3, 1);
|
||||
|
||||
} catch (Exception e1) {
|
||||
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", prefix)
|
||||
.replace("[sound]", "§6GUI: §e" + Replace.replace(prefix, gui.GUI_Name) + "§r §6Slot: §e" + slot.Slot + " §6CustomSound: §9" + slot.CustomSound_Sound));
|
||||
player.playSound(player.getLocation(), SelectConfig.Sound_Click, 3, 1);
|
||||
}
|
||||
}
|
||||
} else
|
||||
player.playSound(player.getLocation(), SelectConfig.Sound_Click, 3, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
player.sendMessage(SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, slot.Name))
|
||||
.replace("[perm]", "commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,95 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.system.Give_UseItem;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class ItemChange {
|
||||
public static void itemChange(Player player) {
|
||||
Integer slot;
|
||||
if (Select_Database.selectSlot(player) == null) {
|
||||
slot = SelectConfig.UseItem_InventorySlot;
|
||||
} else {
|
||||
slot = Select_Database.selectSlot(player);
|
||||
}
|
||||
if (!SelectConfig.UseItem_Enable) {
|
||||
return;
|
||||
}
|
||||
if (SelectConfig.UseItem_GiveOnlyOnFirstJoin) {
|
||||
if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
|
||||
if (!player.hasPlayedBefore()) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Give_UseItem.onGive(player);
|
||||
}
|
||||
}.runTaskLater(Main.plugin, 1L * 1);
|
||||
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin || SelectConfig.Cursor_ToGUIItem_OnLogin) {
|
||||
player.getInventory().setHeldItemSlot(slot - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (SelectConfig.UseItem_GiveOnEveryJoin) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
||||
ItemStack itm = player.getInventory().getItem(iam);
|
||||
if (itm != null) {
|
||||
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
|
||||
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
player.getInventory().remove(itm);
|
||||
player.updateInventory();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
|
||||
if (SelectConfig.UseItem_InventorySlotEnforce || player.getInventory().getItem(slot - 1) == null) {
|
||||
Give_UseItem.onGive(player);
|
||||
if (SelectConfig.Cursor_ToGUIItem_OnLogin) {
|
||||
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin) {
|
||||
if (!player.hasPlayedBefore()) {
|
||||
player.getInventory().setHeldItemSlot(slot - 1);
|
||||
}
|
||||
} else {
|
||||
if (SelectConfig.Bungee) {
|
||||
if (SelectConfig.UseItem_ServerChange) {
|
||||
player.getInventory().setHeldItemSlot(slot - 1);
|
||||
} else {
|
||||
if (Main.bungeejoinplayers.contains(player.getName())) {
|
||||
player.getInventory().setHeldItemSlot(slot - 1);
|
||||
Main.bungeejoinplayers.remove(player.getName());
|
||||
}
|
||||
}
|
||||
} else player.getInventory().setHeldItemSlot(slot - 1);
|
||||
}
|
||||
}
|
||||
} else if (SelectConfig.UseItem_InventorySlot_FreeSlot) {
|
||||
boolean empty = false;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
if (player.getInventory().getItem(i) == null) {
|
||||
empty = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (empty) {
|
||||
Give_UseItem.onGiveADD(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskLater(Main.plugin, 1L * 1);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerLoginEvent;
|
||||
import org.bukkit.event.server.ServerCommandEvent;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
public class PluginEvent implements Listener {
|
||||
private static String prefix = Main.prefix;
|
||||
|
||||
@EventHandler
|
||||
public void onJoinEvent(PlayerLoginEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
Select_Database.nameCheck(player);
|
||||
UpdateAPI.join(Main.plugin,prefix, "commandgui.updatemsg", event.getPlayer(), Main.spigot, Main.discord);
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onClearServer(ServerCommandEvent event) {
|
||||
if (SelectConfig.UseItem_KeepAtCommandClear) {
|
||||
if (event.getCommand().contains("clear " + event.getCommand().replace("/", "").replace("clear ", ""))) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Player player = Bukkit.getPlayer(event.getCommand().replace("/", "").replace("clear ", ""));
|
||||
if (player == null){
|
||||
return;
|
||||
}
|
||||
clearGive(player);
|
||||
} catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}.runTaskLater(Main.plugin, 1L);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onClearPlayer(PlayerCommandPreprocessEvent event) {
|
||||
if (SelectConfig.UseItem_KeepAtCommandClear) {
|
||||
if (event.getMessage().toLowerCase().contains("clear")) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
clearGive(event.getPlayer());
|
||||
}
|
||||
}.runTaskLater(Main.plugin, 1L);
|
||||
}
|
||||
if (event.getMessage().toLowerCase().contains("clear " + event.getMessage().toLowerCase().replace("/", "").replace("clear ", ""))) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
clearGive(Bukkit.getPlayer(event.getMessage().toLowerCase().replace("/", "").replace("clear ", "")));
|
||||
}
|
||||
}.runTaskLater(Main.plugin, 1L);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void clearGive(Player player) {
|
||||
ItemChange.itemChange(player);
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Listener;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ServerChange {
|
||||
|
||||
public static void send(Player player, String server){
|
||||
ByteArrayOutputStream b = new ByteArrayOutputStream();
|
||||
DataOutputStream out = new DataOutputStream(b);
|
||||
try {
|
||||
out.writeUTF("Connect");
|
||||
out.writeUTF(server);
|
||||
} catch (IOException i) {
|
||||
i.printStackTrace();
|
||||
}
|
||||
player.sendPluginMessage(Main.plugin, "BungeeCord", b.toByteArray());
|
||||
}
|
||||
}
|
@ -0,0 +1,271 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Listener.ItemChange;
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
|
||||
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
||||
import de.jatitv.commandguiv2.api.CGuiAPI;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryDragEvent;
|
||||
import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||
import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||
import org.bukkit.event.player.*;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class Events implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onJoin(PlayerJoinEvent e) {
|
||||
if (CGuiAPI.JoinDisable) return;
|
||||
if (e.getPlayer().hasPermission("commandgui.get.guiitem.at.login")) {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ItemChange.itemChange(e.getPlayer());
|
||||
}
|
||||
}.runTaskLater(Main.plugin, 20L * 1);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onDeathDrop(PlayerDeathEvent e) {
|
||||
Player player = e.getEntity().getPlayer();
|
||||
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
||||
ItemStack itm = player.getInventory().getItem(iam);
|
||||
if (itm != null) {
|
||||
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
|
||||
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
player.getInventory().remove(itm);
|
||||
player.updateInventory();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!e.getDrops().isEmpty()) {
|
||||
Iterator var3 = (new ArrayList(e.getDrops())).iterator();
|
||||
while (var3.hasNext()) {
|
||||
ItemStack items = (ItemStack) var3.next();
|
||||
if (items != null && items.hasItemMeta() && items.getItemMeta().hasDisplayName()
|
||||
&& items.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
e.getDrops().remove(items);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onRespawn(PlayerRespawnEvent e) {
|
||||
Player player = e.getPlayer();
|
||||
if (SelectConfig.UseItem_Enable) {
|
||||
ItemChange.itemChange(player);
|
||||
//if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
|
||||
// if (SelectConfig.UseItem_GiveOnlyOnFirstJoin) {
|
||||
// if (!player.hasPlayedBefore()) {
|
||||
// new BukkitRunnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// Give_UseItem.onGive(player);
|
||||
// }
|
||||
// }.runTaskLater(Main.plugin, 20L * 1);
|
||||
// }
|
||||
// } else {
|
||||
// new BukkitRunnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// Give_UseItem.onGive(player);
|
||||
// }
|
||||
// }.runTaskLater(Main.plugin, 20L * 1);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onGameModeChange(PlayerGameModeChangeEvent e) {
|
||||
Player player = e.getPlayer();
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (SelectConfig.UseItemGameModeChangeDisableInSpectator) {
|
||||
if (player.getGameMode() != GameMode.SPECTATOR) {
|
||||
ItemChange.itemChange(player);
|
||||
return;
|
||||
}
|
||||
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
||||
ItemStack itm = player.getInventory().getItem(iam);
|
||||
if (itm != null) {
|
||||
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
|
||||
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
player.getInventory().remove(itm);
|
||||
player.updateInventory();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else ItemChange.itemChange(player);
|
||||
}
|
||||
}.runTaskLater(Main.plugin, 1L);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onInteract(PlayerInteractEvent e) {
|
||||
Player p = e.getPlayer();
|
||||
if (SelectConfig.UseItem_Enable) {
|
||||
if (SelectConfig.UseItem_PlayerHead_Enable) {
|
||||
if (e.getItem() != null && p.getItemInHand().getType() == ItemVersion.Head) {
|
||||
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
e.setCancelled(true);
|
||||
if (p.isSneaking()) {
|
||||
Commands.info(p);
|
||||
return;
|
||||
}
|
||||
if (!legacy()) {
|
||||
if (!topInventoryIsEmpty(p)) return;
|
||||
}
|
||||
if (!SelectConfig.UseItem_Permission || p.hasPermission("commandgui.useitem")) {
|
||||
OpenGUI.openGUI(p, Main.guiHashMap.get(SelectConfig.UseItem_OpenGUI), SelectConfig.UseItem_OpenGUI);
|
||||
if (SelectConfig.Sound_Enable && SelectConfig.Sound_OpenInventory_Enable) {
|
||||
p.playSound(p.getLocation(), SelectConfig.Sound_OpenInventory, 3, 1);
|
||||
}
|
||||
} else {
|
||||
p.sendMessage(SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
||||
.replace("[gui]", SelectConfig.UseItem_OpenGUI));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (e.getItem() != null && p.getItemInHand().getType() == Material.valueOf(SelectConfig.UseItem_Material)) {
|
||||
if (e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
e.setCancelled(true);
|
||||
if (p.isSneaking()) {
|
||||
Commands.info(p);
|
||||
return;
|
||||
}
|
||||
if (!legacy()) {
|
||||
if (!topInventoryIsEmpty(p)) return;
|
||||
}
|
||||
if (!SelectConfig.UseItem_Permission || p.hasPermission("commandgui.useitem")) {
|
||||
OpenGUI.openGUI(p, Main.guiHashMap.get(SelectConfig.UseItem_OpenGUI), SelectConfig.UseItem_OpenGUI);
|
||||
if (SelectConfig.Sound_Enable && SelectConfig.Sound_OpenInventory_Enable) {
|
||||
p.playSound(p.getLocation(), SelectConfig.Sound_OpenInventory, 3, 1);
|
||||
}
|
||||
} else {
|
||||
p.sendMessage(SelectMessages.NoPermissionForUseItem.replace("[perm]", "commandgui.useitem")
|
||||
.replace("[gui]", SelectConfig.UseItem_OpenGUI));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onItemMoveEvent(InventoryMoveItemEvent e) {
|
||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||
if (e.getItem() != null && e.getItem().hasItemMeta() && e.getItem().getItemMeta().hasDisplayName()
|
||||
&& e.getItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
e.setCancelled(true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onItemMove(InventoryDragEvent e) {
|
||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||
if (e.getWhoClicked() instanceof Player) {
|
||||
Player p = (Player) e.getWhoClicked();
|
||||
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
|
||||
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
p.closeInventory();
|
||||
e.setCancelled(true);
|
||||
ItemChange.itemChange(p);
|
||||
}
|
||||
|
||||
if (e.getOldCursor() != null && e.getOldCursor().hasItemMeta() && e.getOldCursor().getItemMeta().hasDisplayName()
|
||||
&& e.getOldCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
p.closeInventory();
|
||||
e.setCancelled(true);
|
||||
ItemChange.itemChange(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onItemMove(InventoryClickEvent e) {
|
||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||
Player player = (Player) e.getWhoClicked();
|
||||
|
||||
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
|
||||
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
if (e.getCurrentItem() != null && e.getCurrentItem().hasItemMeta() && e.getCurrentItem().getItemMeta().hasDisplayName()
|
||||
&& e.getCurrentItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
|
||||
e.setCancelled(true);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onItemMove(InventoryPickupItemEvent e) {
|
||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||
if (e.getItem() != null && e.getItem().getItemStack() != null) {
|
||||
ItemStack item = e.getItem().getItemStack();
|
||||
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
||||
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onPlace(BlockPlaceEvent e) {
|
||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||
if (e.getItemInHand() != null && e.getItemInHand().hasItemMeta() && e.getItemInHand().getItemMeta().hasDisplayName()
|
||||
&& e.getItemInHand().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onDrop(PlayerDropItemEvent e) {
|
||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||
if (e.getItemDrop() != null && e.getItemDrop().getItemStack() != null) {
|
||||
ItemStack item = e.getItemDrop().getItemStack();
|
||||
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
||||
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean legacy() {
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12 || MCVersion.minecraft1_13 || MCVersion.minecraft1_14 || MCVersion.minecraft1_15) {
|
||||
return true;
|
||||
} else return false;
|
||||
}
|
||||
|
||||
private static boolean topInventoryIsEmpty(Player p) {
|
||||
return p.getOpenInventory().getTopInventory().isEmpty();
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.*;
|
||||
|
||||
public class Events_from1_10 implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onHandSwap(PlayerSwapHandItemsEvent e) {
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9) return;
|
||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||
if (e.getMainHandItem() != null && e.getMainHandItem().hasItemMeta() && e.getMainHandItem().getItemMeta().hasDisplayName()
|
||||
&& e.getMainHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
}
|
||||
if (e.getOffHandItem() != null && e.getOffHandItem().hasItemMeta() && e.getOffHandItem().getItemMeta().hasDisplayName()
|
||||
&& e.getOffHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
public void onItemMove(PlayerSwapHandItemsEvent e) {
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9) return;
|
||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||
Player p = e.getPlayer();
|
||||
if (e.getOffHandItem() != null && e.getOffHandItem().hasItemMeta() && e.getOffHandItem().getItemMeta().hasDisplayName()
|
||||
&& e.getOffHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
p.closeInventory();
|
||||
e.setCancelled(true);
|
||||
}
|
||||
if (e.getMainHandItem() != null && e.getMainHandItem().hasItemMeta() && e.getMainHandItem().getItemMeta().hasDisplayName()
|
||||
&& e.getMainHandItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
p.closeInventory();
|
||||
e.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,118 @@
|
||||
package de.jatitv.commandguiv2.Spigot;
|
||||
//s<ds
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.system.Load;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.plugins.PluginCheck;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
public final class Main extends JavaPlugin {
|
||||
|
||||
public static ArrayList<String> bungeeplayers = new ArrayList<>();
|
||||
public static ArrayList<String> bungeejoinplayers = new ArrayList<>();
|
||||
|
||||
public static File getPath() {
|
||||
return plugin.getDataFolder();
|
||||
}
|
||||
|
||||
private static Boolean enable = false;
|
||||
|
||||
public static String prefix = "§8[§4C§9GUI§8]";
|
||||
|
||||
public static String version;
|
||||
|
||||
public static List<String> autor;
|
||||
public static Integer spigotID = Util.SpigotID;
|
||||
public static Integer bstatsID = Util.BstatsID;
|
||||
public static String spigot = Util.Spigot;
|
||||
public static String discord = Util.Discord;
|
||||
|
||||
public static Main plugin;
|
||||
public static List plugins;
|
||||
|
||||
public static String update_version = null;
|
||||
public static Boolean PaPi = false;
|
||||
public static Boolean PlotSquaredGUI = false;
|
||||
public static Boolean PlugManGUI = false;
|
||||
|
||||
public static HashMap<String, Object> guiHashMap = new HashMap<>();
|
||||
public static ArrayList<String> allAliases = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
plugins = Arrays.asList(getServer().getPluginManager().getPlugins());
|
||||
// Plugin startup logic
|
||||
// Plugin startup logic
|
||||
Logger logger = this.getLogger();
|
||||
plugin = this;
|
||||
autor = plugin.getDescription().getAuthors();
|
||||
version = plugin.getDescription().getVersion();
|
||||
if (pluginNotFound("T2CodeLib", 96388, Util.requiredT2CodeLibVersion)) return;
|
||||
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||
if (PluginCheck.papi()) {
|
||||
PaPi = true;
|
||||
}
|
||||
Load.onLoad(prefix, autor, version, spigot, spigotID, discord, bstatsID);
|
||||
enable = true;
|
||||
|
||||
}
|
||||
|
||||
public static void addonLoad() {
|
||||
if (Bukkit.getPluginManager().getPlugin("PlotSquaredGUI") != null) {
|
||||
PlotSquaredGUI = true;
|
||||
addonEnable(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI"));
|
||||
}
|
||||
if (Bukkit.getPluginManager().getPlugin("PlugManGUI") != null) {
|
||||
PlugManGUI = true;
|
||||
addonEnable(Bukkit.getPluginManager().getPlugin("PlugManGUI"));
|
||||
}
|
||||
}
|
||||
|
||||
public static void addonEnable(Plugin plugin) {
|
||||
send.console(prefix + " §aAddon for: §e" + plugin.getName() + "§7 - Version: " + plugin.getDescription().getVersion() + " §aloaded successfully!");
|
||||
}
|
||||
|
||||
public static Boolean pluginNotFound(String pl, Integer spigotID) {
|
||||
if (Bukkit.getPluginManager().getPlugin(pl) == null) {
|
||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||
Bukkit.getConsoleSender().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
||||
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
||||
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
|
||||
return true;
|
||||
} else return false;
|
||||
}
|
||||
|
||||
public static Boolean pluginNotFound(String pl, Integer spigotID, double ver) {
|
||||
if (Bukkit.getPluginManager().getPlugin(pl) == null) {
|
||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||
Bukkit.getConsoleSender().sendMessage(prefix + " §e" + pl + " §4could not be found. Please download it here: " +
|
||||
"§6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to be able to use this plugin.");
|
||||
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
|
||||
return true;
|
||||
} else {
|
||||
if (Double.parseDouble(Objects.requireNonNull(Bukkit.getPluginManager().getPlugin(pl)).getDescription().getVersion()) < ver) {
|
||||
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
|
||||
Bukkit.getConsoleSender().sendMessage(prefix + " §e" + pl + " §4is out of date! This plugin requires at least version §2" + ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to use this version of " + plugin.getDescription().getName() + ".");
|
||||
Main.plugin.getPluginLoader().disablePlugin(Main.plugin);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
// Plugin shutdown logic
|
||||
if (enable) T2CodeTemplate.onDisable(prefix, autor, version, spigot, discord);
|
||||
}
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Objekte;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Obj_Select {
|
||||
public static void onSelect() {
|
||||
Main.guiHashMap.clear();
|
||||
Main.allAliases.clear();
|
||||
File f = new File(Main.getPath() + "/GUIs/");
|
||||
File[] fileArray = f.listFiles();
|
||||
|
||||
for (File config_gui : fileArray) {
|
||||
Main.allAliases.add(config_gui.getName().replace(".yml", ""));
|
||||
String sub = config_gui.getName().substring(config_gui.getName().length() - 4);
|
||||
if (sub.equals(".yml")) {
|
||||
YamlConfiguration yamlConfiguration_gui = YamlConfiguration.loadConfiguration(config_gui);
|
||||
|
||||
Boolean GUI_Enable = yamlConfiguration_gui.getBoolean("GUI.Enable");
|
||||
Integer GUI_Lines = yamlConfiguration_gui.getInt("GUI.Lines");
|
||||
if (yamlConfiguration_gui.getInt("GUI.Lines") > 6) {
|
||||
yamlConfiguration_gui.set("GUI.Lines", 6);
|
||||
}
|
||||
if (yamlConfiguration_gui.getInt("GUI.Lines") < 1) {
|
||||
yamlConfiguration_gui.set("GUI.Lines", 1);
|
||||
}
|
||||
String GUI_Name = yamlConfiguration_gui.getString("GUI.Name");
|
||||
Boolean GUI_FillItem_Enable = yamlConfiguration_gui.getBoolean("GUI.FillItem.Enable");
|
||||
String GUI_FillItem_Item;
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
GUI_FillItem_Item = yamlConfiguration_gui.getString("GUI.FillItem.GlassPaneCollor");
|
||||
} else GUI_FillItem_Item = yamlConfiguration_gui.getString("GUI.FillItem.Item");
|
||||
|
||||
|
||||
Boolean Command_Alias_Enable = yamlConfiguration_gui.getBoolean("Command.Alias");
|
||||
Boolean Command_Permission = yamlConfiguration_gui.getBoolean("Command.Permission.Required");
|
||||
|
||||
ArrayList<Slot> slots = new ArrayList<>();
|
||||
for (String key : yamlConfiguration_gui.getConfigurationSection("Slots").getKeys(false)) {
|
||||
Slot slot = new Slot(yamlConfiguration_gui.getInt("Slots." + key + ".Slot") - 1,
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Enable"),
|
||||
// yamlConfiguration_gui.getBoolean("Slots." + key + ".Item.Removable"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Item.Empty"),
|
||||
yamlConfiguration_gui.getInt("Slots." + key + ".Item.Amount"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Item.PlayerHead.Enable"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Item.PlayerHead.Base64.Enable"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".Item.PlayerHead.Base64.Base64Value"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Item.PlayerHead.PlayerWhoHasOpenedTheGUI"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".Item.PlayerHead.PlayerName"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".Item.Material"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".Item.Name"),
|
||||
yamlConfiguration_gui.getList("Slots." + key + ".Item.Lore"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".CustomSound.Enable"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".CustomSound.NoSound"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".CustomSound.Sound"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Cost.Enable"),
|
||||
yamlConfiguration_gui.getDouble("Slots." + key + ".Cost.Price"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Command.Enable"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Command.BungeeCommand"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Command.CommandAsConsole"),
|
||||
yamlConfiguration_gui.getStringList("Slots." + key + ".Command.Command"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".ServerChange.Enable"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".ServerChange.Server"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".OpenGUI.Enable"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".OpenGUI.GUI"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Message.Enable"),
|
||||
yamlConfiguration_gui.getStringList("Slots." + key + ".Message.Message"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".Permission.Required"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".SetConfig.Enable"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.File.Path"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.Option.Path"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.Option.Premat"),
|
||||
// yamlConfiguration_gui.getBoolean("Slots." + key + ".SetConfig.Value.ChatInput"),
|
||||
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.Value.LeftClick.String"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".SetConfig.Value.LeftClick.Boolean"),
|
||||
yamlConfiguration_gui.getInt("Slots." + key + ".SetConfig.Value.LeftClick.Integer"),
|
||||
yamlConfiguration_gui.getDouble("Slots." + key + ".SetConfig.Value.LeftClick.Double"),
|
||||
yamlConfiguration_gui.getStringList("Slots." + key + ".SetConfig.Value.LeftClick.List"),
|
||||
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.Value.RightClick.String"),
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".SetConfig.Value.RightClick.Boolean"),
|
||||
yamlConfiguration_gui.getInt("Slots." + key + ".SetConfig.Value.RightClick.Integer"),
|
||||
yamlConfiguration_gui.getDouble("Slots." + key + ".SetConfig.Value.RightClick.Double"),
|
||||
yamlConfiguration_gui.getStringList("Slots." + key + ".SetConfig.RightClick.Value.List"),
|
||||
|
||||
yamlConfiguration_gui.getBoolean("Slots." + key + ".SetConfig.PluginReload.Enable"),
|
||||
yamlConfiguration_gui.getString("Slots." + key + ".SetConfig.PluginReload.Command"));
|
||||
slots.add(slot);
|
||||
|
||||
}
|
||||
Object objekt = new Object(GUI_Enable, GUI_Lines, GUI_Name, GUI_FillItem_Enable, GUI_FillItem_Item,
|
||||
config_gui.getName().replace(".yml", ""), Command_Alias_Enable, Command_Permission, slots);
|
||||
|
||||
Main.guiHashMap.put(config_gui.getName().replace(".yml", ""), objekt);
|
||||
CmdExecuter_GUI.arg1.put(config_gui.getName().replace(".yml", ""), "commandgui.gui." + config_gui.getName().replace(".yml", ""));
|
||||
|
||||
try {
|
||||
yamlConfiguration_gui.save(config_gui);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Objekte;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Object {
|
||||
public Boolean GUI_Enable;
|
||||
public Integer GUI_Lines;
|
||||
public String GUI_Name;
|
||||
public Boolean GUI_FillItem_Enable;
|
||||
public String GUI_FillItem_Item;
|
||||
|
||||
|
||||
public String Command_Command;
|
||||
public Boolean Command_Alias_Enable;
|
||||
public Boolean Command_Permission_Enable;
|
||||
public ArrayList<Slot> GUI_Slots;
|
||||
|
||||
public Object(Boolean GUI_Enable, Integer GUI_Lines, String GUI_Name, Boolean GUI_FillItem_Enable, String GUI_FillItem_Item,
|
||||
String Command_Command, Boolean Command_Alias_Enable, Boolean Command_Permission_Enable, ArrayList<Slot> GUI_Slots){
|
||||
this.GUI_Enable = GUI_Enable;
|
||||
this.GUI_Lines = GUI_Lines;
|
||||
this.GUI_Name = GUI_Name;
|
||||
this.GUI_FillItem_Enable = GUI_FillItem_Enable;
|
||||
this.GUI_FillItem_Item = GUI_FillItem_Item;
|
||||
this.Command_Command = Command_Command;
|
||||
this.Command_Alias_Enable = Command_Alias_Enable;
|
||||
this.Command_Permission_Enable = Command_Permission_Enable;
|
||||
this.GUI_Slots = GUI_Slots;
|
||||
}
|
||||
}
|
@ -0,0 +1,158 @@
|
||||
package de.jatitv.commandguiv2.Spigot.Objekte;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Slot {
|
||||
|
||||
public Integer Slot;
|
||||
public Boolean Enable;
|
||||
// public Boolean ItemsRemovable;
|
||||
public Boolean Empty;
|
||||
public Integer ItemAmount;
|
||||
public Boolean PlayerHead_Enable;
|
||||
public Boolean Base64_Enable;
|
||||
public String Base64Value;
|
||||
public Boolean PlayerWhoHasOpenedTheGUI;
|
||||
public String PlayerName;
|
||||
public String Item;
|
||||
public String Name;
|
||||
public List Lore;
|
||||
public Boolean CustomSound_Enable;
|
||||
public Boolean CustomSound_NoSound;
|
||||
public String CustomSound_Sound;
|
||||
public Boolean Cost_Enable;
|
||||
public Double Price;
|
||||
public Boolean Command_Enable;
|
||||
public Boolean Command_BungeeCommand;
|
||||
public Boolean CommandAsConsole;
|
||||
public Boolean ServerChange;
|
||||
public String ServerChangeServer;
|
||||
public List<String> Command;
|
||||
public Boolean OpenGUI_Enable;
|
||||
public String OpenGUI;
|
||||
public Boolean Message_Enable;
|
||||
public List<String> Message;
|
||||
public Boolean Perm;
|
||||
public Boolean SetConfigEnable;
|
||||
public String ConfigFilePath;
|
||||
public String ConfigOptionPath;
|
||||
public String ConfigOptionPremat;
|
||||
// public Boolean ConfigChatInput;
|
||||
|
||||
public String ConfigStringValueLeft;
|
||||
public Boolean ConfigBooleanValueLeft;
|
||||
public Integer ConfigIntegerValueLeft;
|
||||
public Double ConfigDoubleValueLeft;
|
||||
public List<String> ConfigListValueLeft;
|
||||
|
||||
public String ConfigStringValueRight;
|
||||
public Boolean ConfigBooleanValueRight;
|
||||
public Integer ConfigIntegerValueRight;
|
||||
public Double ConfigDoubleValueRight;
|
||||
public List<String> ConfigListValueRight;
|
||||
|
||||
|
||||
public Boolean PluginReloadEnable;
|
||||
public String PluginReloadCommand;
|
||||
|
||||
public Slot(Integer Slot,
|
||||
Boolean Enable,
|
||||
// Boolean ItemsRemovable,
|
||||
Boolean Empty,
|
||||
Integer ItemAmount,
|
||||
Boolean PlayerHead_Enable,
|
||||
Boolean Base64Value_Enable,
|
||||
String Base64Value,
|
||||
Boolean PlayerWhoHasOpenedTheGUI,
|
||||
String PlayerName,
|
||||
String Item,
|
||||
String Name,
|
||||
List Lore,
|
||||
Boolean CustomSound_Enable,
|
||||
Boolean CustomSound_NoSound,
|
||||
String CustomSound_Sound,
|
||||
Boolean Cost_Enable,
|
||||
Double Price,
|
||||
Boolean Command_Enable,
|
||||
Boolean Command_BungeeCommand,
|
||||
Boolean CommandAsConsole,
|
||||
List<String> Command,
|
||||
Boolean ServerChange,
|
||||
String ServerChangeServer,
|
||||
Boolean OpenGUI_Enable,
|
||||
String OpenGUI,
|
||||
Boolean Message_Enable,
|
||||
List<String> Message,
|
||||
Boolean Perm,
|
||||
Boolean SetConfigEnable,
|
||||
String ConfigFilePath,
|
||||
String ConfigOptionPath,
|
||||
String ConfigOptionPremat,
|
||||
// Boolean ConfigChatInput,
|
||||
|
||||
String ConfigStringValueLeft,
|
||||
Boolean ConfigBooleanValueLeft,
|
||||
Integer ConfigIntegerValueLeft,
|
||||
Double ConfigDoubleValueLeft,
|
||||
List<String> ConfigListValueLeft,
|
||||
|
||||
String ConfigStringValueRight,
|
||||
Boolean ConfigBooleanValueRight,
|
||||
Integer ConfigIntegerValueRight,
|
||||
Double ConfigDoubleValueRight,
|
||||
List<String> ConfigListValueRight,
|
||||
|
||||
Boolean PluginReloadEnable,
|
||||
String PluginReloadCommand) {
|
||||
this.Slot = Slot;
|
||||
this.Enable = Enable;
|
||||
// this.ItemsRemovable = ItemsRemovable;
|
||||
this.Empty = Empty;
|
||||
this.ItemAmount = ItemAmount;
|
||||
this.PlayerHead_Enable = PlayerHead_Enable;
|
||||
this.Base64_Enable = Base64Value_Enable;
|
||||
this.Base64Value = Base64Value;
|
||||
this.PlayerWhoHasOpenedTheGUI = PlayerWhoHasOpenedTheGUI;
|
||||
this.PlayerName = PlayerName;
|
||||
this.Item = Item;
|
||||
this.Name = Name;
|
||||
this.Lore = Lore;
|
||||
this.CustomSound_Enable = CustomSound_Enable;
|
||||
this.CustomSound_NoSound = CustomSound_NoSound;
|
||||
this.CustomSound_Sound = CustomSound_Sound;
|
||||
this.Cost_Enable = Cost_Enable;
|
||||
this.Price = Price;
|
||||
this.Command_Enable = Command_Enable;
|
||||
this.Command_BungeeCommand = Command_BungeeCommand;
|
||||
this.CommandAsConsole = CommandAsConsole;
|
||||
this.Command = Command;
|
||||
this.ServerChange = ServerChange;
|
||||
this.ServerChangeServer = ServerChangeServer;
|
||||
this.OpenGUI_Enable = OpenGUI_Enable;
|
||||
this.OpenGUI = OpenGUI;
|
||||
this.Message_Enable = Message_Enable;
|
||||
this.Message = Message;
|
||||
this.Perm = Perm;
|
||||
this.SetConfigEnable = SetConfigEnable;
|
||||
this.ConfigFilePath = ConfigFilePath;
|
||||
this.ConfigOptionPath = ConfigOptionPath;
|
||||
this.ConfigOptionPremat = ConfigOptionPremat;
|
||||
// this.ConfigChatInput = ConfigChatInput;
|
||||
|
||||
this.ConfigStringValueLeft = ConfigStringValueLeft;
|
||||
this.ConfigBooleanValueLeft = ConfigBooleanValueLeft;
|
||||
this.ConfigIntegerValueLeft = ConfigIntegerValueLeft;
|
||||
this.ConfigDoubleValueLeft = ConfigDoubleValueLeft;
|
||||
this.ConfigListValueLeft = ConfigListValueLeft;
|
||||
|
||||
this.ConfigStringValueRight = ConfigStringValueRight;
|
||||
this.ConfigBooleanValueRight = ConfigBooleanValueRight;
|
||||
this.ConfigIntegerValueRight = ConfigIntegerValueRight;
|
||||
this.ConfigDoubleValueRight = ConfigDoubleValueRight;
|
||||
this.ConfigListValueRight = ConfigListValueRight;
|
||||
|
||||
|
||||
this.PluginReloadEnable = PluginReloadEnable;
|
||||
this.PluginReloadCommand = PluginReloadCommand;
|
||||
}
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.system.Debug;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.DefaultGUICreate;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class CmdExecuter_Admin implements CommandExecutor, TabCompleter {
|
||||
private static String prefix = Util.Prefix;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
if (args.length == 0) {
|
||||
Help.sendHelp(sender, prefix);
|
||||
} else {
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "info":
|
||||
if (sender.hasPermission("commandgui.command.info")) {
|
||||
Commands.info(sender);
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
|
||||
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.command.info"));
|
||||
|
||||
break;
|
||||
case "reload":
|
||||
case "rl":
|
||||
if (sender.hasPermission("commandgui.admin")) {
|
||||
Commands.reload(sender);
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
|
||||
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.admin"));
|
||||
break;
|
||||
case "createdefaultgui":
|
||||
if (sender.hasPermission("commandgui.admin")) {
|
||||
DefaultGUICreate.configCreate();
|
||||
sender.sendMessage(SelectMessages.DefaultGUIcreate.replace("[directory]", Main.getPath() + "/GUIs/default.yml"));
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
|
||||
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.admin"));
|
||||
break;
|
||||
case "debug":
|
||||
if (sender.hasPermission("commandgui.admin")) {
|
||||
Debug.onDebugFile(sender);
|
||||
/*if (args.length == 2) {
|
||||
if (args[1].equals("config")) {
|
||||
Debug.debugmsg();
|
||||
}
|
||||
if (args[1].equals("2")) {
|
||||
send.debug("2");
|
||||
}
|
||||
break;
|
||||
|
||||
} else Debug.debugmsg();
|
||||
|
||||
*/
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.admin"));
|
||||
break;
|
||||
|
||||
case "give":
|
||||
if (args.length == 2) {
|
||||
if (sender.hasPermission("commandgui.giveitem.other")) {
|
||||
Player target = Bukkit.getPlayer(args[1]);
|
||||
Commands.give(sender, target);
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui give")
|
||||
.replace("[perm]", "commandgui.command.give"));
|
||||
} else Help.sendHelp(sender, prefix);
|
||||
break;
|
||||
case "help":
|
||||
default:
|
||||
Help.sendHelp(sender, prefix);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//TabCompleter
|
||||
private static HashMap<String, String> arg1 = new HashMap<String, String>() {{
|
||||
put("reload", "commandgui.admin");
|
||||
put("rl", "commandgui.admin");
|
||||
put("createdefaultgui", "commandgui.admin");
|
||||
put("give", "commandgui.giveitem.other");
|
||||
put("info", "commandgui.command.info");
|
||||
}};
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command cmd, String s, String[] args) {
|
||||
List<String> list = new ArrayList<>();
|
||||
if (sender instanceof Player) {
|
||||
Player p = (Player) sender;
|
||||
if (args.length == 1) {
|
||||
for (String command : arg1.keySet()) {
|
||||
Boolean passend = true;
|
||||
for (int i = 0; i < args[0].length(); i++) {
|
||||
if (args[0].length() >= command.length()) {
|
||||
passend = false;
|
||||
} else {
|
||||
if (args[0].charAt(i) != command.charAt(i)) {
|
||||
passend = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasPermission(p, arg1.get(command)) && passend) {
|
||||
list.add(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (args.length == 2 && args[0].equalsIgnoreCase("give")) {
|
||||
if (sender.hasPermission("commandgui.giveitem.other")) {
|
||||
Iterator var6 = Bukkit.getOnlinePlayers().iterator();
|
||||
|
||||
while (var6.hasNext()) {
|
||||
Player player1 = (Player) var6.next();
|
||||
list.add(player1.getName());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public static boolean hasPermission(Player player, String permission) {
|
||||
if (player.isOp()) {
|
||||
return true;
|
||||
}
|
||||
String[] Permissions = permission.split(";");
|
||||
for (String perm : Permissions) {
|
||||
if (player.hasPermission(perm)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,160 @@
|
||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.system.Debug;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.DefaultGUICreate;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import net.t2code.lib.Bungee.Lib.commands.BTab;
|
||||
import net.t2code.lib.Spigot.Lib.commands.Tab;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class CmdExecuter_GUI implements CommandExecutor, TabCompleter {
|
||||
private static String prefix = Util.Prefix;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (args.length == 0) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage(SelectMessages.OnlyForPlayer);
|
||||
return false;
|
||||
}
|
||||
Player player = (Player) sender;
|
||||
Commands.gui(player);
|
||||
|
||||
} else {
|
||||
if (args[0].equals("admin")) {
|
||||
switch (args[1].toLowerCase()) {
|
||||
case "info":
|
||||
if (sender.hasPermission("commandgui.command.info")) {
|
||||
Commands.info(sender);
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
|
||||
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.command.info"));
|
||||
|
||||
break;
|
||||
case "reload":
|
||||
case "rl":
|
||||
if (sender.hasPermission("commandgui.admin")) {
|
||||
Commands.reload(sender);
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
|
||||
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.admin"));
|
||||
break;
|
||||
case "createdefaultgui":
|
||||
if (sender.hasPermission("commandgui.admin")) {
|
||||
DefaultGUICreate.configCreate();
|
||||
sender.sendMessage(SelectMessages.DefaultGUIcreate.replace("[directory]", Main.getPath() + "/GUIs/default.yml"));
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
|
||||
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.admin"));
|
||||
break;
|
||||
case "debug":
|
||||
if (sender.hasPermission("commandgui.admin")) {
|
||||
Debug.onDebugFile(sender);
|
||||
/*if (args.length == 2) {
|
||||
if (args[1].equals("config")) {
|
||||
Debug.debugmsg();
|
||||
}
|
||||
if (args[1].equals("2")) {
|
||||
send.debug("2");
|
||||
}
|
||||
break;
|
||||
|
||||
} else Debug.debugmsg();
|
||||
|
||||
*/
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.admin"));
|
||||
break;
|
||||
|
||||
case "give":
|
||||
if (args.length == 3) {
|
||||
if (sender.hasPermission("commandgui.giveitem.other")) {
|
||||
Player target = Bukkit.getPlayer(args[2]);
|
||||
Commands.give(sender, target);
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui give")
|
||||
.replace("[perm]", "commandgui.command.give"));
|
||||
} else Help.sendHelp(sender, prefix);
|
||||
break;
|
||||
case "help":
|
||||
default:
|
||||
Help.sendHelp(sender, prefix);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
} else Help.sendHelp(sender, prefix);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//TabCompleter
|
||||
|
||||
|
||||
public static HashMap<String, String> arg1 = new HashMap<String, String>();
|
||||
|
||||
private static HashMap<String, String> arg2 = new HashMap<String, String>() {{
|
||||
put("reload", "commandgui.admin");
|
||||
put("rl", "commandgui.admin");
|
||||
put("createdefaultgui", "commandgui.admin");
|
||||
put("give", "commandgui.giveitem.other");
|
||||
put("info", "commandgui.command.info");
|
||||
}};
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command cmd, String s, String[] args) {
|
||||
List<String> list = new ArrayList<>();
|
||||
|
||||
Tab.tab(list, sender, 0, args, arg1);
|
||||
Tab.tab(list, sender, 0, "admin", 1, args, arg2);
|
||||
Tab.tab(list, sender, 1, "give", 2, args, "commandgui.giveitem.other", true);
|
||||
|
||||
// if (args.length == 1) {
|
||||
// for (String command : arg1.keySet()) {
|
||||
// Boolean passend = true;
|
||||
// for (int i = 0; i < args[0].length(); i++) {
|
||||
// if (args[0].length() >= command.length()) {
|
||||
// passend = false;
|
||||
// } else {
|
||||
// if (args[0].charAt(i) != command.charAt(i)) {
|
||||
// passend = false;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (hasPermission(sender, arg1.get(command)) && passend) {
|
||||
// list.add(command);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (args.length > 1) {
|
||||
// if (args[0].toLowerCase().equals("admin")){
|
||||
// return Tab.tab(sender,1,args,arg2);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static boolean hasPermission(CommandSender sender, String permission) {
|
||||
|
||||
if (permission.equals("")) {
|
||||
return true;
|
||||
}
|
||||
String[] Permissions = permission.split(";");
|
||||
for (String perm : Permissions) {
|
||||
if (sender.hasPermission(perm)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,113 @@
|
||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.TabCompleter;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class CmdExecuter_GUIItem implements CommandExecutor, TabCompleter {
|
||||
private static String prefix = Util.Prefix;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
Player player = (Player) sender;
|
||||
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
||||
if (args.length == 0) {
|
||||
Help.sendGUIItemHelp(sender, prefix);
|
||||
} else {
|
||||
if (args.length == 1 || args.length == 2) {
|
||||
if (sender instanceof Player) {
|
||||
if (SelectConfig.UseItem_AllowToggle) {
|
||||
switch (args[0].toLowerCase()) {
|
||||
case "on":
|
||||
Commands.itemOn(player);
|
||||
break;
|
||||
case "off":
|
||||
Commands.itemOff(player);
|
||||
break;
|
||||
case "slot":
|
||||
if (args.length == 2) {
|
||||
try {
|
||||
Commands.onSetSlot(player, Integer.valueOf(args[1]));
|
||||
} catch (Exception e5) {
|
||||
send.player(player, SelectMessages.ItemSlot_wrongValue);
|
||||
}
|
||||
|
||||
} else send.player(player, "§4Use: §7/gui-item slot [slot]");
|
||||
|
||||
break;
|
||||
default:
|
||||
Help.sendHelp(player, prefix);
|
||||
|
||||
}
|
||||
}
|
||||
} else sender.sendMessage(SelectMessages.OnlyForPlayer);
|
||||
}
|
||||
}
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui-item").replace("[perm]", "commandgui.useitem.toggle"));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//TabCompleter
|
||||
private static HashMap<String, String> arg1 = new HashMap<String, String>() {{
|
||||
put("on", "commandgui.useitem.toggle");
|
||||
put("off", "commandgui.useitem.toggle");
|
||||
if (SelectConfig.UseItem_AllowSetSlot) {
|
||||
put("slot", "commandgui.useitem.toggle");
|
||||
}
|
||||
}};
|
||||
|
||||
@Override
|
||||
public List<String> onTabComplete(CommandSender sender, Command cmd, String s, String[] args) {
|
||||
List<String> list = new ArrayList<>();
|
||||
if (sender instanceof Player) {
|
||||
if (SelectConfig.UseItem_AllowToggle) {
|
||||
Player p = (Player) sender;
|
||||
if (args.length == 1) {
|
||||
for (String command : arg1.keySet()) {
|
||||
Boolean passend = true;
|
||||
for (int i = 0; i < args[0].length(); i++) {
|
||||
if (args[0].length() >= command.length()) {
|
||||
passend = false;
|
||||
} else {
|
||||
if (args[0].charAt(i) != command.charAt(i)) {
|
||||
passend = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasPermission(p, arg1.get(command)) && passend) {
|
||||
list.add(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static boolean hasPermission(Player player, String permission) {
|
||||
if (player.isOp()) {
|
||||
return true;
|
||||
}
|
||||
String[] Permissions = permission.split(";");
|
||||
for (String perm : Permissions) {
|
||||
if (player.hasPermission(perm)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class CmdExecuter_Help implements CommandExecutor {
|
||||
private static String prefix = Util.Prefix;
|
||||
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (args.length == 0) {
|
||||
Help.sendHelp(sender, prefix);
|
||||
} else Help.sendHelp(sender, prefix);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,249 @@
|
||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Obj_Select;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
||||
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
||||
import de.jatitv.commandguiv2.Spigot.system.Give_UseItem;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.ConfigCreate;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.LanguagesCreate;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import net.md_5.bungee.api.chat.ClickEvent;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
||||
import net.t2code.lib.Spigot.Lib.messages.TextBuilder;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class Commands {
|
||||
private static Plugin plugin = Main.plugin;
|
||||
private static String prefix = Util.Prefix;
|
||||
private static String autor = String.valueOf(Main.autor);
|
||||
private static String version = Main.version;
|
||||
private static String spigot = Util.Spigot;
|
||||
private static String discord = Util.Discord;
|
||||
|
||||
public static void info(CommandSender sender) {
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
send.player(player, prefix + "§4======= §8[§4Command§9GUI§8] §4=======");
|
||||
send.player(player, prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
||||
|
||||
|
||||
|
||||
if (UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion.equalsIgnoreCase(version)) {
|
||||
send.player(player, prefix + " §2Version: §6" + version);
|
||||
} else {
|
||||
UpdateAPI.sendUpdateMsg(prefix,spigot,discord,version,UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion,player);
|
||||
}
|
||||
|
||||
|
||||
send.player(player, prefix + " §2Spigot: §6" + spigot);
|
||||
send.player(player, prefix + " §2Discord: §6" + discord);
|
||||
send.player(player, prefix + "§4======= §8[§4Command§9GUI§8] §4=======");
|
||||
} else {
|
||||
send.sender(sender, prefix + "§4======= §8[§4Command§9GUI§8] §4=======");
|
||||
send.sender(sender, prefix + " §2Autor: §6" + String.valueOf(autor).replace("[", "").replace("]", ""));
|
||||
|
||||
if (UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion.equalsIgnoreCase(version)) {
|
||||
send.sender(sender,prefix + " §2Version: §6" + version);
|
||||
} else {
|
||||
UpdateAPI.sendUpdateMsg(prefix,spigot,discord,version,UpdateAPI.PluginVersionen.get(plugin.getName()).publicVersion);
|
||||
}
|
||||
|
||||
send.sender(sender, prefix + " §2Spigot: §6" + spigot);
|
||||
send.sender(sender, prefix + " §2Discord: §6" + discord);
|
||||
send.sender(sender, prefix + "§4======= §8[§4Command§9GUI§8] §4=======");
|
||||
}
|
||||
}
|
||||
|
||||
public static void reload(CommandSender sender) {
|
||||
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadStart);
|
||||
send.console(prefix + "§8-------------------------------");
|
||||
send.console(prefix + " §6Plugin reload...");
|
||||
send.console(prefix + "§8-------------------------------");
|
||||
|
||||
ConfigCreate.configCreate();
|
||||
SelectConfig.onSelect();
|
||||
plugin.reloadConfig();
|
||||
|
||||
LanguagesCreate.langCreate();
|
||||
|
||||
Obj_Select.onSelect();
|
||||
SelectMessages.onSelect(prefix);
|
||||
SelectConfig.sound(prefix);
|
||||
try {
|
||||
AliasRegister.onRegister();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (SelectConfig.Bungee){
|
||||
Bukkit.getMessenger().registerOutgoingPluginChannel(Main.plugin, "commandgui:bungee");
|
||||
|
||||
}
|
||||
|
||||
if (sender instanceof Player) sender.sendMessage(SelectMessages.ReloadEnd);
|
||||
send.console(prefix + "§8-------------------------------");
|
||||
send.console(prefix + " §2Plugin successfully reloaded.");
|
||||
send.console(prefix + "§8-------------------------------");
|
||||
}
|
||||
|
||||
public static void give(CommandSender sender, Player target) {
|
||||
if (Bukkit.getPlayer(target.getName()) != null) {
|
||||
Give_UseItem.onGive(target);
|
||||
send.sender(sender, SelectMessages.Give_Sender.replace("[player]", target.getName()).replace("[item]", SelectConfig.UseItem_Name));
|
||||
send.player(target, SelectMessages.Give_Receiver.replace("[sender]", sender.getName()).replace("[item]", SelectConfig.UseItem_Name));
|
||||
if (SelectConfig.Sound_Give_Enable && SelectConfig.Sound_Enable) {
|
||||
target.playSound(target.getLocation(), SelectConfig.Sound_Give, 3, 1);
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage(SelectMessages.PlayerNotFond.replace("[player]", target.getName()));
|
||||
if (SelectConfig.Sound_PlayerNotFound_Enable && SelectConfig.Sound_Enable) {
|
||||
if (sender instanceof Player)
|
||||
((Player) sender).playSound(((Player) sender).getLocation(), SelectConfig.Sound_PlayerNotFound, 3, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void itemOn(Player player) {
|
||||
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
||||
ItemStack itm = player.getInventory().getItem(iam);
|
||||
if (itm != null) {
|
||||
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
|
||||
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
player.getInventory().remove(itm);
|
||||
player.updateInventory();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Integer slot = null;
|
||||
if (Select_Database.selectSlot(player) == null) {
|
||||
slot = SelectConfig.UseItem_InventorySlot;
|
||||
} else {
|
||||
slot = Select_Database.selectSlot(player);
|
||||
}
|
||||
send.debug(plugin,String.valueOf(slot));
|
||||
if (player.getInventory().getItem(slot - 1) == null) {
|
||||
Select_Database.setItemStatusTrue(player);
|
||||
Give_UseItem.onGive(player);
|
||||
} else {
|
||||
boolean empty = false;
|
||||
for (int i = 0; i < 9; i++) {
|
||||
if (player.getInventory().getItem(i) == null) {
|
||||
empty = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (empty) {
|
||||
Select_Database.setItemStatusTrue(player);
|
||||
Give_UseItem.onGiveADD(player);
|
||||
send.player(player, SelectMessages.ItemON);
|
||||
} else {
|
||||
player.sendMessage(SelectMessages.NoInventorySpace);
|
||||
if (SelectConfig.Sound_NoInventorySpace_Enable && SelectConfig.Sound_Enable) {
|
||||
player.playSound(player.getLocation(), SelectConfig.Sound_NoInventorySpace, 3, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void itemOff(Player player) {
|
||||
Select_Database.setItemStatusFalse(player);
|
||||
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
||||
ItemStack itm = player.getInventory().getItem(iam);
|
||||
if (itm != null) {
|
||||
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
|
||||
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
player.getInventory().remove(itm);
|
||||
player.updateInventory();
|
||||
send.player(player, SelectMessages.ItemOFF);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void onSetSlot(Player player, Integer setSlot) {
|
||||
if (SelectConfig.UseItem_AllowSetSlot) {
|
||||
if (setSlot < 1) {
|
||||
send.player(player, SelectMessages.ItemSlot_wrongValue);
|
||||
return;
|
||||
}
|
||||
if (setSlot > 9) {
|
||||
send.player(player, SelectMessages.ItemSlot_wrongValue);
|
||||
return;
|
||||
}
|
||||
ItemStack itm1 = player.getInventory().getItem(setSlot - 1);
|
||||
if (itm1 != null) {
|
||||
if (itm1.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm1.getType() == ItemVersion.Head) {
|
||||
if (itm1.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
player.sendMessage(SelectMessages.ItemSlotAlreadySet.replace("[slot]", setSlot.toString()));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SelectConfig.UseItem_InventorySlotEnforce || player.getInventory().getItem(setSlot - 1) != null) {
|
||||
send.player(player, SelectMessages.ItemSlotNotEmpty.replace("[slot]", setSlot.toString()));
|
||||
return;
|
||||
}
|
||||
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
|
||||
ItemStack itm = player.getInventory().getItem(iam);
|
||||
if (itm != null) {
|
||||
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.Head) {
|
||||
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||
player.getInventory().remove(itm);
|
||||
player.updateInventory();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Select_Database.setSlot(player, setSlot);
|
||||
if (Select_Database.selectItemStatus(player)) {
|
||||
Give_UseItem.onGive(player);
|
||||
}
|
||||
send.player(player, SelectMessages.ItemSlot.replace("[slot]", setSlot.toString()));
|
||||
} else player.sendMessage(prefix + " §4Function disabled");
|
||||
}
|
||||
|
||||
public static void gui(Player player) {
|
||||
if (Main.guiHashMap.containsKey(SelectConfig.DefaultGUI)) {
|
||||
Object gui = Main.guiHashMap.get(SelectConfig.DefaultGUI);
|
||||
if (gui.GUI_Enable || player.hasPermission("commandgui.bypass")) {
|
||||
if (!gui.Command_Permission_Enable || player.hasPermission("commandgui.command") || player.hasPermission("commandgui.bypass")) {
|
||||
OpenGUI.openGUI(player, gui, SelectConfig.DefaultGUI);
|
||||
if (SelectConfig.Sound_Enable && SelectConfig.Sound_OpenInventory_Enable) {
|
||||
player.playSound(player.getLocation(), SelectConfig.Sound_OpenInventory, 3, 1);
|
||||
}
|
||||
} else player.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui")
|
||||
.replace("[perm]", "commandgui.command"));
|
||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.GUI_Name));
|
||||
}
|
||||
}
|
||||
public static void gui(Player player, String arg){
|
||||
if (Main.guiHashMap.containsKey(arg)) {
|
||||
Object gui = Main.guiHashMap.get(arg);
|
||||
if (gui.GUI_Enable || player.hasPermission("commandgui.bypass")) {
|
||||
if (!gui.Command_Permission_Enable || player.hasPermission("commandgui.command." + gui.Command_Command) || player.hasPermission("commandgui.bypass")) {
|
||||
OpenGUI.openGUI(player, gui, arg);
|
||||
if (SelectConfig.Sound_Enable && SelectConfig.Sound_OpenInventory_Enable) {
|
||||
player.playSound(player.getLocation(), SelectConfig.Sound_OpenInventory, 3, 1);
|
||||
}
|
||||
} else player.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + gui.Command_Command)
|
||||
.replace("[perm]", "commandgui.command." + arg.toLowerCase()));
|
||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.Command_Command));
|
||||
} else player.sendMessage(SelectMessages.GUInotFound);
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package de.jatitv.commandguiv2.Spigot.cmdManagement;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class Help {
|
||||
private static String prefix = Util.Prefix;
|
||||
public static void sendHelp(CommandSender sender, String Prefix) {
|
||||
send.sender(sender, Prefix + " §8----- §4Command§9GUI §chelp §8-----");
|
||||
if (sender.hasPermission("commandgui.command")) {
|
||||
Object gui = Main.guiHashMap.get(SelectConfig.DefaultGUI);
|
||||
send.sender(sender, Prefix + " " + SelectMessages.HelpCgui.replace("[gui]", Replace.replace(prefix,gui.GUI_Name)));
|
||||
for (String alias : Main.allAliases) {
|
||||
if (Main.guiHashMap.get(alias).GUI_Enable || sender.hasPermission("commandgui.bypass")) {
|
||||
send.sender(sender, Prefix + " " + SelectMessages.HelpOpen.replace("[gui]", alias).replace("[guiname]", Replace.replace(prefix,Main.guiHashMap.get(alias).GUI_Name)));
|
||||
}
|
||||
}
|
||||
send.sender(sender, Prefix + " " + SelectMessages.HelpHelp);
|
||||
}
|
||||
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_on);
|
||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_off);
|
||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_Slot);
|
||||
}
|
||||
if (sender.hasPermission("commandgui.command.info")) {
|
||||
send.sender(sender, Prefix + " " + SelectMessages.HelpInfo);
|
||||
}
|
||||
// if (sender.hasPermission("commandgui.command.give")) {
|
||||
// send.sender(sender, Prefix + " " + Select_msg.HelpGive);
|
||||
// }
|
||||
if (sender.hasPermission("commandgui.admin")) {
|
||||
send.sender(sender, Prefix + " " + SelectMessages.HelpCreateDefaultGUI.replace("[directory]", Main.getPath()+ "\\GUIs\\default.yml"));
|
||||
send.sender(sender, Prefix + " " + SelectMessages.HelpReload);
|
||||
}
|
||||
send.sender(sender, Prefix + " §8-------------------------");
|
||||
}
|
||||
|
||||
public static void sendGUIItemHelp(CommandSender sender, String Prefix) {
|
||||
if (sender.hasPermission("commandgui.useitem.toggle")) {
|
||||
send.sender(sender, Prefix + " §8------ §4Command§9GUI§2Item §chelp §8------");
|
||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_on);
|
||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_off);
|
||||
send.sender(sender, Prefix + " " + SelectMessages.GUIItemHelp_Slot);
|
||||
send.sender(sender, Prefix + " §8------------------------------");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,127 @@
|
||||
package de.jatitv.commandguiv2.Spigot.cmdManagement.register;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.NMSVersion;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
|
||||
public class AliasRegister {
|
||||
public static void onRegister() {
|
||||
Plugin plugin = Main.plugin;
|
||||
send.debug(plugin, Bukkit.getServer().getClass().getPackage().getName());
|
||||
File f = new File(Main.getPath() + "/GUIs/");
|
||||
File[] fileArray = f.listFiles();
|
||||
if (Main.allAliases.toString().equals("[]")) {
|
||||
send.console(Util.Prefix + " §4No GUI files available");
|
||||
return;
|
||||
}
|
||||
for (String alias : Main.allAliases) {
|
||||
if (Main.guiHashMap.get(alias) != null) {
|
||||
if (Main.guiHashMap.get(alias).Command_Alias_Enable) {
|
||||
String version;
|
||||
if (NMSVersion.v1_8_R1) {
|
||||
send.debug(plugin, "Alias register 1.8_R1");
|
||||
org.bukkit.craftbukkit.v1_8_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_8_R1.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_8_R2) {
|
||||
send.debug(plugin, "Alias register 1.8_R2");
|
||||
org.bukkit.craftbukkit.v1_8_R2.CraftServer craftServer = (org.bukkit.craftbukkit.v1_8_R2.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_8_R3) {
|
||||
send.debug(plugin, "Alias register 1.8_R3");
|
||||
org.bukkit.craftbukkit.v1_8_R3.CraftServer craftServer = (org.bukkit.craftbukkit.v1_8_R3.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_9_R1) {
|
||||
send.debug(plugin, "Alias register 1.9_R1");
|
||||
org.bukkit.craftbukkit.v1_9_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_9_R1.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_9_R2) {
|
||||
send.debug(plugin, "Alias register 1.9_R2");
|
||||
org.bukkit.craftbukkit.v1_9_R2.CraftServer craftServer = (org.bukkit.craftbukkit.v1_9_R2.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_10_R1) {
|
||||
send.debug(plugin, "Alias register 1.10_R1");
|
||||
org.bukkit.craftbukkit.v1_10_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_10_R1.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_11_R1) {
|
||||
send.debug(plugin, "Alias register 1.11_R1");
|
||||
org.bukkit.craftbukkit.v1_11_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_11_R1.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_12_R1) {
|
||||
send.debug(plugin, "Alias register 1.12_R1");
|
||||
org.bukkit.craftbukkit.v1_12_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_12_R1.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_13_R1) {
|
||||
send.debug(plugin, "Alias register 1.13_R1");
|
||||
org.bukkit.craftbukkit.v1_13_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_13_R1.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_13_R2) {
|
||||
send.debug(plugin, "Alias register 1.13_R2");
|
||||
org.bukkit.craftbukkit.v1_13_R2.CraftServer craftServer = (org.bukkit.craftbukkit.v1_13_R2.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_14_R1) {
|
||||
send.debug(plugin, "Alias register 1.14_R1");
|
||||
org.bukkit.craftbukkit.v1_14_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_14_R1.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_15_R1) {
|
||||
send.debug(plugin, "Alias register 1.15_R1");
|
||||
org.bukkit.craftbukkit.v1_15_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_15_R1.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_16_R1) {
|
||||
send.debug(plugin, "Alias register 1.16_R1");
|
||||
org.bukkit.craftbukkit.v1_16_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_16_R1.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_16_R2) {
|
||||
send.debug(plugin, "Alias register 1.16_R2");
|
||||
org.bukkit.craftbukkit.v1_16_R2.CraftServer craftServer = (org.bukkit.craftbukkit.v1_16_R2.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_16_R3) {
|
||||
send.debug(plugin, "Alias register 1.16_R3");
|
||||
org.bukkit.craftbukkit.v1_16_R3.CraftServer craftServer = (org.bukkit.craftbukkit.v1_16_R3.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_17_R1) {
|
||||
send.debug(plugin, "Alias register 1.17_R1");
|
||||
org.bukkit.craftbukkit.v1_17_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_17_R1.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (NMSVersion.v1_18_R1) {
|
||||
send.debug(plugin, "Alias register 1.18_R1");
|
||||
org.bukkit.craftbukkit.v1_18_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_18_R1.CraftServer) plugin.getServer();
|
||||
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
}
|
||||
if (Bukkit.getServer().getClass().getPackage().getName().contains("1_18_R1")) {
|
||||
send.debug(plugin, "Alias register 1.18_R1");
|
||||
send.warning(Main.plugin, "Alias commands of the GUIs not available! 1.18 is not yet supported with this version!");
|
||||
// org.bukkit.craftbukkit.v1_18_R1.CraftServer craftServer = (org.bukkit.craftbukkit.v1_18_R1.CraftServer) plugin.getServer();
|
||||
// craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
|
||||
//todo 1.18
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package de.jatitv.commandguiv2.Spigot.cmdManagement.register;
|
||||
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class RegisterCommand extends Command {
|
||||
private String alias;
|
||||
|
||||
public RegisterCommand(String alias) {
|
||||
super(alias);
|
||||
this.alias = alias;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String commandLabel, String[] args) {
|
||||
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player) sender;
|
||||
Object gui = Main.guiHashMap.get(alias);
|
||||
if (gui.GUI_Enable || player.hasPermission("commandgui.bypass")) {
|
||||
if (!gui.Command_Permission_Enable || player.hasPermission("commandgui.command." + alias) || player.hasPermission("commandgui.bypass")) {
|
||||
OpenGUI.openGUI(player, gui, alias);
|
||||
if (SelectConfig.Sound_Enable && SelectConfig.Sound_OpenInventory_Enable) {
|
||||
player.playSound(player.getLocation(), SelectConfig.Sound_OpenInventory, 3, 1);
|
||||
}
|
||||
} else player.sendMessage(SelectMessages.NoPermissionForCommand.replace("[cmd]", "/commandgui " + alias)
|
||||
.replace("[perm]", "commandgui.command." + alias));
|
||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", gui.GUI_Name));
|
||||
} else sender.sendMessage("§8[§6Command§9GUI§8] §cThis command is only for players!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,187 @@
|
||||
package de.jatitv.commandguiv2.Spigot.gui;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import de.jatitv.commandguiv2.Spigot.Listener.GUI_Listener;
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Slot;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import io.github.solyze.plugmangui.inventories.PluginListGUI;
|
||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.UUID;
|
||||
|
||||
public class OpenGUI {
|
||||
private static Plugin plugin = Main.plugin;
|
||||
private static String prefix = Util.Prefix;
|
||||
|
||||
public static void openGUI(Player player, Object gui, String guiString) {
|
||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||
switch (guiString) {
|
||||
//case "plugin.PlotSquaredGUI":
|
||||
// if (Main.PlotSquaredGUI) {
|
||||
// PlotSquaredGUIapi.openMainGUI(player);
|
||||
// } else {
|
||||
// if (player.hasPermission("commandgui.admin")) {
|
||||
// send.player(player, prefix + " §4PlotSquaredGUI could not be found! §9Please download it here: " +
|
||||
// "§6https://spigotmc.org/resources/plotsquaredgui.77506/");
|
||||
// }
|
||||
// }
|
||||
// return; todo
|
||||
case "plugin.PlugManGUI":
|
||||
if (Main.PlugManGUI) {
|
||||
player.openInventory((new PluginListGUI(54, 1)).getInventory());
|
||||
} else {
|
||||
if (player.hasPermission("commandgui.admin")) {
|
||||
send.player(player, prefix + " §4PlugManGUI could not be found! §9Please download it here: " +
|
||||
"§6https://spigotmc.org/resources/plugmangui.87599/");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (MCVersion.minecraft1_13) {
|
||||
GUI_Listener.GUICode = "";
|
||||
} else GUI_Listener.GUICode = "§6§8§9§r";
|
||||
if (gui.GUI_Enable || player.hasPermission("commandgui.bypass")) {
|
||||
Inventory inventory;
|
||||
if (Main.PaPi) {
|
||||
inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.GUI_Lines, (Replace.replace(prefix, player, GUI_Listener.GUICode + gui.GUI_Name)));
|
||||
} else inventory = Bukkit.createInventory((InventoryHolder) null, 9 * gui.GUI_Lines, (Replace.replace(prefix, GUI_Listener.GUICode + gui.GUI_Name)));
|
||||
|
||||
if (gui.GUI_FillItem_Enable) {
|
||||
ItemStack glass;
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
glass = new ItemStack(Material.valueOf("STAINED_GLASS_PANE"), 1, Short.valueOf(gui.GUI_FillItem_Item));
|
||||
} else glass = new ItemStack(Material.valueOf(gui.GUI_FillItem_Item.toUpperCase().replace(".", "_")));
|
||||
ItemMeta itemMetaglass = glass.getItemMeta();
|
||||
itemMetaglass.setDisplayName(" ");
|
||||
glass.setItemMeta(itemMetaglass);
|
||||
glass.setAmount(1);
|
||||
for (int i = 0; i < 9 * gui.GUI_Lines; i++) {
|
||||
inventory.setItem(i, glass);
|
||||
}
|
||||
}
|
||||
for (Slot slot : gui.GUI_Slots) {
|
||||
if (slot.Enable) {
|
||||
if (slot.Empty) {
|
||||
ItemStack air = new ItemStack(Material.AIR);
|
||||
inventory.setItem(slot.Slot, air);
|
||||
} else {
|
||||
if (slot.PlayerHead_Enable) {
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
send.player(player, prefix + "§c Playerheads are only available from version §61.13§c! §7- §bGUI: §6" + Replace.replace(prefix, gui.GUI_Name).toString() + " §bSlot: §6" + (slot.Slot + 1) + " §7- " + Replace.replace(prefix, slot.Name));
|
||||
send.error(plugin, "Playerheads are only available from version 1.13!");
|
||||
send.console(prefix + " §bGUI: §6" + Replace.replace(prefix, gui.GUI_Name).toString() + " §bSlot: §6" + (slot.Slot + 1) + " §7- " + Replace.replace(prefix, slot.Name));
|
||||
} else {
|
||||
|
||||
if (slot.Base64_Enable) {
|
||||
ItemStack item = new ItemStack(ItemVersion.Head);
|
||||
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
|
||||
if (Main.PaPi) {
|
||||
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
|
||||
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
||||
} else {
|
||||
itemMeta.setDisplayName(Replace.replace(prefix, slot.Name.replace("[player]", player.getName())));
|
||||
itemMeta.setLore(Replace.replacePrice(prefix, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
||||
}
|
||||
GameProfile profile = new GameProfile(UUID.randomUUID(), "");
|
||||
profile.getProperties().put("textures", new Property("textures", slot.Base64Value));
|
||||
Field profileField = null;
|
||||
try {
|
||||
profileField = itemMeta.getClass().getDeclaredField("profile");
|
||||
profileField.setAccessible(true);
|
||||
profileField.set(itemMeta, profile);
|
||||
} catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
item.setItemMeta(itemMeta);
|
||||
Integer am;
|
||||
if (slot.ItemAmount == 0) {
|
||||
am = 1;
|
||||
} else am = slot.ItemAmount;
|
||||
item.setAmount(am);
|
||||
inventory.setItem(slot.Slot, item);
|
||||
} else {
|
||||
if (slot.PlayerWhoHasOpenedTheGUI) {
|
||||
ItemStack item = new ItemStack(ItemVersion.Head);
|
||||
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
|
||||
if (Main.PaPi) {
|
||||
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
|
||||
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
||||
} else {
|
||||
itemMeta.setDisplayName(Replace.replace(prefix, slot.Name.replace("[player]", player.getName())));
|
||||
itemMeta.setLore(Replace.replacePrice(prefix, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
||||
}
|
||||
itemMeta.setOwner(player.getName());
|
||||
item.setItemMeta(itemMeta);
|
||||
Integer am;
|
||||
if (slot.ItemAmount == 0) {
|
||||
am = 1;
|
||||
} else am = slot.ItemAmount;
|
||||
item.setAmount(am);
|
||||
inventory.setItem(slot.Slot, item);
|
||||
} else {
|
||||
ItemStack item = new ItemStack(ItemVersion.Head);
|
||||
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
|
||||
if (Main.PaPi) {
|
||||
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
|
||||
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
||||
} else {
|
||||
itemMeta.setDisplayName(Replace.replace(prefix, slot.Name.replace("[player]", player.getName())));
|
||||
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
||||
}
|
||||
itemMeta.setOwner(slot.PlayerName);
|
||||
item.setItemMeta(itemMeta);
|
||||
Integer am;
|
||||
if (slot.ItemAmount == 0) {
|
||||
am = 1;
|
||||
} else am = slot.ItemAmount;
|
||||
item.setAmount(am);
|
||||
inventory.setItem(slot.Slot, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ItemStack item = new ItemStack(Material.valueOf(slot.Item.toUpperCase().replace(".", "_")));
|
||||
ItemMeta itemMeta = item.getItemMeta();
|
||||
if (Main.PaPi) {
|
||||
itemMeta.setDisplayName(Replace.replace(prefix, player, slot.Name.replace("[player]", player.getName())));
|
||||
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
||||
} else {
|
||||
itemMeta.setDisplayName(Replace.replace(prefix, slot.Name.replace("[player]", player.getName())));
|
||||
itemMeta.setLore(Replace.replacePrice(prefix, slot.Lore, slot.Price + " " + SelectConfig.Currency));
|
||||
}
|
||||
item.setItemMeta(itemMeta);
|
||||
Integer am;
|
||||
if (slot.ItemAmount == 0) {
|
||||
am = 1;
|
||||
} else am = slot.ItemAmount;
|
||||
item.setAmount(am);
|
||||
inventory.setItem(slot.Slot, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
player.openInventory(inventory);
|
||||
send.debug(plugin, "§6" + player.getName() + " §5Open §6" + Replace.replace(prefix, gui.GUI_Name) + " §5" + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
} else player.sendMessage(SelectMessages.GUIIsDisabled.replace("[gui]", Replace.replace(prefix, gui.GUI_Name)));
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.messaging.PluginMessageListener;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class Bungee_Sender_Reciver implements PluginMessageListener {
|
||||
|
||||
public static void sendToBungee(Player player,String channel, String information) {
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
DataOutputStream output = new DataOutputStream(stream);
|
||||
try {
|
||||
output.writeUTF(channel);
|
||||
output.writeUTF(information);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
player.sendPluginMessage(Main.plugin, "cgui:bungee", stream.toByteArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
|
||||
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(message));
|
||||
try {
|
||||
String subChannel = stream.readUTF();
|
||||
String input = stream.readUTF();
|
||||
switch (subChannel) {
|
||||
case "join":
|
||||
Main.bungeeplayers.add(input);
|
||||
Main.bungeejoinplayers.add(input);
|
||||
break;
|
||||
case "left":
|
||||
Main.bungeeplayers.remove(input);
|
||||
Main.bungeejoinplayers.remove(input);
|
||||
break;
|
||||
case "clear":
|
||||
Main.bungeeplayers.clear();
|
||||
Main.bungeejoinplayers.clear();
|
||||
break;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
public class Debug {
|
||||
|
||||
private static Plugin plugin = Main.plugin;
|
||||
public static void debugmsg() {
|
||||
|
||||
|
||||
send.debug(plugin,"§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
send.debug(plugin,"§3Bukkit Version: §e" + Bukkit.getBukkitVersion());
|
||||
send.debug(plugin,"§3NMS Version: §e" + Bukkit.getServer().getClass().getPackage().getName().replace("org.bukkit.craftbukkit.", ""));
|
||||
send.debug(plugin,"§3Version: §e" + Bukkit.getVersion());
|
||||
send.debug(plugin,"§3Java: §e" + System.getProperty("java.version"));
|
||||
send.debug(plugin,"§3Worlds: §e" +String.valueOf(Bukkit.getServer().getWorlds()));
|
||||
send.debug(plugin,String.valueOf(Main.plugins));
|
||||
send.debug(plugin,"§5----------------------------------");
|
||||
if (new File(Main.getPath(), "config.yml").exists()) {
|
||||
File f = new File(String.valueOf(Main.getPath()));
|
||||
File f2 = new File(String.valueOf(Main.getPath() + "/GUIs/"));
|
||||
File f3 = new File(String.valueOf(Main.getPath() + "/languages/"));
|
||||
File[] fileArray = f.listFiles();
|
||||
File[] fileArray2 = f2.listFiles();
|
||||
File[] fileArray3 = f3.listFiles();
|
||||
for (File config : fileArray) {
|
||||
send.debug(plugin,String.valueOf(config).replace("plugins/CommandGUI/", ""));
|
||||
}
|
||||
for (File config2 : fileArray2) {
|
||||
send.debug(plugin,String.valueOf(config2).replace("plugins/CommandGUI/", ""));
|
||||
}
|
||||
for (File config3 : fileArray3) {
|
||||
send.debug(plugin,String.valueOf(config3).replace("plugins/CommandGUI/", ""));
|
||||
}
|
||||
}
|
||||
send.debug(plugin,"§5!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
|
||||
}
|
||||
|
||||
public static void onDebugFile(CommandSender sender){
|
||||
String timeStamp = new SimpleDateFormat("dd_MM_yyyy_HH_mm_ss").format(Calendar.getInstance().getTime());
|
||||
String timeStampcfg = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss").format(Calendar.getInstance().getTime());
|
||||
send.sender(sender, Main.prefix + " §5Debug file was createt: §e" + Main.getPath() + "\\debug\\commandgui_debug_"+ timeStamp +".yml");
|
||||
File debug = new File(Main.getPath(), "debug/commandgui_debug_"+ timeStamp +".yml");
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(debug);
|
||||
|
||||
set("Time", timeStampcfg, yamlConfiguration);
|
||||
set("CommandGUI.Version", String.valueOf(plugin.getDescription().getVersion()), yamlConfiguration);
|
||||
|
||||
set("Server.Bukkit_Version", String.valueOf(Bukkit.getBukkitVersion()), yamlConfiguration);
|
||||
set("Server.NMS_Version", String.valueOf(Bukkit.getServer().getClass().getPackage().getName().replace("org.bukkit.craftbukkit.", "")), yamlConfiguration);
|
||||
set("Server.Version", String.valueOf(Bukkit.getVersion()), yamlConfiguration);
|
||||
set("Server.Java", String.valueOf(System.getProperty("java.version")), yamlConfiguration);
|
||||
set("Server.Worlds", String.valueOf(Bukkit.getServer().getWorlds()), yamlConfiguration);
|
||||
set("Server.Plugins", String.valueOf(Main.plugins) , yamlConfiguration);
|
||||
|
||||
try {
|
||||
yamlConfiguration.save(debug);
|
||||
} catch (IOException e) {
|
||||
send.warning(plugin,e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static void set(String path, String value, YamlConfiguration config){
|
||||
if (!config.contains(path)) {
|
||||
config.set(path, value);
|
||||
}
|
||||
}
|
||||
private static void set(String path, Integer value, YamlConfiguration config){
|
||||
if (!config.contains(path)) {
|
||||
config.set(path, value);
|
||||
}
|
||||
}
|
||||
private static void set(String path, Boolean value, YamlConfiguration config){
|
||||
if (!config.contains(path)) {
|
||||
config.set(path, value);
|
||||
}
|
||||
}
|
||||
private static void set(String path, List value, YamlConfiguration config){
|
||||
if (!config.contains(path)) {
|
||||
config.set(path, value);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.properties.Property;
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.inventory.meta.SkullMeta;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Give_UseItem {
|
||||
private static String prefix = Util.Prefix;
|
||||
|
||||
|
||||
public static void onGive(Player player) {
|
||||
Integer slot;
|
||||
if (Select_Database.selectSlot(player) == null) {
|
||||
slot = SelectConfig.UseItem_InventorySlot;
|
||||
} else {
|
||||
slot = Select_Database.selectSlot(player);
|
||||
}
|
||||
if (SelectConfig.UseItem_InventorySlot_FreeSlot) {
|
||||
player.getInventory().addItem(itemStack(player));
|
||||
} else player.getInventory().setItem(slot - 1, itemStack(player));
|
||||
}
|
||||
|
||||
public static void onGiveADD(Player player) {
|
||||
if (SelectConfig.UseItem_InventorySlot_FreeSlot) {
|
||||
player.getInventory().addItem(itemStack(player));
|
||||
} else player.getInventory().addItem(itemStack(player));
|
||||
}
|
||||
|
||||
private static ItemStack itemStack(Player player) {
|
||||
ItemStack item = null;
|
||||
if (SelectConfig.UseItem_PlayerHead_Enable) {
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
send.player(player, Main.prefix + "§c Playerheads for UseItem are only available from version §61.13§c!");
|
||||
send.error(Main.plugin, "Playerheads for UseItem are only available from version 1.13!");
|
||||
} else {
|
||||
item = new ItemStack(ItemVersion.Head);
|
||||
SkullMeta playerheadmeta = (SkullMeta) item.getItemMeta();
|
||||
playerheadmeta.setDisplayName(SelectConfig.UseItem_Name);
|
||||
if (SelectConfig.UseItem_Base64_Enable) {
|
||||
if (Main.PaPi) {
|
||||
playerheadmeta.setLore(Replace.replace(prefix, player, SelectConfig.UseItem_Lore));
|
||||
} else playerheadmeta.setLore(Replace.replace(prefix, SelectConfig.UseItem_Lore));
|
||||
GameProfile profile = new GameProfile(UUID.randomUUID(), "");
|
||||
profile.getProperties().put("textures", new Property("textures", SelectConfig.UseItem_Base64value));
|
||||
Field profileField = null;
|
||||
try {
|
||||
profileField = playerheadmeta.getClass().getDeclaredField("profile");
|
||||
profileField.setAccessible(true);
|
||||
profileField.set(playerheadmeta, profile);
|
||||
} catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
String p;
|
||||
if (SelectConfig.UseItem_PlayerWhoHasOpenedTheGUI) {
|
||||
p = player.getName();
|
||||
} else p = SelectConfig.UseItem_PlayerName;
|
||||
playerheadmeta.setOwner(p);
|
||||
if (Main.PaPi) {
|
||||
playerheadmeta.setLore(Replace.replace(prefix, player, SelectConfig.UseItem_Lore));
|
||||
} else playerheadmeta.setLore(Replace.replace(prefix, SelectConfig.UseItem_Lore));
|
||||
}
|
||||
item.setItemMeta(playerheadmeta);
|
||||
}
|
||||
} else {
|
||||
item = new ItemStack(Material.valueOf(SelectConfig.UseItem_Material));
|
||||
ItemMeta itemMeta = item.getItemMeta();
|
||||
itemMeta.setDisplayName(SelectConfig.UseItem_Name);
|
||||
if (Main.PaPi) {
|
||||
itemMeta.setLore(Replace.replace(prefix, player, SelectConfig.UseItem_Lore));
|
||||
} else itemMeta.setLore(Replace.replace(prefix, SelectConfig.UseItem_Lore));
|
||||
item.setItemMeta(itemMeta);
|
||||
item.setAmount(1);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Listener.GUI_Listener;
|
||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events_from1_10;
|
||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_Admin;
|
||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUI;
|
||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_GUIItem;
|
||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.CmdExecuter_Help;
|
||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.register.AliasRegister;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.DefaultGUICreate;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.LanguagesCreate;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
|
||||
import de.jatitv.commandguiv2.Spigot.Listener.PluginEvent;
|
||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Obj_Select;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.ConfigCreate;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
|
||||
public class Load {
|
||||
static Plugin plugin = Main.plugin;
|
||||
|
||||
public static void onLoad(String prefix, List autor, String version, String spigot, int spigotID, String discord, int bstatsID) {
|
||||
|
||||
Long long_ = T2CodeTemplate.onLoadHeader(prefix, autor, version, spigot, discord);
|
||||
try {
|
||||
Debug.debugmsg();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
send.console(prefix + " §8-------------------------------");
|
||||
|
||||
|
||||
if (!new File(Main.getPath(), "config.yml").exists()) {
|
||||
try {
|
||||
DefaultGUICreate.configCreate();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
try {
|
||||
ConfigCreate.configCreate();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
SelectConfig.onSelect();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (SelectConfig.Bungee) {
|
||||
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin,"commandgui:bungee")){
|
||||
send.debug(plugin, "registerIncomingPluginChannel §ecommandgui:bungee");
|
||||
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin,"commandgui:bungee");
|
||||
}
|
||||
|
||||
if (!Bukkit.getMessenger().isIncomingChannelRegistered(plugin,"cgui:onlineplayers")){
|
||||
send.debug(plugin, "registerIncomingPluginChannel §ecgui:onlineplayers");
|
||||
Bukkit.getMessenger().registerIncomingPluginChannel(plugin,"cgui:onlineplayers", new Bungee_Sender_Reciver());
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
LanguagesCreate.langCreate();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
Obj_Select.onSelect();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
CmdExecuter_GUI.arg1.put("admin", "commandgui.admin;commandgui.giveitem.other;commandgui.command.info");
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
SelectMessages.onSelect(prefix);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
SelectConfig.sound(prefix);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
send.console(prefix + " §8-------------------------------");
|
||||
if (SelectConfig.Storage.equals("MYSQL")) {
|
||||
MySQL.main();
|
||||
try {
|
||||
MySQL.query("CREATE TABLE IF NOT EXISTS `gui-item` (" +
|
||||
" `UUID` VARCHAR(191) NOT NULL COLLATE 'utf8mb4_general_ci'," +
|
||||
" `Name` TINYTEXT NOT NULL COLLATE 'utf8mb4_general_ci'," +
|
||||
" `Status` INT(1) NOT NULL DEFAULT '1'," +
|
||||
" `Slot` INT(1) NULL DEFAULT NULL," +
|
||||
" UNIQUE INDEX `UUID` (`UUID`)" +
|
||||
")" +
|
||||
"COLLATE='utf8mb4_general_ci'" +
|
||||
"ENGINE=InnoDB" +
|
||||
";");
|
||||
MySQL.query("ALTER TABLE `gui-item` ADD COLUMN IF NOT EXISTS `Slot` INT(1) NULL DEFAULT NULL AFTER `Status`;");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
if (SelectConfig.Debug) send.console(prefix + " §6Storage medium §2YML §6is used.");
|
||||
}
|
||||
if (Main.PaPi) {
|
||||
send.console(prefix + " §2PlaceholderAPI successfully connected!");
|
||||
} else {
|
||||
send.console(prefix + " §4PlaceholderAPI could not be connected / found!");
|
||||
}
|
||||
|
||||
try {
|
||||
RegisterPermissions.onPermRegister();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Main.plugin.getCommand("commandguiadmin").setExecutor(new CmdExecuter_Admin());
|
||||
// send.debug(plugin, "Commandregister: commandguiadmin");
|
||||
|
||||
if (SelectConfig.HelpAlias) {
|
||||
Main.plugin.getCommand("commandguihelp").setExecutor(new CmdExecuter_Help());
|
||||
send.debug(plugin, "Commandregister: commandguihelp");
|
||||
}
|
||||
Main.plugin.getCommand("commandgui").setExecutor(new CmdExecuter_GUI());
|
||||
send.debug(plugin, "Commandregister: commandgui");
|
||||
Main.plugin.getCommand("commandgui-item").setExecutor(new CmdExecuter_GUIItem());
|
||||
send.debug(plugin, "Commandregister: commandgui-item");
|
||||
|
||||
try {
|
||||
AliasRegister.onRegister();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new GUI_Listener(), plugin);
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new PluginEvent(), plugin);
|
||||
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new Events(), Main.plugin);
|
||||
|
||||
if (!MCVersion.minecraft1_8 && !MCVersion.minecraft1_9) {
|
||||
Bukkit.getServer().getPluginManager().registerEvents(new Events_from1_10(), plugin);
|
||||
}
|
||||
|
||||
|
||||
UpdateAPI.onUpdateCheck(plugin, prefix, spigot, spigotID, discord);
|
||||
Metrics.Bstats();
|
||||
Main.addonLoad();
|
||||
T2CodeTemplate.onLoadFooter(prefix, long_);
|
||||
}
|
||||
}
|
@ -0,0 +1,850 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
|
||||
package de.jatitv.commandguiv2.Spigot.system;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.logging.Level;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
public class Metrics {
|
||||
|
||||
public static void Bstats() {
|
||||
int pluginId = Main.bstatsID; // <-- Replace with the id of your plugin!
|
||||
Metrics metrics = new Metrics(Main.plugin, pluginId);
|
||||
metrics.addCustomChart(new Metrics.SimplePie("updatecheckonjoin", () -> String.valueOf(SelectConfig.UpdateCheckOnJoin)));
|
||||
metrics.addCustomChart(new Metrics.SimplePie("storage_type_mysql", () -> SelectConfig.Storage));
|
||||
}
|
||||
|
||||
private final Plugin plugin;
|
||||
|
||||
private final MetricsBase metricsBase;
|
||||
|
||||
/**
|
||||
* Creates a new Metrics instance.
|
||||
*
|
||||
* @param plugin Your plugin instance.
|
||||
* @param serviceId The id of the service. It can be found at <a
|
||||
* href="https://bstats.org/what-is-my-plugin-id">What is my plugin id?</a>
|
||||
*/
|
||||
public Metrics(JavaPlugin plugin, int serviceId) {
|
||||
this.plugin = plugin;
|
||||
// Get the config file
|
||||
File bStatsFolder = new File(plugin.getDataFolder().getParentFile(), "bStats");
|
||||
File configFile = new File(bStatsFolder, "config.yml");
|
||||
YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile);
|
||||
if (!config.isSet("serverUuid")) {
|
||||
config.addDefault("enabled", true);
|
||||
config.addDefault("serverUuid", UUID.randomUUID().toString());
|
||||
config.addDefault("logFailedRequests", false);
|
||||
config.addDefault("logSentData", false);
|
||||
config.addDefault("logResponseStatusText", false);
|
||||
// Inform the server owners about bStats
|
||||
config
|
||||
.options()
|
||||
.header(
|
||||
"bStats (https://bStats.org) collects some basic information for plugin authors, like how\n"
|
||||
+ "many people use their plugin and their total player count. It's recommended to keep bStats\n"
|
||||
+ "enabled, but if you're not comfortable with this, you can turn this setting off. There is no\n"
|
||||
+ "performance penalty associated with having metrics enabled, and data sent to bStats is fully\n"
|
||||
+ "anonymous.")
|
||||
.copyDefaults(true);
|
||||
try {
|
||||
config.save(configFile);
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
// Load the data
|
||||
boolean enabled = config.getBoolean("enabled", true);
|
||||
String serverUUID = config.getString("serverUuid");
|
||||
boolean logErrors = config.getBoolean("logFailedRequests", false);
|
||||
boolean logSentData = config.getBoolean("logSentData", false);
|
||||
boolean logResponseStatusText = config.getBoolean("logResponseStatusText", false);
|
||||
metricsBase =
|
||||
new MetricsBase(
|
||||
"bukkit",
|
||||
serverUUID,
|
||||
serviceId,
|
||||
enabled,
|
||||
this::appendPlatformData,
|
||||
this::appendServiceData,
|
||||
submitDataTask -> Bukkit.getScheduler().runTask(plugin, submitDataTask),
|
||||
plugin::isEnabled,
|
||||
(message, error) -> this.plugin.getLogger().log(Level.WARNING, message, error),
|
||||
(message) -> this.plugin.getLogger().log(Level.INFO, message),
|
||||
logErrors,
|
||||
logSentData,
|
||||
logResponseStatusText);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a custom chart.
|
||||
*
|
||||
* @param chart The chart to add.
|
||||
*/
|
||||
public void addCustomChart(CustomChart chart) {
|
||||
metricsBase.addCustomChart(chart);
|
||||
}
|
||||
|
||||
private void appendPlatformData(JsonObjectBuilder builder) {
|
||||
builder.appendField("playerAmount", getPlayerAmount());
|
||||
builder.appendField("onlineMode", Bukkit.getOnlineMode() ? 1 : 0);
|
||||
builder.appendField("bukkitVersion", Bukkit.getVersion());
|
||||
builder.appendField("bukkitName", Bukkit.getName());
|
||||
builder.appendField("javaVersion", System.getProperty("java.version"));
|
||||
builder.appendField("osName", System.getProperty("os.name"));
|
||||
builder.appendField("osArch", System.getProperty("os.arch"));
|
||||
builder.appendField("osVersion", System.getProperty("os.version"));
|
||||
builder.appendField("coreCount", Runtime.getRuntime().availableProcessors());
|
||||
}
|
||||
|
||||
private void appendServiceData(JsonObjectBuilder builder) {
|
||||
builder.appendField("pluginVersion", plugin.getDescription().getVersion());
|
||||
}
|
||||
|
||||
private int getPlayerAmount() {
|
||||
try {
|
||||
// Around MC 1.8 the return type was changed from an array to a collection,
|
||||
// This fixes java.lang.NoSuchMethodError:
|
||||
// org.bukkit.Bukkit.getOnlinePlayers()Ljava/util/Collection;
|
||||
Method onlinePlayersMethod = Class.forName("org.bukkit.Server").getMethod("getOnlinePlayers");
|
||||
return onlinePlayersMethod.getReturnType().equals(Collection.class)
|
||||
? ((Collection<?>) onlinePlayersMethod.invoke(Bukkit.getServer())).size()
|
||||
: ((Player[]) onlinePlayersMethod.invoke(Bukkit.getServer())).length;
|
||||
} catch (Exception e) {
|
||||
// Just use the new method if the reflection failed
|
||||
return Bukkit.getOnlinePlayers().size();
|
||||
}
|
||||
}
|
||||
|
||||
public static class MetricsBase {
|
||||
|
||||
/** The version of the Metrics class. */
|
||||
public static final String METRICS_VERSION = "2.2.1";
|
||||
|
||||
private static final ScheduledExecutorService scheduler =
|
||||
Executors.newScheduledThreadPool(1, task -> new Thread(task, "bStats-Metrics"));
|
||||
|
||||
private static final String REPORT_URL = "https://bStats.org/api/v2/data/%s";
|
||||
|
||||
private final String platform;
|
||||
|
||||
private final String serverUuid;
|
||||
|
||||
private final int serviceId;
|
||||
|
||||
private final Consumer<JsonObjectBuilder> appendPlatformDataConsumer;
|
||||
|
||||
private final Consumer<JsonObjectBuilder> appendServiceDataConsumer;
|
||||
|
||||
private final Consumer<Runnable> submitTaskConsumer;
|
||||
|
||||
private final Supplier<Boolean> checkServiceEnabledSupplier;
|
||||
|
||||
private final BiConsumer<String, Throwable> errorLogger;
|
||||
|
||||
private final Consumer<String> infoLogger;
|
||||
|
||||
private final boolean logErrors;
|
||||
|
||||
private final boolean logSentData;
|
||||
|
||||
private final boolean logResponseStatusText;
|
||||
|
||||
private final Set<CustomChart> customCharts = new HashSet<>();
|
||||
|
||||
private final boolean enabled;
|
||||
|
||||
/**
|
||||
* Creates a new MetricsBase class instance.
|
||||
*
|
||||
* @param platform The platform of the service.
|
||||
* @param serviceId The id of the service.
|
||||
* @param serverUuid The server uuid.
|
||||
* @param enabled Whether or not data sending is enabled.
|
||||
* @param appendPlatformDataConsumer A consumer that receives a {@code JsonObjectBuilder} and
|
||||
* appends all platform-specific data.
|
||||
* @param appendServiceDataConsumer A consumer that receives a {@code JsonObjectBuilder} and
|
||||
* appends all service-specific data.
|
||||
* @param submitTaskConsumer A consumer that takes a runnable with the submit task. This can be
|
||||
* used to delegate the data collection to a another thread to prevent errors caused by
|
||||
* concurrency. Can be {@code null}.
|
||||
* @param checkServiceEnabledSupplier A supplier to check if the service is still enabled.
|
||||
* @param errorLogger A consumer that accepts log message and an error.
|
||||
* @param infoLogger A consumer that accepts info log messages.
|
||||
* @param logErrors Whether or not errors should be logged.
|
||||
* @param logSentData Whether or not the sent data should be logged.
|
||||
* @param logResponseStatusText Whether or not the response status text should be logged.
|
||||
*/
|
||||
public MetricsBase(
|
||||
String platform,
|
||||
String serverUuid,
|
||||
int serviceId,
|
||||
boolean enabled,
|
||||
Consumer<JsonObjectBuilder> appendPlatformDataConsumer,
|
||||
Consumer<JsonObjectBuilder> appendServiceDataConsumer,
|
||||
Consumer<Runnable> submitTaskConsumer,
|
||||
Supplier<Boolean> checkServiceEnabledSupplier,
|
||||
BiConsumer<String, Throwable> errorLogger,
|
||||
Consumer<String> infoLogger,
|
||||
boolean logErrors,
|
||||
boolean logSentData,
|
||||
boolean logResponseStatusText) {
|
||||
this.platform = platform;
|
||||
this.serverUuid = serverUuid;
|
||||
this.serviceId = serviceId;
|
||||
this.enabled = enabled;
|
||||
this.appendPlatformDataConsumer = appendPlatformDataConsumer;
|
||||
this.appendServiceDataConsumer = appendServiceDataConsumer;
|
||||
this.submitTaskConsumer = submitTaskConsumer;
|
||||
this.checkServiceEnabledSupplier = checkServiceEnabledSupplier;
|
||||
this.errorLogger = errorLogger;
|
||||
this.infoLogger = infoLogger;
|
||||
this.logErrors = logErrors;
|
||||
this.logSentData = logSentData;
|
||||
this.logResponseStatusText = logResponseStatusText;
|
||||
checkRelocation();
|
||||
if (enabled) {
|
||||
startSubmitting();
|
||||
}
|
||||
}
|
||||
|
||||
public void addCustomChart(CustomChart chart) {
|
||||
this.customCharts.add(chart);
|
||||
}
|
||||
|
||||
private void startSubmitting() {
|
||||
final Runnable submitTask =
|
||||
() -> {
|
||||
if (!enabled || !checkServiceEnabledSupplier.get()) {
|
||||
// Submitting data or service is disabled
|
||||
scheduler.shutdown();
|
||||
return;
|
||||
}
|
||||
if (submitTaskConsumer != null) {
|
||||
submitTaskConsumer.accept(this::submitData);
|
||||
} else {
|
||||
this.submitData();
|
||||
}
|
||||
};
|
||||
// Many servers tend to restart at a fixed time at xx:00 which causes an uneven distribution
|
||||
// of requests on the
|
||||
// bStats backend. To circumvent this problem, we introduce some randomness into the initial
|
||||
// and second delay.
|
||||
// WARNING: You must not modify and part of this Metrics class, including the submit delay or
|
||||
// frequency!
|
||||
// WARNING: Modifying this code will get your plugin banned on bStats. Just don't do it!
|
||||
long initialDelay = (long) (1000 * 60 * (3 + Math.random() * 3));
|
||||
long secondDelay = (long) (1000 * 60 * (Math.random() * 30));
|
||||
scheduler.schedule(submitTask, initialDelay, TimeUnit.MILLISECONDS);
|
||||
scheduler.scheduleAtFixedRate(
|
||||
submitTask, initialDelay + secondDelay, 1000 * 60 * 30, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
private void submitData() {
|
||||
final JsonObjectBuilder baseJsonBuilder = new JsonObjectBuilder();
|
||||
appendPlatformDataConsumer.accept(baseJsonBuilder);
|
||||
final JsonObjectBuilder serviceJsonBuilder = new JsonObjectBuilder();
|
||||
appendServiceDataConsumer.accept(serviceJsonBuilder);
|
||||
JsonObjectBuilder.JsonObject[] chartData =
|
||||
customCharts.stream()
|
||||
.map(customChart -> customChart.getRequestJsonObject(errorLogger, logErrors))
|
||||
.filter(Objects::nonNull)
|
||||
.toArray(JsonObjectBuilder.JsonObject[]::new);
|
||||
serviceJsonBuilder.appendField("id", serviceId);
|
||||
serviceJsonBuilder.appendField("customCharts", chartData);
|
||||
baseJsonBuilder.appendField("service", serviceJsonBuilder.build());
|
||||
baseJsonBuilder.appendField("serverUUID", serverUuid);
|
||||
baseJsonBuilder.appendField("metricsVersion", METRICS_VERSION);
|
||||
JsonObjectBuilder.JsonObject data = baseJsonBuilder.build();
|
||||
scheduler.execute(
|
||||
() -> {
|
||||
try {
|
||||
// Send the data
|
||||
sendData(data);
|
||||
} catch (Exception e) {
|
||||
// Something went wrong! :(
|
||||
if (logErrors) {
|
||||
errorLogger.accept("Could not submit bStats metrics data", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sendData(JsonObjectBuilder.JsonObject data) throws Exception {
|
||||
if (logSentData) {
|
||||
infoLogger.accept("Sent bStats metrics data: " + data.toString());
|
||||
}
|
||||
String url = String.format(REPORT_URL, platform);
|
||||
HttpsURLConnection connection = (HttpsURLConnection) new URL(url).openConnection();
|
||||
// Compress the data to save bandwidth
|
||||
byte[] compressedData = compress(data.toString());
|
||||
connection.setRequestMethod("POST");
|
||||
connection.addRequestProperty("Accept", "application/json");
|
||||
connection.addRequestProperty("Connection", "close");
|
||||
connection.addRequestProperty("Content-Encoding", "gzip");
|
||||
connection.addRequestProperty("Content-Length", String.valueOf(compressedData.length));
|
||||
connection.setRequestProperty("Content-Type", "application/json");
|
||||
connection.setRequestProperty("User-Agent", "Metrics-Service/1");
|
||||
connection.setDoOutput(true);
|
||||
try (DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream())) {
|
||||
outputStream.write(compressedData);
|
||||
}
|
||||
StringBuilder builder = new StringBuilder();
|
||||
try (BufferedReader bufferedReader =
|
||||
new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
|
||||
String line;
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
builder.append(line);
|
||||
}
|
||||
}
|
||||
if (logResponseStatusText) {
|
||||
infoLogger.accept("Sent data to bStats and received response: " + builder);
|
||||
}
|
||||
}
|
||||
|
||||
/** Checks that the class was properly relocated. */
|
||||
private void checkRelocation() {
|
||||
// You can use the property to disable the check in your test environment
|
||||
if (System.getProperty("bstats.relocatecheck") == null
|
||||
|| !System.getProperty("bstats.relocatecheck").equals("false")) {
|
||||
// Maven's Relocate is clever and changes strings, too. So we have to use this little
|
||||
// "trick" ... :D
|
||||
final String defaultPackage =
|
||||
new String(new byte[] {'o', 'r', 'g', '.', 'b', 's', 't', 'a', 't', 's'});
|
||||
final String examplePackage =
|
||||
new String(new byte[] {'y', 'o', 'u', 'r', '.', 'p', 'a', 'c', 'k', 'a', 'g', 'e'});
|
||||
// We want to make sure no one just copy & pastes the example and uses the wrong package
|
||||
// names
|
||||
if (MetricsBase.class.getPackage().getName().startsWith(defaultPackage)
|
||||
|| MetricsBase.class.getPackage().getName().startsWith(examplePackage)) {
|
||||
throw new IllegalStateException("bStats Metrics class has not been relocated correctly!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gzips the given string.
|
||||
*
|
||||
* @param str The string to gzip.
|
||||
* @return The gzipped string.
|
||||
*/
|
||||
private static byte[] compress(final String str) throws IOException {
|
||||
if (str == null) {
|
||||
return null;
|
||||
}
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
try (GZIPOutputStream gzip = new GZIPOutputStream(outputStream)) {
|
||||
gzip.write(str.getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
}
|
||||
|
||||
public static class AdvancedBarChart extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, int[]>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public AdvancedBarChart(String chartId, Callable<Map<String, int[]>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, int[]> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, int[]> entry : map.entrySet()) {
|
||||
if (entry.getValue().length == 0) {
|
||||
// Skip this invalid
|
||||
continue;
|
||||
}
|
||||
allSkipped = false;
|
||||
valuesBuilder.appendField(entry.getKey(), entry.getValue());
|
||||
}
|
||||
if (allSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class SimpleBarChart extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Integer>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public SimpleBarChart(String chartId, Callable<Map<String, Integer>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Integer> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||
valuesBuilder.appendField(entry.getKey(), new int[] {entry.getValue()});
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class MultiLineChart extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Integer>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public MultiLineChart(String chartId, Callable<Map<String, Integer>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Integer> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||
if (entry.getValue() == 0) {
|
||||
// Skip this invalid
|
||||
continue;
|
||||
}
|
||||
allSkipped = false;
|
||||
valuesBuilder.appendField(entry.getKey(), entry.getValue());
|
||||
}
|
||||
if (allSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class AdvancedPie extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Integer>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public AdvancedPie(String chartId, Callable<Map<String, Integer>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Integer> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, Integer> entry : map.entrySet()) {
|
||||
if (entry.getValue() == 0) {
|
||||
// Skip this invalid
|
||||
continue;
|
||||
}
|
||||
allSkipped = false;
|
||||
valuesBuilder.appendField(entry.getKey(), entry.getValue());
|
||||
}
|
||||
if (allSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
public abstract static class CustomChart {
|
||||
|
||||
private final String chartId;
|
||||
|
||||
protected CustomChart(String chartId) {
|
||||
if (chartId == null) {
|
||||
throw new IllegalArgumentException("chartId must not be null");
|
||||
}
|
||||
this.chartId = chartId;
|
||||
}
|
||||
|
||||
public JsonObjectBuilder.JsonObject getRequestJsonObject(
|
||||
BiConsumer<String, Throwable> errorLogger, boolean logErrors) {
|
||||
JsonObjectBuilder builder = new JsonObjectBuilder();
|
||||
builder.appendField("chartId", chartId);
|
||||
try {
|
||||
JsonObjectBuilder.JsonObject data = getChartData();
|
||||
if (data == null) {
|
||||
// If the data is null we don't send the chart.
|
||||
return null;
|
||||
}
|
||||
builder.appendField("data", data);
|
||||
} catch (Throwable t) {
|
||||
if (logErrors) {
|
||||
errorLogger.accept("Failed to get data for custom chart with id " + chartId, t);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
protected abstract JsonObjectBuilder.JsonObject getChartData() throws Exception;
|
||||
}
|
||||
|
||||
public static class SingleLineChart extends CustomChart {
|
||||
|
||||
private final Callable<Integer> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public SingleLineChart(String chartId, Callable<Integer> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
int value = callable.call();
|
||||
if (value == 0) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("value", value).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class SimplePie extends CustomChart {
|
||||
|
||||
private final Callable<String> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public SimplePie(String chartId, Callable<String> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
String value = callable.call();
|
||||
if (value == null || value.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("value", value).build();
|
||||
}
|
||||
}
|
||||
|
||||
public static class DrilldownPie extends CustomChart {
|
||||
|
||||
private final Callable<Map<String, Map<String, Integer>>> callable;
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*
|
||||
* @param chartId The id of the chart.
|
||||
* @param callable The callable which is used to request the chart data.
|
||||
*/
|
||||
public DrilldownPie(String chartId, Callable<Map<String, Map<String, Integer>>> callable) {
|
||||
super(chartId);
|
||||
this.callable = callable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonObjectBuilder.JsonObject getChartData() throws Exception {
|
||||
JsonObjectBuilder valuesBuilder = new JsonObjectBuilder();
|
||||
Map<String, Map<String, Integer>> map = callable.call();
|
||||
if (map == null || map.isEmpty()) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
boolean reallyAllSkipped = true;
|
||||
for (Map.Entry<String, Map<String, Integer>> entryValues : map.entrySet()) {
|
||||
JsonObjectBuilder valueBuilder = new JsonObjectBuilder();
|
||||
boolean allSkipped = true;
|
||||
for (Map.Entry<String, Integer> valueEntry : map.get(entryValues.getKey()).entrySet()) {
|
||||
valueBuilder.appendField(valueEntry.getKey(), valueEntry.getValue());
|
||||
allSkipped = false;
|
||||
}
|
||||
if (!allSkipped) {
|
||||
reallyAllSkipped = false;
|
||||
valuesBuilder.appendField(entryValues.getKey(), valueBuilder.build());
|
||||
}
|
||||
}
|
||||
if (reallyAllSkipped) {
|
||||
// Null = skip the chart
|
||||
return null;
|
||||
}
|
||||
return new JsonObjectBuilder().appendField("values", valuesBuilder.build()).build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An extremely simple JSON builder.
|
||||
*
|
||||
* <p>While this class is neither feature-rich nor the most performant one, it's sufficient enough
|
||||
* for its use-case.
|
||||
*/
|
||||
public static class JsonObjectBuilder {
|
||||
|
||||
private StringBuilder builder = new StringBuilder();
|
||||
|
||||
private boolean hasAtLeastOneField = false;
|
||||
|
||||
public JsonObjectBuilder() {
|
||||
builder.append("{");
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a null field to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendNull(String key) {
|
||||
appendFieldUnescaped(key, "null");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a string field to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param value The value of the field.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, String value) {
|
||||
if (value == null) {
|
||||
throw new IllegalArgumentException("JSON value must not be null");
|
||||
}
|
||||
appendFieldUnescaped(key, "\"" + escape(value) + "\"");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an integer field to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param value The value of the field.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, int value) {
|
||||
appendFieldUnescaped(key, String.valueOf(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an object to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param object The object.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, JsonObject object) {
|
||||
if (object == null) {
|
||||
throw new IllegalArgumentException("JSON object must not be null");
|
||||
}
|
||||
appendFieldUnescaped(key, object.toString());
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a string array to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param values The string array.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, String[] values) {
|
||||
if (values == null) {
|
||||
throw new IllegalArgumentException("JSON values must not be null");
|
||||
}
|
||||
String escapedValues =
|
||||
Arrays.stream(values)
|
||||
.map(value -> "\"" + escape(value) + "\"")
|
||||
.collect(Collectors.joining(","));
|
||||
appendFieldUnescaped(key, "[" + escapedValues + "]");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an integer array to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param values The integer array.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, int[] values) {
|
||||
if (values == null) {
|
||||
throw new IllegalArgumentException("JSON values must not be null");
|
||||
}
|
||||
String escapedValues =
|
||||
Arrays.stream(values).mapToObj(String::valueOf).collect(Collectors.joining(","));
|
||||
appendFieldUnescaped(key, "[" + escapedValues + "]");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends an object array to the JSON.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param values The integer array.
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
public JsonObjectBuilder appendField(String key, JsonObject[] values) {
|
||||
if (values == null) {
|
||||
throw new IllegalArgumentException("JSON values must not be null");
|
||||
}
|
||||
String escapedValues =
|
||||
Arrays.stream(values).map(JsonObject::toString).collect(Collectors.joining(","));
|
||||
appendFieldUnescaped(key, "[" + escapedValues + "]");
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Appends a field to the object.
|
||||
*
|
||||
* @param key The key of the field.
|
||||
* @param escapedValue The escaped value of the field.
|
||||
*/
|
||||
private void appendFieldUnescaped(String key, String escapedValue) {
|
||||
if (builder == null) {
|
||||
throw new IllegalStateException("JSON has already been built");
|
||||
}
|
||||
if (key == null) {
|
||||
throw new IllegalArgumentException("JSON key must not be null");
|
||||
}
|
||||
if (hasAtLeastOneField) {
|
||||
builder.append(",");
|
||||
}
|
||||
builder.append("\"").append(escape(key)).append("\":").append(escapedValue);
|
||||
hasAtLeastOneField = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds the JSON string and invalidates this builder.
|
||||
*
|
||||
* @return The built JSON string.
|
||||
*/
|
||||
public JsonObject build() {
|
||||
if (builder == null) {
|
||||
throw new IllegalStateException("JSON has already been built");
|
||||
}
|
||||
JsonObject object = new JsonObject(builder.append("}").toString());
|
||||
builder = null;
|
||||
return object;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes the given string like stated in https://www.ietf.org/rfc/rfc4627.txt.
|
||||
*
|
||||
* <p>This method escapes only the necessary characters '"', '\'. and '\u0000' - '\u001F'.
|
||||
* Compact escapes are not used (e.g., '\n' is escaped as "\u000a" and not as "\n").
|
||||
*
|
||||
* @param value The value to escape.
|
||||
* @return The escaped value.
|
||||
*/
|
||||
private static String escape(String value) {
|
||||
final StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
char c = value.charAt(i);
|
||||
if (c == '"') {
|
||||
builder.append("\\\"");
|
||||
} else if (c == '\\') {
|
||||
builder.append("\\\\");
|
||||
} else if (c <= '\u000F') {
|
||||
builder.append("\\u000").append(Integer.toHexString(c));
|
||||
} else if (c <= '\u001F') {
|
||||
builder.append("\\u00").append(Integer.toHexString(c));
|
||||
} else {
|
||||
builder.append(c);
|
||||
}
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* A super simple representation of a JSON object.
|
||||
*
|
||||
* <p>This class only exists to make methods of the {@link JsonObjectBuilder} type-safe and not
|
||||
* allow a raw string inputs for methods like {@link JsonObjectBuilder#appendField(String,
|
||||
* JsonObject)}.
|
||||
*/
|
||||
public static class JsonObject {
|
||||
|
||||
private final String value;
|
||||
|
||||
private JsonObject(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
|
||||
import de.jatitv.commandguiv2.Spigot.Objekte.Slot;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.permissions.Permission;
|
||||
|
||||
public class RegisterPermissions {
|
||||
public static void onPermRegister() {
|
||||
for (Object gui : Main.guiHashMap.values()) {
|
||||
if (Bukkit.getPluginManager().getPermission("commandgui.command." + gui.Command_Command) == null) {
|
||||
Bukkit.getPluginManager().addPermission(new Permission("commandgui.command." + gui.Command_Command));
|
||||
}
|
||||
for (Slot slot : gui.GUI_Slots) {
|
||||
if (Bukkit.getPluginManager().getPermission("commandgui." + gui.Command_Command + ".slot." + (slot.Slot + 1)) == null) {
|
||||
Bukkit.getPluginManager().addPermission(new Permission("commandgui." + gui.Command_Command + ".slot." + (slot.Slot + 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,191 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system.config;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class DefaultGUICreate {
|
||||
|
||||
private static Boolean GUI_Enable = true;
|
||||
private static Integer GUI_Lines = 1;
|
||||
private static String GUI_Name = "&5default &9GUI";
|
||||
private static Boolean GUI_FillItem_Enable = true;
|
||||
private static Integer GUI_FillItem_Item_1_8 = 15;
|
||||
private static String GUI_FillItem_Item = "BLACK_STAINED_GLASS_PANE";
|
||||
|
||||
private static Boolean Command_Alias = true;
|
||||
private static Boolean Command_Permission = true;
|
||||
|
||||
private static Integer slot = 5;
|
||||
private static Boolean enable = true;
|
||||
private static Boolean ItemEmty = false;
|
||||
private static Integer ItemAmout = 1;
|
||||
private static Boolean Playerhead_enable = true;
|
||||
private static Boolean base64_Enable = true;
|
||||
private static String base64value = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg3M2MxMmJmZmI1MjUxYTBiODhkNWFlNzVjNzI0N2NiMzlhNzVmZjFhODFjYmU0YzhhMzliMzExZGRlZGEifX19";
|
||||
private static Boolean PlayerWhoHasOpenedTheGUI = false;
|
||||
private static String PlayerName = "";
|
||||
private static String Item = "";
|
||||
private static String Itemname = "&3Support Discord";
|
||||
private static List ItemLore = Arrays.asList(
|
||||
"&8-----------------",
|
||||
"&bIf you need help setting up the plugin,",
|
||||
"&bfeel free to contact me on the Suport Discord.",
|
||||
"&8-----------------",
|
||||
"&eIf you find any errors or bugs,",
|
||||
"&eplease contact me so I can fix them.",
|
||||
"&8-----------------",
|
||||
"&5Discord: §7https://discord.gg/vRyXFFterJ");
|
||||
private static Boolean CustomSound = false;
|
||||
private static Boolean CustomSound_NoSound = false;
|
||||
private static String CustomSound_Sound = "";
|
||||
private static Boolean Cost = false;
|
||||
private static Double Cost_Price = 0.0;
|
||||
private static Boolean Command = false;
|
||||
private static Boolean BungeeCommand = false;
|
||||
private static Boolean CommandAsConsole = false;
|
||||
private static List Commands = Arrays.asList();
|
||||
private static Boolean Server_Change = false;
|
||||
private static String Server_Change_Server = "";
|
||||
private static Boolean OpenGUI = false;
|
||||
private static String OpenGUI_GUI = "";
|
||||
private static Boolean Message = true;
|
||||
private static List Messages = Arrays.asList("&6You can find more information on Discord: &ehttps://discord.gg/vRyXFFterJ");
|
||||
private static Boolean Permission = false;
|
||||
|
||||
private static Boolean SetConfig_Enable = false;
|
||||
private static String SetConfig_FilePath = "";
|
||||
private static String SetConfig_OptionPath = "";
|
||||
private static String SetConfig_OptionPremat = "String";
|
||||
|
||||
private static String SetConfig_ValueLeftString = "";
|
||||
private static Boolean SetConfig_ValueLeftBoolean = false;
|
||||
private static Integer SetConfig_ValueLeftInteger = 0;
|
||||
private static Double SetConfig_ValueLeftDouble = 0.0;
|
||||
private static List SetConfig_ValueLeftList = Arrays.asList();
|
||||
|
||||
private static String SetConfig_ValueRightString = "";
|
||||
private static Boolean SetConfig_ValueRightBoolean = false;
|
||||
private static Integer SetConfig_ValueRightInteger = 0;
|
||||
private static Double SetConfig_ValueRightDouble = 0.0;
|
||||
private static List SetConfig_ValueRightList = Arrays.asList();
|
||||
|
||||
private static Boolean SetConfig_PluginReloadEnable = false;
|
||||
private static String SetConfig_PluginReloadCommand = "";
|
||||
|
||||
|
||||
|
||||
public static void configCreate() {
|
||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||
send.console(Main.prefix + " §4Default GUI file (GUIs/default.yml) is loaded...");
|
||||
File config = new File(Main.getPath(), "GUIs/default.yml");
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
set("GUI.Enable", GUI_Enable, yamlConfiguration);
|
||||
set("GUI.Lines", GUI_Lines, yamlConfiguration);
|
||||
set("GUI.Name", GUI_Name, yamlConfiguration);
|
||||
set("GUI.FillItem.Enable", GUI_FillItem_Enable, yamlConfiguration);
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
set("GUI.FillItem.GlassPaneCollor", GUI_FillItem_Item_1_8, yamlConfiguration);
|
||||
} else set("GUI.FillItem.Item", GUI_FillItem_Item, yamlConfiguration);
|
||||
|
||||
set("Command.Alias", Command_Alias, yamlConfiguration);
|
||||
set("Command.Permission.Required", Command_Permission, yamlConfiguration);
|
||||
set("Slots.Example.Slot", slot, yamlConfiguration);
|
||||
set("Slots.Example.Enable", enable, yamlConfiguration);
|
||||
set("Slots.Example.Item.Empty", ItemEmty, yamlConfiguration);
|
||||
set("Slots.Example.Item.Amount", ItemAmout, yamlConfiguration);
|
||||
if (!(MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12)) {
|
||||
set("Slots.Example.Item.PlayerHead.Enable", Playerhead_enable, yamlConfiguration);
|
||||
set("Slots.Example.Item.PlayerHead.Base64.Enable", base64_Enable, yamlConfiguration);
|
||||
set("Slots.Example.Item.PlayerHead.Base64.Base64Value", base64value, yamlConfiguration);
|
||||
set("Slots.Example.Item.PlayerHead.PlayerWhoHasOpenedTheGUI", PlayerWhoHasOpenedTheGUI, yamlConfiguration);
|
||||
set("Slots.Example.Item.PlayerHead.PlayerName", PlayerName, yamlConfiguration);
|
||||
}
|
||||
if (MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
set("Slots.Example.Item.Material", "TNT", yamlConfiguration);
|
||||
} else set("Slots.Example.Item.Material", Item, yamlConfiguration);
|
||||
set("Slots.Example.Item.Name", Itemname, yamlConfiguration);
|
||||
set("Slots.Example.Item.Lore", ItemLore, yamlConfiguration);
|
||||
set("Slots.Example.CustomSound.Enable", CustomSound, yamlConfiguration);
|
||||
set("Slots.Example.CustomSound.NoSound", CustomSound_NoSound, yamlConfiguration);
|
||||
set("Slots.Example.CustomSound.Sound", CustomSound_Sound, yamlConfiguration);
|
||||
set("Slots.Example.Cost.Enable", Cost, yamlConfiguration);
|
||||
set("Slots.Example.Cost.Price", Cost_Price, yamlConfiguration);
|
||||
set("Slots.Example.Command.Enable", Command, yamlConfiguration);
|
||||
set("Slots.Example.Command.BungeeCommand", BungeeCommand, yamlConfiguration);
|
||||
set("Slots.Example.Command.CommandAsConsole", CommandAsConsole, yamlConfiguration);
|
||||
set("Slots.Example.Command.Command", Commands, yamlConfiguration);
|
||||
set("Slots.Example.ServerChange.Enable", Server_Change, yamlConfiguration);
|
||||
set("Slots.Example.ServerChange.Server", Server_Change_Server, yamlConfiguration);
|
||||
set("Slots.Example.OpenGUI.Enable", OpenGUI, yamlConfiguration);
|
||||
set("Slots.Example.OpenGUI.GUI", OpenGUI_GUI, yamlConfiguration);
|
||||
set("Slots.Example.Message.Enable", Message, yamlConfiguration);
|
||||
set("Slots.Example.Message.Message", Messages, yamlConfiguration);
|
||||
set("Slots.Example.Permission.Required", Permission, yamlConfiguration);
|
||||
|
||||
set("Slots.Example.SetConfig.Enable", SetConfig_Enable, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.File.Path", SetConfig_FilePath, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Option.Path", SetConfig_OptionPath, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Option.Premat", SetConfig_OptionPremat, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Value.LeftClick.String", SetConfig_ValueLeftString, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Value.LeftClick.Boolean", SetConfig_ValueLeftBoolean, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Value.LeftClick.Integer", SetConfig_ValueLeftInteger, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Value.LeftClick.Double", SetConfig_ValueLeftDouble, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Value.LeftClick.List", SetConfig_ValueLeftList, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Value.RightClick.String", SetConfig_ValueRightString, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Value.RightClick.Boolean", SetConfig_ValueRightBoolean, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Value.RightClick.Integer", SetConfig_ValueRightInteger, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Value.RightClick.Double", SetConfig_ValueRightDouble, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.Value.RightClick.List", SetConfig_ValueRightList, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.PluginReload.Enable", SetConfig_PluginReloadEnable, yamlConfiguration);
|
||||
set("Slots.Example.SetConfig.PluginReload.Command", SetConfig_PluginReloadCommand, yamlConfiguration);
|
||||
|
||||
|
||||
try {
|
||||
yamlConfiguration.save(config);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
send.console(Main.prefix + " §2Default GUI file (GUIs/default.yml) was loaded." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
}
|
||||
|
||||
private static void set(String path, String value, YamlConfiguration config) {
|
||||
if (!config.contains(path)) {
|
||||
config.set(path, value);
|
||||
}
|
||||
}
|
||||
|
||||
private static void set(String path, Integer value, YamlConfiguration config) {
|
||||
if (!config.contains(path)) {
|
||||
config.set(path, value);
|
||||
}
|
||||
}
|
||||
|
||||
private static void set(String path, Boolean value, YamlConfiguration config) {
|
||||
if (!config.contains(path)) {
|
||||
config.set(path, value);
|
||||
}
|
||||
}
|
||||
|
||||
private static void set(String path, List value, YamlConfiguration config) {
|
||||
if (!config.contains(path)) {
|
||||
config.set(path, value);
|
||||
}
|
||||
}
|
||||
|
||||
private static void set(String path, Double value, YamlConfiguration config) {
|
||||
if (!config.contains(path)) {
|
||||
config.set(path, value);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,226 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system.config.config;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import net.t2code.lib.Spigot.Lib.yamlConfiguration.Config;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class ConfigCreate {
|
||||
|
||||
private static String prefix = Util.Prefix;
|
||||
|
||||
public static Integer ConfigVersion = 2;
|
||||
|
||||
private static Boolean UpdateCheckOnJoin = true;
|
||||
private static Boolean Debug = false;
|
||||
private static Boolean HelpAlias = true;
|
||||
private static String language = "english";
|
||||
private static String Currency = "$";
|
||||
private static String DefaultGUI = "default";
|
||||
|
||||
|
||||
private static String Storage = "YML";
|
||||
private static String ip = "localhost";
|
||||
private static Integer port = 3306;
|
||||
private static String database = "database";
|
||||
private static String user = "root";
|
||||
private static String password = "password";
|
||||
private static Boolean SSL = false;
|
||||
|
||||
private static Boolean Bungee = false;
|
||||
private static String thisServer = "server";
|
||||
|
||||
|
||||
private static Boolean UseItem_Enable = true;
|
||||
private static Boolean UseItem_AllowToggle = true;
|
||||
private static Boolean UseItem_AllowSetSlot = true;
|
||||
private static Boolean UseItem_BlockMoveAndDrop = true;
|
||||
private static String UseItem_OpenGUI = "default";
|
||||
private static Boolean UseItem_Permission = true;
|
||||
private static Boolean UseItem_KeepAtCommandClear = true;
|
||||
|
||||
private static Integer UseItem_InventorySlot = 1;
|
||||
private static Boolean UseItem_InventorySlotEnforce = false;
|
||||
private static Boolean UseItem_InventorySlot_FreeSlot = false;
|
||||
private static String UseItem_Material = "paper";
|
||||
private static Boolean UseItem_PlayerHead_Enable = false;
|
||||
private static Boolean base64_Enable = false;
|
||||
private static String base64value= "";
|
||||
private static Boolean UseItem_PlayerWhoHasOpenedTheGUI = false;
|
||||
private static String UseItem_PlayerName = "";
|
||||
private static String UseItem_Name = "&bDefault &6GUI";
|
||||
private static List UseItem_Lore = Arrays.asList("&eThis is an example GUI");
|
||||
private static Boolean UseItem_GiveOnEveryJoin = true;
|
||||
private static Boolean UseItem_GiveOnlyOnFirstJoin = false;
|
||||
private static Boolean Cursor_ToGUIItem_OnLogin = true;
|
||||
private static Boolean Cursor_ToGUIItem_OnlyOnFirstLogin = true;
|
||||
private static Boolean Cursor_ServerChange_EXPERIMENTELL = false;
|
||||
|
||||
private static int UseItemGameModeChangeDelayInTicks = 1;
|
||||
private static boolean UseItemGameModeChangeDisableInSpectator = true;
|
||||
|
||||
private static Boolean Sound_Enable = true;
|
||||
|
||||
private static Boolean Sound_OpenInventory_Enable = true;
|
||||
public static String Sound_OpenInventory_1_8 = "CHEST_OPEN";
|
||||
public static String Sound_OpenInventory_ab_1_9 = "BLOCK_CHEST_OPEN";
|
||||
|
||||
private static Boolean Sound_Click_Enable = true;
|
||||
public static String Sound_Click_1_8 = "NOTE_STICKS";
|
||||
public static String Sound_Click_1_9_bis_1_12 = "BLOCK_NOTE_HAT";
|
||||
public static String Sound_Click_ab_1_13 = "BLOCK_NOTE_BLOCK_HAT";
|
||||
|
||||
private static Boolean Sound_NoMoney_Enable = true;
|
||||
public static String Sound_NoMoney_1_8 = "NOTE_PIANO";
|
||||
public static String Sound_NoMoney_1_9_bis_1_12 = "BLOCK_NOTE_HARP";
|
||||
public static String Sound_NoMoney_ab_1_13 = "BLOCK_NOTE_BLOCK_HARP";
|
||||
|
||||
private static Boolean Sound_NoInventorySpace_Enable = true;
|
||||
public static String Sound_NoInventorySpace_1_8 = "NOTE_PIANO";
|
||||
public static String Sound_NoInventorySpace_1_9_bis_1_12 = "BLOCK_NOTE_HARP";
|
||||
public static String Sound_NoInventorySpace_ab_1_13 = "BLOCK_NOTE_BLOCK_HARP";
|
||||
|
||||
private static Boolean Sound_Give_Enable = true;
|
||||
public static String Sound_Give_1_8 = "LEVEL_UP";
|
||||
public static String Sound_Give_ab_1_9 = "ENTITY_PLAYER_LEVELUP";
|
||||
|
||||
private static Boolean Sound_PlayerNotFound_Enable = true;
|
||||
public static String Sound_PlayerNotFound_1_8 = "NOTE_PIANO";
|
||||
public static String Sound_PlayerNotFound_1_9_bis_1_12 = "BLOCK_NOTE_HARP";
|
||||
public static String Sound_PlayerNotFound_ab_1_13 = "BLOCK_NOTE_BLOCK_HARP";
|
||||
|
||||
|
||||
public static void configCreate() {
|
||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||
if (new File(Main.getPath(), "config.yml").exists()){
|
||||
if (Main.plugin.getConfig().getBoolean("Plugin.Debug")) send.console(Main.prefix + " §5DEBUG: §6" + " §4config.yml are created / updated...");
|
||||
} else send.console(Main.prefix + " §4config.yml are created...");
|
||||
|
||||
|
||||
File config = new File(Main.getPath(), "config.yml");
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
yamlConfiguration.set("ConfigVersion", ConfigVersion);
|
||||
|
||||
Config.set("Plugin.UpdateCheckOnJoin", UpdateCheckOnJoin, yamlConfiguration);
|
||||
Config.set("Plugin.Debug", Debug, yamlConfiguration);
|
||||
Config.set("Plugin.HelpAlias", HelpAlias, yamlConfiguration);
|
||||
Config.set("Plugin.language", language, yamlConfiguration);
|
||||
Config.set("Plugin.Currency", Currency, yamlConfiguration);
|
||||
Config.set("Plugin.DefaultGUI", DefaultGUI, yamlConfiguration);
|
||||
|
||||
Config.set("Storage.Type", Storage, yamlConfiguration);
|
||||
Config.set("Storage.MySQL.IP", ip, yamlConfiguration);
|
||||
Config.set("Storage.MySQL.Port", port, yamlConfiguration);
|
||||
Config.set("Storage.MySQL.Database", database, yamlConfiguration);
|
||||
Config.set("Storage.MySQL.User", user, yamlConfiguration);
|
||||
Config.set("Storage.MySQL.Password", password, yamlConfiguration);
|
||||
Config.set("Storage.MySQL.SSL", SSL, yamlConfiguration);
|
||||
|
||||
Config.set("BungeeCord.Enable", Bungee, yamlConfiguration);
|
||||
Config.set("BungeeCord.ThisServer", thisServer, yamlConfiguration);
|
||||
|
||||
Config.set("UseItem.Enable", UseItem_Enable, yamlConfiguration);
|
||||
Config.set("UseItem.AllowToggle", UseItem_AllowToggle, yamlConfiguration);
|
||||
Config.set("UseItem.AllowSetSlot", UseItem_AllowSetSlot, yamlConfiguration);
|
||||
Config.set("UseItem.BlockMoveAndDrop", UseItem_BlockMoveAndDrop, yamlConfiguration);
|
||||
Config.set("UseItem.OpenGUI", UseItem_OpenGUI, yamlConfiguration);
|
||||
Config.set("UseItem.Permission.NeededToUse", UseItem_Permission, yamlConfiguration);
|
||||
Config.set("UseItem.KeepAtCommandClear", UseItem_KeepAtCommandClear, yamlConfiguration);
|
||||
|
||||
Config.set("UseItem.InventorySlot.Slot", UseItem_InventorySlot, yamlConfiguration);
|
||||
Config.set("UseItem.InventorySlot.SlotEnforce", UseItem_InventorySlotEnforce, yamlConfiguration);
|
||||
Config.set("UseItem.InventorySlot.FreeSlot", UseItem_InventorySlot_FreeSlot, yamlConfiguration);
|
||||
|
||||
Config.set("UseItem.Item.Material", UseItem_Material, yamlConfiguration);
|
||||
if (!(MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12)) {
|
||||
Config.set("UseItem.Item.PlayerHead.Enable", UseItem_PlayerHead_Enable, yamlConfiguration);
|
||||
Config.set("UseItem.Item.PlayerHead.Base64.Enable", base64_Enable, yamlConfiguration);
|
||||
Config.set("UseItem.Item.PlayerHead.Base64.Base64Value", base64value, yamlConfiguration);
|
||||
Config.set("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI", UseItem_PlayerWhoHasOpenedTheGUI, yamlConfiguration);
|
||||
Config.set("UseItem.Item.PlayerHead.Playername", UseItem_PlayerName, yamlConfiguration);
|
||||
}
|
||||
Config.set("UseItem.Item.Name", UseItem_Name, yamlConfiguration);
|
||||
Config.set("UseItem.Item.Lore", UseItem_Lore, yamlConfiguration);
|
||||
Config.set("UseItem.Join.GiveOnEveryJoin", UseItem_GiveOnEveryJoin, yamlConfiguration);
|
||||
Config.set("UseItem.Join.GiveOnlyOnFirstJoin", UseItem_GiveOnlyOnFirstJoin, yamlConfiguration);
|
||||
|
||||
//convert
|
||||
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin")){
|
||||
Config.set("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin", yamlConfiguration);
|
||||
Config.set("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnEveryLogin"), yamlConfiguration);
|
||||
}
|
||||
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin")){
|
||||
Config.set("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin", yamlConfiguration);
|
||||
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnOnlyFirstLogin"), yamlConfiguration);
|
||||
}
|
||||
if (yamlConfiguration.contains("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange")){
|
||||
Config.set("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange", yamlConfiguration);
|
||||
Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.EXPERIMENTELL_ServerChange"), yamlConfiguration);
|
||||
}
|
||||
|
||||
Config.set("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable", Cursor_ToGUIItem_OnLogin, yamlConfiguration);
|
||||
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", Cursor_ToGUIItem_OnlyOnFirstLogin, yamlConfiguration);
|
||||
Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", Cursor_ServerChange_EXPERIMENTELL, yamlConfiguration);
|
||||
|
||||
Config.set("Advanced.UseItem.GameModeChange.DelayInTicks", UseItemGameModeChangeDelayInTicks, yamlConfiguration);
|
||||
Config.set("Advanced.UseItem.GameModeChange.DisableInSpectator", UseItemGameModeChangeDisableInSpectator, yamlConfiguration);
|
||||
|
||||
Config.set("Sound.Enable", Sound_Enable, yamlConfiguration);
|
||||
|
||||
Config.set("Sound.OpenInventory.Enable", Sound_OpenInventory_Enable, yamlConfiguration);
|
||||
if (MCVersion.minecraft1_8) {
|
||||
Config.set("Sound.OpenInventory.Sound", Sound_OpenInventory_1_8, yamlConfiguration);
|
||||
} else Config.set("Sound.OpenInventory.Sound", Sound_OpenInventory_ab_1_9, yamlConfiguration);
|
||||
|
||||
Config.set("Sound.Click.Enable", Sound_Click_Enable, yamlConfiguration);
|
||||
if (MCVersion.minecraft1_8) {
|
||||
Config.set("Sound.Click.Sound", Sound_Click_1_8, yamlConfiguration);
|
||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
Config.set("Sound.Click.Sound", Sound_Click_1_9_bis_1_12, yamlConfiguration);
|
||||
} else Config.set("Sound.Click.Sound", Sound_Click_ab_1_13, yamlConfiguration);
|
||||
|
||||
Config.set("Sound.NoMoney.Enable", Sound_NoMoney_Enable, yamlConfiguration);
|
||||
if (MCVersion.minecraft1_8) {
|
||||
Config.set("Sound.NoMoney.Sound", Sound_NoMoney_1_8, yamlConfiguration);
|
||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
Config.set("Sound.NoMoney.Sound", Sound_NoMoney_1_9_bis_1_12, yamlConfiguration);
|
||||
} else Config.set("Sound.NoMoney.Sound", Sound_NoMoney_ab_1_13, yamlConfiguration);
|
||||
|
||||
Config.set("Sound.NoInventorySpace.Enable", Sound_NoInventorySpace_Enable, yamlConfiguration);
|
||||
if (MCVersion.minecraft1_8) {
|
||||
Config.set("Sound.NoInventorySpace.Sound", Sound_NoInventorySpace_1_8, yamlConfiguration);
|
||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
Config.set("Sound.NoInventorySpace.Sound", Sound_NoInventorySpace_1_9_bis_1_12, yamlConfiguration);
|
||||
} else Config.set("Sound.NoInventorySpace.Sound", Sound_NoInventorySpace_ab_1_13, yamlConfiguration);
|
||||
|
||||
Config.set("Sound.Give.Enable", Sound_Give_Enable, yamlConfiguration);
|
||||
if (MCVersion.minecraft1_8) {
|
||||
Config.set("Sound.Give.Sound", Sound_Give_1_8, yamlConfiguration);
|
||||
} else Config.set("Sound.Give.Sound", Sound_Give_ab_1_9, yamlConfiguration);
|
||||
|
||||
Config.set("Sound.PlayerNotFound.Enable", Sound_PlayerNotFound_Enable, yamlConfiguration);
|
||||
if (MCVersion.minecraft1_8) {
|
||||
Config.set("Sound.PlayerNotFound.Sound", Sound_PlayerNotFound_1_8, yamlConfiguration);
|
||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
Config.set("Sound.PlayerNotFound.Sound", Sound_PlayerNotFound_1_9_bis_1_12, yamlConfiguration);
|
||||
} else Config.set("Sound.PlayerNotFound.Sound", Sound_PlayerNotFound_ab_1_13, yamlConfiguration);
|
||||
|
||||
try {
|
||||
yamlConfiguration.save(config);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
send.console(Main.prefix + " §2config.yml were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,279 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system.config.config;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||
import net.t2code.lib.Util;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
public class SelectConfig {private static String prefix = Util.Prefix;
|
||||
|
||||
public static Boolean DisableUpdateChecker;
|
||||
public static Boolean UpdateCheckOnJoin;
|
||||
public static Boolean Debug;
|
||||
public static Boolean HelpAlias;
|
||||
public static String language;
|
||||
public static String Currency;
|
||||
|
||||
public static String Storage;
|
||||
|
||||
public static Boolean Bungee;
|
||||
public static String thisServer;
|
||||
|
||||
public static String DefaultGUI;
|
||||
|
||||
public static Boolean UseItem_Enable;
|
||||
public static Boolean UseItem_AllowToggle;
|
||||
public static Boolean UseItem_AllowSetSlot;
|
||||
public static Boolean UseItem_GiveOnEveryJoin;
|
||||
public static Boolean UseItem_GiveOnlyOnFirstJoin;
|
||||
public static Boolean UseItem_ServerChange;
|
||||
public static Boolean Cursor_ToGUIItem_OnLogin;
|
||||
public static Boolean Cursor_ToGUIItem_OnlyOnFirstLogin;
|
||||
public static Boolean UseItem_BlockMoveAndDrop;
|
||||
public static String UseItem_OpenGUI;
|
||||
public static Boolean UseItem_Permission;
|
||||
public static Boolean UseItem_KeepAtCommandClear;
|
||||
|
||||
public static int UseItemGameModeChangeDelayInTicks;
|
||||
public static Boolean UseItemGameModeChangeDisableInSpectator;
|
||||
|
||||
public static Boolean UseItem_InventorySlot_FreeSlot;
|
||||
public static Integer UseItem_InventorySlot;
|
||||
public static Boolean UseItem_InventorySlotEnforce;
|
||||
public static String UseItem_Material;
|
||||
public static Boolean UseItem_PlayerHead_Enable;
|
||||
public static Boolean UseItem_Base64_Enable;
|
||||
public static String UseItem_Base64value;
|
||||
public static Boolean UseItem_PlayerWhoHasOpenedTheGUI;
|
||||
public static String UseItem_PlayerName;
|
||||
public static String UseItem_Name;
|
||||
public static List UseItem_Lore;
|
||||
|
||||
public static Boolean Sound_Enable = true;
|
||||
|
||||
public static Boolean Sound_OpenInventory_Enable = true;
|
||||
public static Sound Sound_OpenInventory;
|
||||
public static String Sound_OpenInventory_input;
|
||||
|
||||
public static Boolean Sound_Click_Enable = true;
|
||||
public static Sound Sound_Click;
|
||||
public static String Sound_Click_input;
|
||||
|
||||
public static Boolean Sound_NoMoney_Enable = true;
|
||||
public static Sound Sound_NoMoney;
|
||||
public static String Sound_NoMoney_input;
|
||||
|
||||
|
||||
public static Boolean Sound_NoInventorySpace_Enable = true;
|
||||
public static Sound Sound_NoInventorySpace;
|
||||
public static String Sound_NoInventorySpace_input;
|
||||
|
||||
public static Boolean Sound_Give_Enable = true;
|
||||
public static Sound Sound_Give;
|
||||
public static String Sound_Give_input;
|
||||
|
||||
public static Boolean Sound_PlayerNotFound_Enable = true;
|
||||
public static Sound Sound_PlayerNotFound;
|
||||
public static String Sound_PlayerNotFound_input;
|
||||
|
||||
|
||||
public static void onSelect() {
|
||||
File config = new File(Main.getPath(), "config.yml");
|
||||
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||
|
||||
if (yamlConfiguration.get("Plugin.DisableUpdateChecker") == null) {
|
||||
DisableUpdateChecker = false;
|
||||
} else DisableUpdateChecker = yamlConfiguration.getBoolean("Plugin.DisableUpdateChecker");
|
||||
UpdateCheckOnJoin = yamlConfiguration.getBoolean("Plugin.UpdateCheckOnJoin");
|
||||
Debug = yamlConfiguration.getBoolean("Plugin.Debug");
|
||||
HelpAlias = yamlConfiguration.getBoolean("Plugin.HelpAlias");
|
||||
language = yamlConfiguration.getString("Plugin.language");
|
||||
Currency = yamlConfiguration.getString("Plugin.Currency");
|
||||
DefaultGUI = yamlConfiguration.getString("Plugin.DefaultGUI");
|
||||
|
||||
Storage = yamlConfiguration.getString("Storage.Type").toUpperCase();
|
||||
|
||||
MySQL.ip = yamlConfiguration.getString("Storage.MySQL.IP");
|
||||
MySQL.port = yamlConfiguration.getInt("Storage.MySQL.Port");
|
||||
MySQL.database = yamlConfiguration.getString("Storage.MySQL.Database");
|
||||
MySQL.user = yamlConfiguration.getString("Storage.MySQL.User");
|
||||
MySQL.password = yamlConfiguration.getString("Storage.MySQL.Password");
|
||||
MySQL.SSL = yamlConfiguration.getBoolean("Storage.MySQL.SSL");
|
||||
|
||||
Bungee = yamlConfiguration.getBoolean("BungeeCord.Enable");
|
||||
thisServer = yamlConfiguration.getString("BungeeCord.ThisServer");
|
||||
|
||||
|
||||
UseItem_Enable = yamlConfiguration.getBoolean("UseItem.Enable");
|
||||
UseItem_AllowToggle = yamlConfiguration.getBoolean("UseItem.AllowToggle");
|
||||
UseItem_AllowSetSlot = yamlConfiguration.getBoolean("UseItem.AllowSetSlot");
|
||||
UseItem_BlockMoveAndDrop = yamlConfiguration.getBoolean("UseItem.BlockMoveAndDrop");
|
||||
UseItem_OpenGUI = yamlConfiguration.getString("UseItem.OpenGUI");
|
||||
UseItem_Permission = yamlConfiguration.getBoolean("UseItem.Permission.NeededToUse");
|
||||
UseItem_KeepAtCommandClear = yamlConfiguration.getBoolean("UseItem.KeepAtCommandClear");
|
||||
|
||||
UseItem_InventorySlot_FreeSlot = yamlConfiguration.getBoolean("UseItem.InventorySlot.FreeSlot");
|
||||
UseItem_InventorySlot = yamlConfiguration.getInt("UseItem.InventorySlot.Slot");
|
||||
UseItem_InventorySlotEnforce = yamlConfiguration.getBoolean("UseItem.InventorySlot.SlotEnforce");
|
||||
UseItem_Material = yamlConfiguration.getString("UseItem.Item.Material").toUpperCase();
|
||||
UseItem_PlayerHead_Enable = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.Enable");
|
||||
UseItem_Base64_Enable = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.Base64.Enable");
|
||||
UseItem_Base64value = yamlConfiguration.getString("UseItem.Item.PlayerHead.Base64.Base64Value");
|
||||
UseItem_PlayerWhoHasOpenedTheGUI = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI");
|
||||
UseItem_PlayerName = yamlConfiguration.getString("UseItem.Item.PlayerHead.PlayerName");
|
||||
UseItem_Name = Replace.replace(prefix,yamlConfiguration.getString("UseItem.Item.Name"));
|
||||
UseItem_Lore = yamlConfiguration.getList("UseItem.Item.Lore");
|
||||
UseItem_GiveOnEveryJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnEveryJoin");
|
||||
UseItem_GiveOnlyOnFirstJoin = yamlConfiguration.getBoolean("UseItem.Join.GiveOnlyOnFirstJoin");
|
||||
Cursor_ToGUIItem_OnLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.OnLogin.Enable");
|
||||
Cursor_ToGUIItem_OnlyOnFirstLogin = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Spigot.OnlyOnFirstLogin");
|
||||
UseItem_ServerChange = yamlConfiguration.getBoolean("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange");
|
||||
|
||||
UseItemGameModeChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.GameModeChange.DelayInTicks");
|
||||
UseItemGameModeChangeDisableInSpectator = yamlConfiguration.getBoolean("Advanced.UseItem.GameModeChange.DisableInSpectator");
|
||||
|
||||
Sound_Enable = yamlConfiguration.getBoolean("Sound.Enable");
|
||||
Sound_OpenInventory_Enable = yamlConfiguration.getBoolean("Sound.OpenInventory.Enable");
|
||||
Sound_OpenInventory_input = (yamlConfiguration.getString("Sound.OpenInventory.Sound").toUpperCase().replace(".", "_"));
|
||||
Sound_Click_Enable = yamlConfiguration.getBoolean("Sound.Click.Enable");
|
||||
Sound_Click_input = (yamlConfiguration.getString("Sound.Click.Sound").toUpperCase().replace(".", "_"));
|
||||
Sound_NoMoney_Enable = yamlConfiguration.getBoolean("Sound.NoMoney.Enable");
|
||||
Sound_NoMoney_input = (yamlConfiguration.getString("Sound.NoMoney.Sound").toUpperCase().replace(".", "_"));
|
||||
|
||||
Sound_NoInventorySpace_Enable = yamlConfiguration.getBoolean("Sound.NoInventorySpace.Enable");
|
||||
Sound_NoInventorySpace_input = (yamlConfiguration.getString("Sound.NoInventorySpace.Sound").toUpperCase().replace(".", "_"));
|
||||
Sound_Give_Enable = yamlConfiguration.getBoolean("Sound.Give.Enable");
|
||||
Sound_Give_input = (yamlConfiguration.getString("Sound.Give.Sound").toUpperCase().replace(".", "_"));
|
||||
Sound_PlayerNotFound_Enable = yamlConfiguration.getBoolean("Sound.PlayerNotFound.Enable");
|
||||
Sound_PlayerNotFound_input = (yamlConfiguration.getString("Sound.PlayerNotFound.Sound").toUpperCase().replace(".", "_"));
|
||||
|
||||
}
|
||||
|
||||
public static void sound(String Prefix) {
|
||||
String soundOpenInventory;
|
||||
if (MCVersion.minecraft1_8) {
|
||||
soundOpenInventory = ConfigCreate.Sound_OpenInventory_1_8;
|
||||
} else {
|
||||
soundOpenInventory = ConfigCreate.Sound_OpenInventory_ab_1_9;
|
||||
}
|
||||
|
||||
String soundClick;
|
||||
if (MCVersion.minecraft1_8) {
|
||||
soundClick = ConfigCreate.Sound_Click_1_8;
|
||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
soundClick = ConfigCreate.Sound_Click_1_9_bis_1_12;
|
||||
} else {
|
||||
soundClick = ConfigCreate.Sound_Click_ab_1_13;
|
||||
}
|
||||
|
||||
String soundNoMoney;
|
||||
if (MCVersion.minecraft1_8) {
|
||||
soundNoMoney = ConfigCreate.Sound_NoMoney_1_8;
|
||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
soundNoMoney = ConfigCreate.Sound_NoMoney_1_9_bis_1_12;
|
||||
} else {
|
||||
soundNoMoney = ConfigCreate.Sound_NoMoney_ab_1_13;
|
||||
}
|
||||
|
||||
String soundNoInventorySpace;
|
||||
if (MCVersion.minecraft1_8) {
|
||||
soundNoInventorySpace = "NOTE_PIANO";
|
||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
soundNoInventorySpace = "BLOCK_NOTE_BASS";
|
||||
} else {
|
||||
soundNoInventorySpace = "BLOCK_NOTE_BLOCK_GUITAR";
|
||||
}
|
||||
|
||||
String soundGive;
|
||||
if (MCVersion.minecraft1_8) {
|
||||
soundGive = "LEVEL_UP";
|
||||
} else {
|
||||
soundGive = "ENTITY_PLAYER_LEVELUP";
|
||||
}
|
||||
|
||||
String soundPlayerNotFound;
|
||||
if (MCVersion.minecraft1_8) {
|
||||
soundPlayerNotFound = "NOTE_PIANO";
|
||||
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
|
||||
soundPlayerNotFound = "BLOCK_NOTE_HARP";
|
||||
} else {
|
||||
soundPlayerNotFound = "BLOCK_NOTE_BLOCK_HARP";
|
||||
}
|
||||
|
||||
try {
|
||||
Sound sound_OpenInventory = Sound.valueOf(Sound_OpenInventory_input);
|
||||
if (sound_OpenInventory != null) {
|
||||
Sound_OpenInventory = sound_OpenInventory;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
.replace("[sound]", "§8OpenInventory: §6" + Sound_OpenInventory_input) + "§4\n§4\n§4\n");
|
||||
Sound_OpenInventory = Sound.valueOf(soundOpenInventory);
|
||||
}
|
||||
|
||||
try {
|
||||
Sound sound_Click = Sound.valueOf(Sound_Click_input);
|
||||
if (sound_Click != null) {
|
||||
Sound_Click = sound_Click;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
.replace("[sound]", "§8Click: §6" + Sound_Click_input) + "§4\n§4\n§4\n");
|
||||
Sound_Click = Sound.valueOf(soundClick);
|
||||
}
|
||||
|
||||
try {
|
||||
Sound sound_NoMoney = Sound.valueOf(Sound_NoMoney_input);
|
||||
if (sound_NoMoney != null) {
|
||||
Sound_Click = sound_NoMoney;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
.replace("[sound]", "§8NoMoney: §6" + Sound_NoMoney_input) + "§4\n§4\n§4\n");
|
||||
Sound_NoMoney = Sound.valueOf(soundNoMoney);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
Sound sound_NoInventorySpace = Sound.valueOf(Sound_NoInventorySpace_input);
|
||||
if (sound_NoInventorySpace != null) {
|
||||
Sound_NoInventorySpace = sound_NoInventorySpace;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
.replace("[sound]", "§8NoInventorySpace: §6" + Sound_NoInventorySpace_input) + "§4\n§4\n§4\n");
|
||||
Sound_NoInventorySpace = Sound.valueOf(soundNoInventorySpace);
|
||||
}
|
||||
|
||||
try {
|
||||
Sound sound_Give = Sound.valueOf(Sound_Give_input);
|
||||
if (sound_Give != null) {
|
||||
Sound_Give = sound_Give;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
.replace("[sound]", "§8Give: §6" + Sound_Give_input) + "§4\n§4\n§4\n");
|
||||
Sound_Give = Sound.valueOf(soundGive);
|
||||
}
|
||||
|
||||
try {
|
||||
Sound sound_PlayerNotFound = Sound.valueOf(Sound_PlayerNotFound_input);
|
||||
if (sound_PlayerNotFound != null) {
|
||||
Sound_PlayerNotFound = sound_PlayerNotFound;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
send.console("§4\n§4\n§4\n" + SelectMessages.SoundNotFound.replace("[prefix]", Prefix)
|
||||
.replace("[sound]", "§8PlayerNotFound: §6" + Sound_PlayerNotFound_input) + "§4\n§4\n§4\n");
|
||||
Sound_PlayerNotFound = Sound.valueOf(soundPlayerNotFound);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,213 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system.config.languages;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class LanguagesCreate {
|
||||
private static Plugin plugin = Main.plugin;
|
||||
|
||||
public static void langCreate() {
|
||||
send.debug(plugin,"§4Language files are created / updated...");
|
||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||
|
||||
/**
|
||||
*
|
||||
* ENGLISH
|
||||
*
|
||||
*/
|
||||
|
||||
File messagesEN = new File(Main.getPath(), "languages/english_messages.yml");
|
||||
YamlConfiguration yamlConfigurationEN = YamlConfiguration.loadConfiguration(messagesEN);
|
||||
|
||||
set("Plugin.VaultNotSetUp", MSG.EN_VaultNotSetUp, yamlConfigurationEN);
|
||||
set("Plugin.SoundNotFound", MSG.EN_SoundNotFound, yamlConfigurationEN);
|
||||
set("Plugin.OnlyForPlayer", MSG.EN_OnlyForPlayer, yamlConfigurationEN);
|
||||
set("Plugin.DefaultGUI.create", MSG.EN_DefaultGUI, yamlConfigurationEN);
|
||||
set("Plugin.Reload.Start", MSG.EN_ReloadStart, yamlConfigurationEN);
|
||||
set("Plugin.Reload.End", MSG.EN_ReloadEnd, yamlConfigurationEN);
|
||||
|
||||
set("NoPermission.ForCommandGUI", MSG.EN_NoPermission, yamlConfigurationEN);
|
||||
set("NoPermission.ForCommand", MSG.EN_NoPermissionForCommand, yamlConfigurationEN);
|
||||
set("NoPermission.ForUseItem", MSG.EN_NoPermissionForUseItem, yamlConfigurationEN);
|
||||
set("NoPermission.ForItem", MSG.EN_NoPermissionForItem, yamlConfigurationEN);
|
||||
|
||||
set("UseItem.UseItem_ON", MSG.EN_ItemON, yamlConfigurationEN);
|
||||
set("UseItem.UseItem_OFF", MSG.EN_ItemOFF, yamlConfigurationEN);
|
||||
set("UseItem.Change_Slot", MSG.EN_ItemSlot, yamlConfigurationEN);
|
||||
set("UseItem.SlotNotEmpty", MSG.EN_ItemSlotNotEmpty, yamlConfigurationEN);
|
||||
set("UseItem.SlotAlreadySet", MSG.EN_ItemSlotAlreadySet, yamlConfigurationEN);
|
||||
set("UseItem.ItemSlot_wrongValue", MSG.EN_ItemSlot_wrongValue, yamlConfigurationEN);
|
||||
|
||||
set("Cost.Buy_msg", MSG.EN_Buy_msg, yamlConfigurationEN);
|
||||
set("Cost.No_money", MSG.EN_No_money, yamlConfigurationEN);
|
||||
set("Cost.NoInventorySpace", MSG.EN_NoInventorySpace, yamlConfigurationEN);
|
||||
|
||||
set("ServerChange.onServerChange", MSG.EN_onServerChange, yamlConfigurationEN);
|
||||
|
||||
set("GUI.GUInotFound", MSG.EN_GUInotFound, yamlConfigurationEN);
|
||||
set("GUI.GUIisDisabled", MSG.EN_GUIisDisabled, yamlConfigurationEN);
|
||||
|
||||
set("Give.Sender", MSG.EN_GiveSender, yamlConfigurationEN);
|
||||
set("Give.Receiver", MSG.EN_GiveReceiver, yamlConfigurationEN);
|
||||
|
||||
set("Player.PlayerNotFond", MSG.EN_PlayerNotFond, yamlConfigurationEN);
|
||||
set("Player.PlayerNoInventorySpace", MSG.EN_PlayerNoInventorySpace, yamlConfigurationEN);
|
||||
|
||||
set("Help.CGUI", MSG.EN_Help_CGUI, yamlConfigurationEN);
|
||||
set("Help.Help", MSG.EN_Help_Help, yamlConfigurationEN);
|
||||
set("Help.Info", MSG.EN_Help_Info, yamlConfigurationEN);
|
||||
set("Help.Open", MSG.EN_Help_Open, yamlConfigurationEN);
|
||||
set("Help.Give", MSG.EN_Help_Give, yamlConfigurationEN);
|
||||
set("Help.CreateDefaultGUI", MSG.EN_Help_CreateDefaultGUI, yamlConfigurationEN);
|
||||
set("Help.Reload", MSG.EN_Help_Reload, yamlConfigurationEN);
|
||||
set("Help.UseItem_On", MSG.EN_GUIItemHelp_on, yamlConfigurationEN);
|
||||
set("Help.UseItem_Off", MSG.EN_GUIItemHelp_off, yamlConfigurationEN);
|
||||
set("Help.UseItem_Slot", MSG.EN_GUIItemHelp_Slot, yamlConfigurationEN);
|
||||
|
||||
try {
|
||||
yamlConfigurationEN.save(messagesEN);
|
||||
} catch (IOException e) {
|
||||
send.warning(plugin,e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* GERMAN
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
File messagesDE = new File(Main.getPath(), "languages/german_messages.yml");
|
||||
YamlConfiguration yamlConfigurationDE = YamlConfiguration.loadConfiguration(messagesDE);
|
||||
|
||||
set("Plugin.VaultNotSetUp", MSG.DE_VaultNotSetUp, yamlConfigurationDE);
|
||||
set("Plugin.SoundNotFound", MSG.DE_SoundNotFound, yamlConfigurationDE);
|
||||
set("Plugin.OnlyForPlayer", MSG.DE_OnlyForPlayer, yamlConfigurationDE);
|
||||
set("Plugin.DefaultGUI.create", MSG.DE_DefaultGUI, yamlConfigurationDE);
|
||||
set("Plugin.Reload.Start", MSG.DE_ReloadStart, yamlConfigurationDE);
|
||||
set("Plugin.Reload.End", MSG.DE_ReloadEnd, yamlConfigurationDE);
|
||||
|
||||
set("NoPermission.ForCommandGUI", MSG.DE_NoPermission, yamlConfigurationDE);
|
||||
set("NoPermission.ForCommand", MSG.DE_NoPermissionForCommand, yamlConfigurationDE);
|
||||
set("NoPermission.ForUseItem", MSG.DE_NoPermissionForUseItem, yamlConfigurationDE);
|
||||
set("NoPermission.ForItem", MSG.DE_NoPermissionForItem, yamlConfigurationDE);
|
||||
|
||||
set("UseItem.UseItem_ON", MSG.DE_ItemON, yamlConfigurationDE);
|
||||
set("UseItem.UseItem_OFF", MSG.DE_ItemOFF, yamlConfigurationDE);
|
||||
set("UseItem.Change_Slot", MSG.DE_ItemSlot, yamlConfigurationDE);
|
||||
set("UseItem.SlotNotEmpty", MSG.DE_ItemSlotNotEmpty, yamlConfigurationDE);
|
||||
set("UseItem.SlotAlreadySet", MSG.DE_ItemSlotAlreadySet, yamlConfigurationDE);
|
||||
set("UseItem.ItemSlot_wrongValue", MSG.DE_ItemSlot_wrongValue, yamlConfigurationDE);
|
||||
|
||||
set("Cost.Buy_msg", MSG.DE_Buy_msg, yamlConfigurationDE);
|
||||
set("Cost.No_money", MSG.DE_No_money, yamlConfigurationDE);
|
||||
set("Cost.NoInventorySpace", MSG.DE_NoInventorySpace, yamlConfigurationDE);
|
||||
|
||||
set("ServerChange.onServerChange", MSG.DE_onServerChange, yamlConfigurationDE);
|
||||
|
||||
set("GUI.GUInotFound", MSG.DE_GUInotFound, yamlConfigurationDE);
|
||||
set("GUI.GUIisDisabled", MSG.DE_GUIisDisabled, yamlConfigurationDE);
|
||||
|
||||
set("Give.Sender", MSG.DE_GiveSender, yamlConfigurationDE);
|
||||
set("Give.Receiver", MSG.DE_GiveReceiver, yamlConfigurationDE);
|
||||
|
||||
set("Player.PlayerNotFond", MSG.DE_PlayerNotFond, yamlConfigurationDE);
|
||||
set("Player.PlayerNoInventorySpace", MSG.DE_PlayerNoInventorySpace, yamlConfigurationDE);
|
||||
|
||||
set("Help.CGUI", MSG.DE_Help_CGUI, yamlConfigurationDE);
|
||||
set("Help.Help", MSG.DE_Help_Help, yamlConfigurationDE);
|
||||
set("Help.Info", MSG.DE_Help_Info, yamlConfigurationDE);
|
||||
set("Help.Open", MSG.DE_Help_Open, yamlConfigurationDE);
|
||||
set("Help.Give", MSG.DE_Help_Give, yamlConfigurationDE);
|
||||
set("Help.CreateDefaultGUI", MSG.DE_Help_CreateDefaultGUI, yamlConfigurationDE);
|
||||
set("Help.Reload", MSG.DE_Help_Reload, yamlConfigurationDE);
|
||||
set("Help.UseItem_On", MSG.DE_GUIItemHelp_on, yamlConfigurationDE);
|
||||
set("Help.UseItem_Off", MSG.DE_GUIItemHelp_off, yamlConfigurationDE);
|
||||
set("Help.UseItem_Slot", MSG.DE_GUIItemHelp_Slot, yamlConfigurationDE);
|
||||
|
||||
try {
|
||||
yamlConfigurationDE.save(messagesDE);
|
||||
} catch (IOException e) {
|
||||
send.warning(plugin,e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* norwegian
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
File messagesNO = new File(Main.getPath(), "languages/norwegian_messages.yml");
|
||||
YamlConfiguration yamlConfigurationNO = YamlConfiguration.loadConfiguration(messagesNO);
|
||||
|
||||
set("Plugin.VaultNotSetUp", MSG.NO_VaultNotSetUp, yamlConfigurationNO);
|
||||
set("Plugin.SoundNotFound", MSG.NO_SoundNotFound, yamlConfigurationNO);
|
||||
set("Plugin.OnlyForPlayer", MSG.NO_OnlyForPlayer, yamlConfigurationNO);
|
||||
set("Plugin.DefaultGUI.create", MSG.NO_DefaultGUI, yamlConfigurationNO);
|
||||
set("Plugin.Reload.Start", MSG.NO_ReloadStart, yamlConfigurationNO);
|
||||
set("Plugin.Reload.End", MSG.NO_ReloadEnd, yamlConfigurationNO);
|
||||
|
||||
set("NoPermission.ForCommandGUI", MSG.NO_NoPermission, yamlConfigurationNO);
|
||||
set("NoPermission.ForCommand", MSG.NO_NoPermissionForCommand, yamlConfigurationNO);
|
||||
set("NoPermission.ForUseItem", MSG.NO_NoPermissionForUseItem, yamlConfigurationNO);
|
||||
set("NoPermission.ForItem", MSG.NO_NoPermissionForItem, yamlConfigurationNO);
|
||||
|
||||
set("UseItem.UseItem_ON", MSG.NO_ItemON, yamlConfigurationNO);
|
||||
set("UseItem.UseItem_OFF", MSG.NO_ItemOFF, yamlConfigurationNO);
|
||||
set("UseItem.Change_Slot", MSG.NO_ItemSlot, yamlConfigurationNO);
|
||||
set("UseItem.SlotNotEmpty", MSG.NO_ItemSlotNotEmpty, yamlConfigurationNO);
|
||||
set("UseItem.SlotAlreadySet", MSG.NO_ItemSlotAlreadySet, yamlConfigurationNO);
|
||||
set("UseItem.ItemSlot_wrongValue", MSG.NO_ItemSlot_wrongValue, yamlConfigurationNO);
|
||||
|
||||
set("Cost.Buy_msg", MSG.NO_Buy_msg, yamlConfigurationNO);
|
||||
set("Cost.No_money", MSG.NO_No_money, yamlConfigurationNO);
|
||||
set("Cost.NoInventorySpace", MSG.NO_NoInventorySpace, yamlConfigurationNO);
|
||||
|
||||
set("ServerChange.onServerChange", MSG.NO_onServerChange, yamlConfigurationNO);
|
||||
|
||||
set("GUI.GUInotFound", MSG.NO_GUInotFound, yamlConfigurationNO);
|
||||
set("GUI.GUIisDisabled", MSG.NO_GUIisDisabled, yamlConfigurationNO);
|
||||
|
||||
set("Give.Sender", MSG.NO_GiveSender, yamlConfigurationNO);
|
||||
set("Give.Receiver", MSG.NO_GiveReceiver, yamlConfigurationNO);
|
||||
|
||||
set("Player.PlayerNotFond", MSG.NO_PlayerNotFond, yamlConfigurationNO);
|
||||
set("Player.PlayerNoInventorySpace", MSG.NO_PlayerNoInventorySpace, yamlConfigurationNO);
|
||||
|
||||
set("Help.CGUI", MSG.NO_Help_CGUI, yamlConfigurationNO);
|
||||
set("Help.Help", MSG.NO_Help_Help, yamlConfigurationNO);
|
||||
set("Help.Info", MSG.NO_Help_Info, yamlConfigurationNO);
|
||||
set("Help.Open", MSG.NO_Help_Open, yamlConfigurationNO);
|
||||
set("Help.Give", MSG.NO_Help_Give, yamlConfigurationNO);
|
||||
set("Help.CreateDefaultGUI", MSG.NO_Help_CreateDefaultGUI, yamlConfigurationNO);
|
||||
set("Help.Reload", MSG.NO_Help_Reload, yamlConfigurationNO);
|
||||
set("Help.UseItem_On", MSG.NO_GUIItemHelp_on, yamlConfigurationNO);
|
||||
set("Help.UseItem_Off", MSG.NO_GUIItemHelp_off, yamlConfigurationNO);
|
||||
set("Help.UseItem_Slot", MSG.NO_GUIItemHelp_Slot, yamlConfigurationNO);
|
||||
|
||||
try {
|
||||
yamlConfigurationNO.save(messagesNO);
|
||||
} catch (IOException e) {
|
||||
send.warning(plugin,e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
send.console(Main.prefix + " §2Language files were successfully created / updated." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
}
|
||||
|
||||
private static void set(String path, String value, YamlConfiguration config) {
|
||||
if (!config.contains(path)) {
|
||||
config.set(path, value);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,160 @@
|
||||
// This claas was created by JaTiTV
|
||||
|
||||
// -----------------------------
|
||||
// _____ _____ _ _ _____
|
||||
// / ____/ ____| | | |_ _|
|
||||
// | | | | __| | | | | |
|
||||
// | | | | |_ | | | | | |
|
||||
// | |___| |__| | |__| |_| |_
|
||||
// \_____\_____|\____/|_____|
|
||||
// -----------------------------
|
||||
|
||||
package de.jatitv.commandguiv2.Spigot.system.config.languages;
|
||||
|
||||
public class MSG {
|
||||
|
||||
// EN
|
||||
public static String EN_VaultNotSetUp = "[prefix] &4Vault / Economy not set up!";
|
||||
public static String EN_SoundNotFound = "[prefix] &4The sound &6[sound] &4was not found! Please check the settings.";
|
||||
public static String EN_OnlyForPlayer = "[prefix] &cThis command is for players only!";
|
||||
public static String EN_DefaultGUI = "[prefix] &2DefaultGUI was created. You can find it in the directory: &e[directory]&2!";
|
||||
public static String EN_ReloadStart = "[prefix] &6Plugin is reloaded...";
|
||||
public static String EN_ReloadEnd = "[prefix] &2Plugin was successfully reloaded.";
|
||||
|
||||
public static String EN_NoPermission = "[prefix] &cYou do not have permission for &4Command&9GUI&c!";
|
||||
public static String EN_NoPermissionForCommand = "[prefix] &cFor &b[cmd] &cyou lack the permission &6[perm]&c!";
|
||||
public static String EN_NoPermissionForUseItem = "[prefix] &cYou lack the permission &6[perm] &cto use the item for the GUI: &6[gui].";
|
||||
public static String EN_NoPermissionForItem = "[prefix] &cFor &b[item] &cyou lack the permission &6[perm]&c!";
|
||||
|
||||
public static String EN_Buy_msg = "[prefix] &2You bought [itemname] &2for &6[price]&2.";
|
||||
public static String EN_No_money = "[prefix] &cYou don't have enough money!";
|
||||
public static String EN_NoInventorySpace = "[prefix] &cYou have no room in your inventory!";
|
||||
|
||||
public static String EN_onServerChange = "[prefix] &2You will be connected to the server &e[server]§2.";
|
||||
|
||||
public static String EN_ItemON = "[prefix] &2You have activated the GUI item.";
|
||||
public static String EN_ItemOFF = "[prefix] &2You have disabled the GUI item.";
|
||||
public static String EN_ItemSlot = "[prefix] &2You have changed the GUI item to slot: &6[slot]&2.";
|
||||
public static String EN_ItemSlotNotEmpty = "[prefix] &6The slot &e[slot] &6is currently occupied!";
|
||||
public static String EN_ItemSlotAlreadySet = "[prefix] &6The slot §e[slot] §6is already set!";
|
||||
public static String EN_ItemSlot_wrongValue = "[prefix] &cThe specified slot must be between 1 and 9!";
|
||||
|
||||
public static String EN_GUInotFound = "[prefix] &cThe GUI chosen by the does not exist.";
|
||||
public static String EN_GUIisDisabled = "[prefix] &cThe GUI [gui] &cis currently Disabled!";
|
||||
|
||||
public static String EN_GiveSender = "[prefix] &2You have given &6[player] &2an [item] &2!";
|
||||
public static String EN_GiveReceiver = "[prefix] &2You got &2, [item] &2from &6[sender]!";
|
||||
|
||||
public static String EN_PlayerNotFond = "[prefix] &cThe player &6[player] &cwas not found or is not online!";
|
||||
public static String EN_PlayerNoInventorySpace = "[prefix] &6[player] &chas no free space in his inventory!";
|
||||
|
||||
public static String EN_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &eOpen the default GUI &7(&r[gui]&7)&e.";
|
||||
public static String EN_Help_Open = "&8''&b/commandgui [gui]&8'' &eOpen the GUI: &6[guiname]&e.";
|
||||
public static String EN_Help_Help = "&8''&b/commandguihelp&8'' &eOpen this help.";
|
||||
public static String EN_Help_Info = "&8''&b/commandguiadmin info&8'' &eCall the info from &4Command&9GUI &e.";
|
||||
public static String EN_Help_Give = "&8''&b/commandguiadmin give &7<player>&8'' &eGive a player the GUI item.";
|
||||
public static String EN_Help_CreateDefaultGUI = "&8''&b/commandguiadmin createdefaultgui&8'' &eCreate a default GUI &7([directory])&e.";
|
||||
public static String EN_Help_Reload = "&8''&b/commandguiadmin reload&8'' &eReload the plugin.";
|
||||
|
||||
public static String EN_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eActivate the GUIItem for you.";
|
||||
public static String EN_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDisable the GUIItem for yourself.";
|
||||
public static String EN_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSet the slot for GUIItem for you.";
|
||||
|
||||
// DE
|
||||
public static String DE_VaultNotSetUp = "[prefix] &4Vault / Economy nicht eingerichtet!";
|
||||
public static String DE_SoundNotFound = "[prefix] &4Der Sound &6[sound] &4wurde nicht gefunden! Bitte [ue]berpr[ue]fe die Einstellungen.";
|
||||
public static String DE_OnlyForPlayer = "[prefix] &cDieser Command ist nur f[ue]r Spieler!";
|
||||
public static String DE_DefaultGUI = "[prefix] &2DefaultGUI wurde erstellt. Du findst sie im Verzeichnis: &e[directory]&2!";
|
||||
public static String DE_ReloadStart = "[prefix] &6Plugin wird neu geladen...";
|
||||
public static String DE_ReloadEnd = "[prefix] &2Plugin wurde erfolgreich neu geladen.";
|
||||
|
||||
public static String DE_NoPermission = "[prefix] &cDu hast keine Permission f[ue]r &4Command&9GUI&c!";
|
||||
public static String DE_NoPermissionForCommand = "[prefix] &cF[ue]r &b[cmd] &cfehlt dir die Permission &6[perm]&c!";
|
||||
public static String DE_NoPermissionForUseItem = "[prefix] &cDir fehlt die Permission &6[perm] &cum das Item f[ue]r die GUI: &6[gui] &cnutzen zu k[oe]nnen.";
|
||||
public static String DE_NoPermissionForItem = "[prefix] &cF[ue]r &b[item] &cfehlt dir die Permission &6[perm]&c!";
|
||||
|
||||
public static String DE_ItemON = "[prefix] &2Du hast das GUI-Item aktiviert.";
|
||||
public static String DE_ItemOFF = "[prefix] &2Du hast das GUI-Item deaktiviert.";
|
||||
public static String DE_ItemSlot = "[prefix] &2Du hast das GUI-Item auf Slot &6[slot] &2umgestellt.";
|
||||
public static String DE_ItemSlotNotEmpty = "[prefix] &6Der Slot §e[slot] §6ist derzeit belegt!.";
|
||||
public static String DE_ItemSlotAlreadySet = "[prefix] &6Der Slot §e[slot] §6ist bereits eingestellt!";
|
||||
public static String DE_ItemSlot_wrongValue = "[prefix] &cDer angegebene Slot muss sich zwischen 1 und 9 befinden!";
|
||||
|
||||
public static String DE_Buy_msg = "[prefix] &2Du hast dir [itemname] &2f[ue]r &6[price] &2gekauft.";
|
||||
public static String DE_No_money = "[prefix] &cDu hast nicht gen[ue]gend Geld!";
|
||||
public static String DE_NoInventorySpace = "[prefix] &cDu hast keinen Platz in deinem Inventar!";
|
||||
|
||||
public static String DE_onServerChange = "[prefix] &2Du wirst auf den Server §e[server] §2verbunden.";
|
||||
|
||||
public static String DE_GUInotFound = "[prefix] &cDie von die gew[ae]hlte GUI gibt es nicht.";
|
||||
public static String DE_GUIisDisabled = "[prefix] &cDie GUI [gui] &cist derzeit Deaktiviert!";
|
||||
|
||||
public static String DE_GiveSender = "[prefix] &2Du hast &6[player] &2ein [item] &2gegeben!";
|
||||
public static String DE_GiveReceiver = "[prefix] &2Du hast von &6[sender] &2, [item] &2bekommen!";
|
||||
|
||||
public static String DE_PlayerNotFond = "[prefix] &cDer Spieler &6[player] &cwurde nicht gefunden oder ist nicht Online!";
|
||||
public static String DE_PlayerNoInventorySpace = "[prefix] &6[player] &chat keinen freien Platz in seinem Inventar!";
|
||||
|
||||
public static String DE_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &e[OE]ffne die default GUI &7(&r[gui]&7)&e.";
|
||||
public static String DE_Help_Open = "&8''&b/commandgui [gui]&8'' &e[OE]ffne die GUI: &6[guiname]&e.";
|
||||
public static String DE_Help_Help = "&8''&b/commandguihelp&8'' &e[OE]ffne diese help.";
|
||||
public static String DE_Help_Info = "&8''&b/commandguiadmin info&8'' &eRufe die Infos von &4Command&9GUI &eauf.";
|
||||
public static String DE_Help_Give = "&8''&b/commandguiadmin give &7<player>&8'' &eGebe einem Spieler das GUI-Item.";
|
||||
public static String DE_Help_CreateDefaultGUI = "&8''&b/commandguiadmin createdefaultgui&8'' &eLasse eine default GUI erstellen &7([directory])&e.";
|
||||
public static String DE_Help_Reload = "&8''&b/commandguiadmin reload&8'' &eLade das Plugin neu.";
|
||||
|
||||
public static String DE_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiviere f[ue]r dich das GUIItem.";
|
||||
public static String DE_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiviere f[ue]r dich das GUIItem.";
|
||||
public static String DE_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSetze den Slot für GUIItem für Sie einstellen.";
|
||||
|
||||
|
||||
// FR
|
||||
|
||||
|
||||
// NO
|
||||
public static String NO_VaultNotSetUp = "[prefix] &4Vault / Økonomi har ikke blitt satt opp!";
|
||||
public static String NO_SoundNotFound = "[prefix] &4Lyden &6[sound] &4ble ikke bli funnet! Vennligst sjekk innstillingene.";
|
||||
public static String NO_OnlyForPlayer = "[prefix] &cDenne kommandoen er for spillere kun!";
|
||||
public static String NO_DefaultGUI = "[prefix] &2DefaultGUI har blitt laget. Du kan finne den i mappen: &e[directory]&2!";
|
||||
public static String NO_ReloadStart = "[prefix] &6Pluginet blir relastet...";
|
||||
public static String NO_ReloadEnd = "[prefix] &2Pluginet har blitt lastet inn på nytt.";
|
||||
|
||||
public static String NO_NoPermission = "[prefix] &cDu har ikke tilgang til &4Command&9GUI&c!";
|
||||
public static String NO_NoPermissionForCommand = "[prefix] &cFor &b[cmd] &cmangler du tillatelsen &6[perm]&c!";
|
||||
public static String NO_NoPermissionForUseItem = "[prefix] &cDu mangler tillatelsen &6[perm] &cfor å bruke gjenstanden i GUI: &6[gui].";
|
||||
public static String NO_NoPermissionForItem = "[prefix] &cFor &b[item] &cmangler du tillatelsen &6[perm]&c!";
|
||||
|
||||
public static String NO_ItemON = "[prefix] &2You have activated the GUI item.";
|
||||
public static String NO_ItemOFF = "[prefix] &2You have disabled the GUI item.";
|
||||
public static String NO_ItemSlot = "[prefix] &2You have changed the GUI item to slot: &6[slot]&2.";
|
||||
public static String NO_ItemSlotNotEmpty = "[prefix] &6Plassen &e[slot] &6er opptatt for øyeblikket!";
|
||||
public static String NO_ItemSlotAlreadySet = "[prefix] &6Plassen §e[slot] §6er allerede satt!";
|
||||
public static String NO_ItemSlot_wrongValue = "[prefix] &cDen spesifiserte plassen må være mellom 1 og 9!";
|
||||
|
||||
public static String NO_Buy_msg = "[prefix] &2Du kjøpte [itemname] &2for &6[price]&2.";
|
||||
public static String NO_No_money = "[prefix] &cDu har ikke nok penger!";
|
||||
public static String NO_NoInventorySpace = "[prefix] &cDu har ikke nok plass i inventaret ditt!";
|
||||
|
||||
public static String NO_onServerChange = "[prefix] &2Du vil bli tilkoblet serveren &e[server]&2.";
|
||||
|
||||
public static String NO_GUInotFound = "[prefix] &cGUIen som ble spesifisert finnes ikke.";
|
||||
public static String NO_GUIisDisabled = "[prefix] &cGUIen [gui] &cer slått av for øyeblikket!";
|
||||
|
||||
public static String NO_GiveSender = "[prefix] &2Du har gitt &6[player] &2en [item]&2!";
|
||||
public static String NO_GiveReceiver = "[prefix] &2Du fikk &2, [item] &2fra &6[sender]!";
|
||||
|
||||
public static String NO_PlayerNotFond = "[prefix] &cSpilleren &6[player] &cble ikke funnet eller er ikke pålogget!";
|
||||
public static String NO_PlayerNoInventorySpace = "[prefix] &6[player] &char ikke nok plass i inventaret sitt!";
|
||||
|
||||
public static String NO_Help_CGUI = "&8''&b/commandgui &8| &b/cgui&8'' &eÅpne default GUIen &7(&r[gui]&7)&e.";
|
||||
public static String NO_Help_Open = "&8''&b/commandgui [gui]&8'' &eÅpne GUIen: &6[guiname]&e.";
|
||||
public static String NO_Help_Help = "&8''&b/commandguihelp&8'' &eSender denne hjelpe meldingen.";
|
||||
public static String NO_Help_Info = "&8''&b/commandguiadmin info&8'' &eKall informasjon fra &4Command&9GUI&e.";
|
||||
public static String NO_Help_Give = "&8''&b/commandguiadmin give &7<player>&8'' &eGi en spiller GUI gjenstanden.";
|
||||
public static String NO_Help_CreateDefaultGUI = "&8''&b/commandguiadmin createdefaultgui&8'' &eLag en normalverdi GUI &7([directory])&e.";
|
||||
public static String NO_Help_Reload = "&8''&b/commandguiadmin reload&8'' &eLast inn pluginet på nytt.";
|
||||
|
||||
public static String NO_GUIItemHelp_on = "&8''&b/gui-item on&8'' &eAktiverer en GUI gjenstand for deg.";
|
||||
public static String NO_GUIItemHelp_off = "&8''&b/gui-item off&8'' &eDeaktiverer en GUI gjenstand for deg.";
|
||||
public static String NO_GUIItemHelp_Slot = "&8''&b/gui-item slot [slot]&8'' &eSett sporet for GUIItem for deg.";
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system.config.languages;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import de.jatitv.commandguiv2.Util;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import net.t2code.lib.Spigot.Lib.replace.Replace;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class SelectMessages {
|
||||
private static String prefix = Util.Prefix;
|
||||
|
||||
public static String selectMSG;
|
||||
|
||||
public static String VaultNotSetUp;
|
||||
public static String SoundNotFound;
|
||||
public static String OnlyForPlayer;
|
||||
public static String DefaultGUIcreate;
|
||||
public static String ReloadStart;
|
||||
public static String ReloadEnd;
|
||||
|
||||
public static String NoPermission;
|
||||
public static String NoPermissionForCommand;
|
||||
public static String NoPermissionForUseItem;
|
||||
public static String NoPermissionForItem;
|
||||
|
||||
public static String ItemON;
|
||||
public static String ItemOFF;
|
||||
public static String ItemSlot;
|
||||
public static String ItemSlotNotEmpty;
|
||||
public static String ItemSlotAlreadySet;
|
||||
public static String ItemSlot_wrongValue;
|
||||
|
||||
public static String Buy_msg;
|
||||
public static String No_money;
|
||||
public static String NoInventorySpace;
|
||||
|
||||
public static String onServerChange;
|
||||
|
||||
public static String GUInotFound;
|
||||
public static String GUIIsDisabled;
|
||||
|
||||
public static String Give_Sender;
|
||||
public static String Give_Receiver;
|
||||
|
||||
public static String PlayerNotFond;
|
||||
public static String PlayerNoInventorySpace;
|
||||
|
||||
public static String HelpCgui;
|
||||
public static String HelpHelp;
|
||||
public static String HelpInfo;
|
||||
public static String HelpOpen;
|
||||
public static String HelpGive;
|
||||
public static String HelpCreateDefaultGUI;
|
||||
public static String HelpReload;
|
||||
public static String GUIItemHelp_on;
|
||||
public static String GUIItemHelp_off;
|
||||
public static String GUIItemHelp_Slot;
|
||||
|
||||
public static void onSelect(String Prefix) {
|
||||
|
||||
send.debug(Main.plugin, "§4Select language...");
|
||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||
|
||||
File msg;
|
||||
|
||||
msg = new File(Main.getPath(), "languages/" + SelectConfig.language + "_messages.yml");
|
||||
if (!msg.isFile()) {
|
||||
send.console(Prefix);
|
||||
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
send.console(Prefix + " §4The selected §c" + SelectConfig.language + " §4language file was not found.");
|
||||
send.console(Prefix + " §6The default language §eEnglish §6is used!");
|
||||
send.console(Prefix + " §4!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
|
||||
send.console(Prefix);
|
||||
msg = new File(Main.getPath(), "languages/" + "english_messages.yml");
|
||||
selectMSG = "english";
|
||||
} else selectMSG = SelectConfig.language;
|
||||
YamlConfiguration yamlConfiguration_msg = YamlConfiguration.loadConfiguration(msg);
|
||||
|
||||
VaultNotSetUp = select("Plugin.VaultNotSetUp", yamlConfiguration_msg);
|
||||
SoundNotFound = select("Plugin.SoundNotFound", yamlConfiguration_msg);
|
||||
OnlyForPlayer = select("Plugin.OnlyForPlayer", yamlConfiguration_msg);
|
||||
DefaultGUIcreate = select("Plugin.DefaultGUI.create", yamlConfiguration_msg);
|
||||
ReloadStart = select("Plugin.Reload.Start", yamlConfiguration_msg);
|
||||
ReloadEnd = select("Plugin.Reload.End", yamlConfiguration_msg);
|
||||
|
||||
NoPermission = select("NoPermission.ForCommandGUI", yamlConfiguration_msg);
|
||||
NoPermissionForCommand = select("NoPermission.ForCommand", yamlConfiguration_msg);
|
||||
NoPermissionForUseItem = select("NoPermission.ForUseItem", yamlConfiguration_msg);
|
||||
NoPermissionForItem = select("NoPermission.ForItem", yamlConfiguration_msg);
|
||||
|
||||
ItemON = select("UseItem.UseItem_ON", yamlConfiguration_msg);
|
||||
ItemOFF = select("UseItem.UseItem_OFF", yamlConfiguration_msg);
|
||||
ItemSlot = select("UseItem.Change_Slot", yamlConfiguration_msg);
|
||||
ItemSlotNotEmpty = select("UseItem.SlotNotEmpty", yamlConfiguration_msg);
|
||||
ItemSlotAlreadySet = select("UseItem.SlotAlreadySet", yamlConfiguration_msg);
|
||||
ItemSlot_wrongValue = select("UseItem.ItemSlot_wrongValue", yamlConfiguration_msg);
|
||||
|
||||
Buy_msg = select("Cost.Buy_msg", yamlConfiguration_msg);
|
||||
No_money = select("Cost.No_money", yamlConfiguration_msg);
|
||||
NoInventorySpace = select("Cost.NoInventorySpace", yamlConfiguration_msg);
|
||||
|
||||
onServerChange = select("ServerChange.onServerChange", yamlConfiguration_msg);
|
||||
|
||||
GUInotFound = select("GUI.GUInotFound", yamlConfiguration_msg);
|
||||
GUIIsDisabled = select("GUI.GUIisDisabled", yamlConfiguration_msg);
|
||||
|
||||
Give_Sender = select("Give.Sender", yamlConfiguration_msg);
|
||||
Give_Receiver = select("Give.Receiver", yamlConfiguration_msg);
|
||||
|
||||
PlayerNotFond = select("Player.PlayerNotFond", yamlConfiguration_msg);
|
||||
PlayerNoInventorySpace = select("Player.PlayerNoInventorySpace", yamlConfiguration_msg);
|
||||
|
||||
HelpCgui = select("Help.CGUI", yamlConfiguration_msg);
|
||||
HelpHelp = select("Help.Help", yamlConfiguration_msg);
|
||||
HelpInfo = select("Help.Info", yamlConfiguration_msg);
|
||||
HelpOpen = select("Help.Open", yamlConfiguration_msg);
|
||||
HelpGive = select("Help.Give", yamlConfiguration_msg);
|
||||
HelpCreateDefaultGUI = select("Help.CreateDefaultGUI", yamlConfiguration_msg);
|
||||
HelpReload = select("Help.Reload", yamlConfiguration_msg);
|
||||
GUIItemHelp_on = select("Help.UseItem_On", yamlConfiguration_msg);
|
||||
GUIItemHelp_off = select("Help.UseItem_Off", yamlConfiguration_msg);
|
||||
GUIItemHelp_Slot = select("Help.UseItem_Slot", yamlConfiguration_msg);
|
||||
|
||||
|
||||
send.console(Prefix + " §2Language successfully selected to: §6" + selectMSG + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
}
|
||||
|
||||
private static String select(String path, YamlConfiguration yamlConfiguration){
|
||||
return Replace.replace(prefix,yamlConfiguration.getString(path));
|
||||
}
|
||||
}
|
@ -0,0 +1,104 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system.database;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.sql.*;
|
||||
import java.time.ZoneId;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class MySQL {
|
||||
private static Plugin plugin = Main.plugin;
|
||||
public static String ip = "localhost";
|
||||
public static Integer port = 3306;
|
||||
public static String database;
|
||||
public static String user = "root";
|
||||
public static String password = "";
|
||||
public static String url;
|
||||
public static Boolean SSL;
|
||||
|
||||
public static void main() {
|
||||
Long long_ = Long.valueOf(System.currentTimeMillis());
|
||||
Calendar now = Calendar.getInstance();
|
||||
ZoneId timeZone = now.getTimeZone().toZoneId();
|
||||
send.debug(plugin, "Server TimeZone is : " + timeZone);
|
||||
url = "jdbc:mysql://" + ip + ":" + port + "/" + database + "?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=" + timeZone;
|
||||
// Europe/Berlin
|
||||
if (SSL) {
|
||||
url = url + "&useSSL=true";
|
||||
} else url = url + "&useSSL=false";
|
||||
send.debug(plugin, url);
|
||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
||||
Statement stmt = con.createStatement();
|
||||
stmt.close();
|
||||
send.console(Main.prefix + " §2MySQL successfully connected." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
} catch (SQLException ex) {
|
||||
send.console(Main.prefix + " §4MySQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
send.error(plugin, ex.getMessage() + " --- " + (System.currentTimeMillis() - long_.longValue()) + "ms");
|
||||
}
|
||||
}
|
||||
|
||||
public static void query(String query) {
|
||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
||||
Statement stmt = con.createStatement();
|
||||
stmt.execute(query);
|
||||
stmt.close();
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static ArrayList<String> selectAll(String query) {
|
||||
ArrayList<String> Result = new ArrayList<>();
|
||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
||||
Statement stmt = con.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(query);
|
||||
int columns = rs.getMetaData().getColumnCount();
|
||||
while (rs.next()) {
|
||||
Result.add(rs.getString(1));
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
public static String select(String query) {
|
||||
String Ausgabe = "";
|
||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
||||
Statement stmt = con.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(query);
|
||||
int columns = rs.getMetaData().getColumnCount();
|
||||
while (rs.next()) {
|
||||
Ausgabe = String.valueOf(rs.getString(1));
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
return Ausgabe;
|
||||
}
|
||||
|
||||
public static int count(String query) {
|
||||
Integer count = 0;
|
||||
try (Connection con = DriverManager.getConnection(url, user, password)) {
|
||||
Statement stmt = con.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(query);
|
||||
int columns = rs.getMetaData().getColumnCount();
|
||||
while (rs.next()) {
|
||||
count++;
|
||||
}
|
||||
rs.close();
|
||||
stmt.close();
|
||||
} catch (SQLException ex) {
|
||||
System.err.println(ex.getMessage());
|
||||
}
|
||||
return count;
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system.database;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class Select_Database {
|
||||
|
||||
public static void nameCheck(Player player) {
|
||||
if (SelectConfig.Storage.equals("MYSQL")) {
|
||||
MySQL.query("UPDATE `gui-item` SET Name='" + player.getName() + "' WHERE UUID='" + player.getUniqueId() + "';");
|
||||
}
|
||||
}
|
||||
|
||||
public static void setSlot(Player player, Integer slot) {
|
||||
if (SelectConfig.Storage.equals("MYSQL")) {
|
||||
MySQL.query("INSERT INTO `gui-item` (`UUID`, `Name`, `Slot`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
||||
+ "','" + slot + "') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Slot` = '" + slot + "';");
|
||||
} else {
|
||||
YML.setGuiitemSlot(player, slot);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setItemStatusTrue(Player player) {
|
||||
if (SelectConfig.Storage.equals("MYSQL")) {
|
||||
MySQL.query("INSERT INTO `gui-item` (`UUID`, `Name`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
||||
+ "') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Status` = '1';");
|
||||
} else {
|
||||
YML.setGuiitemOn(player);
|
||||
}
|
||||
}
|
||||
|
||||
public static void setItemStatusFalse(Player player) {
|
||||
if (SelectConfig.Storage.equals("MYSQL")) {
|
||||
|
||||
MySQL.query("INSERT INTO `gui-item` (`UUID`, `Name`, `Status`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
|
||||
+ "', '0') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Status` = '0';");
|
||||
} else {
|
||||
YML.setGuiitemOff(player);
|
||||
}
|
||||
}
|
||||
|
||||
public static Boolean selectItemStatus(Player player) {
|
||||
if (SelectConfig.Storage.equals("MYSQL")) {
|
||||
if (MySQL.count("SELECT * FROM `gui-item` WHERE BINARY UUID='" + player.getUniqueId() + "'") > 0) {
|
||||
if (MySQL.select("SELECT `Status` FROM `gui-item` WHERE `UUID`='" + player.getUniqueId() + "';").equals("1")) {
|
||||
return true;
|
||||
} else return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
return YML.selectGuiitemOn(player);
|
||||
}
|
||||
}
|
||||
|
||||
public static Integer selectSlot(Player player) {
|
||||
if (SelectConfig.Storage.equals("MYSQL")) {
|
||||
if (MySQL.count("SELECT * FROM `gui-item` WHERE BINARY UUID='" + player.getUniqueId() + "'") > 0) {
|
||||
if (MySQL.select("SELECT `Slot` FROM `gui-item` WHERE `UUID`='" + player.getUniqueId() + "';") != "null") {
|
||||
return Integer.valueOf(MySQL.select("SELECT `Slot` FROM `gui-item` WHERE `UUID`='" + player.getUniqueId() + "';"));
|
||||
} else return null;
|
||||
} else return null;
|
||||
|
||||
} else {
|
||||
return YML.selectSlot(player);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package de.jatitv.commandguiv2.Spigot.system.database;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import net.t2code.lib.Spigot.Lib.messages.send;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class YML {
|
||||
|
||||
private static Plugin plugin = Main.plugin;
|
||||
|
||||
public static File storage = new File(Main.getPath(), "Storage/gui-item.yml");
|
||||
public static YamlConfiguration yamlConfigurationStorage = YamlConfiguration.loadConfiguration(storage);
|
||||
|
||||
public static void setGuiitemOn(Player player) {
|
||||
yamlConfigurationStorage.set(player.getUniqueId() + ".Playername", player.getName());
|
||||
yamlConfigurationStorage.set(player.getUniqueId() + ".Status", true);
|
||||
|
||||
try {
|
||||
yamlConfigurationStorage.save(storage);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void setGuiitemOff(Player player) {
|
||||
yamlConfigurationStorage.set(player.getUniqueId() + ".Playername", player.getName());
|
||||
yamlConfigurationStorage.set(player.getUniqueId() + ".Status", false);
|
||||
|
||||
try {
|
||||
yamlConfigurationStorage.save(storage);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void setGuiitemSlot(Player player, Integer slot) {
|
||||
yamlConfigurationStorage.set(player.getUniqueId() + ".Playername", player.getName());
|
||||
yamlConfigurationStorage.set(player.getUniqueId() + ".Slot", slot);
|
||||
|
||||
try {
|
||||
yamlConfigurationStorage.save(storage);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static Boolean selectGuiitemOn(Player player){
|
||||
if (!yamlConfigurationStorage.contains(String.valueOf(player.getUniqueId()))) return true;
|
||||
return yamlConfigurationStorage.getBoolean(player.getUniqueId() + ".Status");
|
||||
}
|
||||
|
||||
|
||||
public static Integer selectSlot(Player player) {
|
||||
send.debug(plugin, "yml-1");
|
||||
if (!yamlConfigurationStorage.contains(String.valueOf(player.getUniqueId()))) return null;
|
||||
if (yamlConfigurationStorage.getString(player.getUniqueId() + ".Slot") == null) return null;
|
||||
send.debug(plugin, "yml-2");
|
||||
send.debug(plugin, String.valueOf(yamlConfigurationStorage.getInt(player.getUniqueId() + ".Slot")));
|
||||
return yamlConfigurationStorage.getInt(player.getUniqueId() + ".Slot");
|
||||
}
|
||||
}
|
10
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Util.java
Normal file
10
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Util.java
Normal file
@ -0,0 +1,10 @@
|
||||
package de.jatitv.commandguiv2;
|
||||
|
||||
public class Util {
|
||||
public static double requiredT2CodeLibVersion = 7.2;
|
||||
public static String Prefix = "§8[§4C§9GUI§8]";
|
||||
public static Integer SpigotID = 90671;
|
||||
public static Integer BstatsID = 10840;
|
||||
public static String Spigot = "https://www.spigotmc.org/resources/" + SpigotID;
|
||||
public static String Discord = "http://dc.t2code.net";
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
package de.jatitv.commandguiv2.api;
|
||||
|
||||
import de.jatitv.commandguiv2.Spigot.Listener.ItemChange;
|
||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events_from1_10;
|
||||
import de.jatitv.commandguiv2.Spigot.Main;
|
||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.Commands;
|
||||
import de.jatitv.commandguiv2.Spigot.cmdManagement.Help;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.DefaultGUICreate;
|
||||
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
|
||||
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
|
||||
import de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener.Events;
|
||||
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class CGuiAPI {
|
||||
public static Boolean JoinDisable = false;
|
||||
|
||||
public static void onItemChange(Player player) {
|
||||
ItemChange.itemChange(player);
|
||||
}
|
||||
|
||||
public static void disableItemGiveOnJoin(Boolean disableItemGiveOnJoin) {
|
||||
JoinDisable = disableItemGiveOnJoin;
|
||||
}
|
||||
|
||||
public static Boolean selectPlayerItemEnable(Player player) {
|
||||
return Select_Database.selectItemStatus(player);
|
||||
}
|
||||
|
||||
public static Integer selectPlayerItemSlot(Player player) {
|
||||
return Select_Database.selectSlot(player);
|
||||
}
|
||||
|
||||
public static void setPlayerItemEnable(Player player, Boolean value) {
|
||||
if (value) {
|
||||
Select_Database.setItemStatusTrue(player);
|
||||
} else Select_Database.setItemStatusFalse(player);
|
||||
}
|
||||
|
||||
public static void setPlayerItemSlot(Player player, Integer value) {
|
||||
Select_Database.setSlot(player, value);
|
||||
}
|
||||
|
||||
public static void openDefaultGUI(Player player) {
|
||||
Commands.gui(player);
|
||||
}
|
||||
|
||||
public static void openGUI(Player player, String GUI_CommandName) {
|
||||
Commands.gui(player, GUI_CommandName);
|
||||
}
|
||||
|
||||
public static void sendHelp(CommandSender sender) {
|
||||
Help.sendHelp(sender, Main.prefix);
|
||||
}
|
||||
|
||||
public static void sendPluginInfo(CommandSender sender) {
|
||||
if (sender.hasPermission("commandgui.command.info")) {
|
||||
Commands.info(sender);
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
|
||||
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.command.info"));
|
||||
}
|
||||
|
||||
public static void createDefaultGUI(CommandSender sender) {
|
||||
if (sender.hasPermission("commandgui.admin")) {
|
||||
DefaultGUICreate.configCreate();
|
||||
sender.sendMessage(SelectMessages.DefaultGUIcreate.replace("[directory]", Main.getPath() + "\\GUIs\\default.yml"));
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
|
||||
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.admin"));
|
||||
}
|
||||
|
||||
public static void reload(CommandSender sender) {
|
||||
if (sender.hasPermission("commandgui.admin")) {
|
||||
Commands.reload(sender);
|
||||
} else sender.sendMessage(SelectMessages.NoPermissionForCommand
|
||||
.replace("[cmd]", "/commandguiadmin").replace("[perm]", "commandgui.admin"));
|
||||
}
|
||||
|
||||
|
||||
}
|
4
CommandGUI V2/src/main/resources/bungee.yml
Normal file
4
CommandGUI V2/src/main/resources/bungee.yml
Normal file
@ -0,0 +1,4 @@
|
||||
name: CommandGUI
|
||||
version: ${project.version}
|
||||
main: de.jatitv.commandguiv2.Bungee.BMain
|
||||
author: JaTiTV
|
7
CommandGUI V2/src/main/resources/config.yml
Normal file
7
CommandGUI V2/src/main/resources/config.yml
Normal file
@ -0,0 +1,7 @@
|
||||
MySQL:
|
||||
IP: localhost
|
||||
Port: 3306
|
||||
Database: database
|
||||
User: user
|
||||
Password: ''
|
||||
SSL: false
|
74
CommandGUI V2/src/main/resources/plugin.yml
Normal file
74
CommandGUI V2/src/main/resources/plugin.yml
Normal file
@ -0,0 +1,74 @@
|
||||
name: CommandGUI
|
||||
version: ${project.version}
|
||||
main: de.jatitv.commandguiv2.Spigot.Main
|
||||
api-version: 1.13
|
||||
prefix: CommandGUI
|
||||
authors: [ JaTiTV ]
|
||||
|
||||
softdepend:
|
||||
- T2CodeLib
|
||||
- Vault
|
||||
- PlaceholderAPI
|
||||
- PlotSquaredGUI
|
||||
- PlugManGUI
|
||||
|
||||
commands:
|
||||
commandgui:
|
||||
description: Open the CGUI
|
||||
aliases: [cgui, gui]
|
||||
commandguihelp:
|
||||
description: CommandGUI Help
|
||||
aliases: [cguihelp, guihelp]
|
||||
# commandguiadmin:
|
||||
# aliases: [cguiadmin, cguia]
|
||||
commandgui-item:
|
||||
aliases: [gui-item]
|
||||
|
||||
|
||||
permissions:
|
||||
commandgui.admin:
|
||||
description: All permissions from CommandGUI
|
||||
default: op
|
||||
children:
|
||||
commandgui.updatemsg: true
|
||||
commandgui.command: true
|
||||
commandgui.get.guiitem.at.login: true
|
||||
commandgui.useitem: true
|
||||
commandgui.useitem.toggle: true
|
||||
commandgui.bypass: true
|
||||
commandgui.command.info: true
|
||||
commandgui.command.give: true
|
||||
|
||||
commandgui.player:
|
||||
description: All permissions from CommandGUI
|
||||
default: op
|
||||
children:
|
||||
commandgui.command: true
|
||||
commandgui.get.guiitem.at.login: true
|
||||
commandgui.useitem: true
|
||||
commandgui.useitem.toggle: true
|
||||
|
||||
commandgui.updatemsg:
|
||||
description: Players with this permission get the update message when joining if an update is available
|
||||
default: op
|
||||
commandgui.command:
|
||||
description: Required permission to open GUIs via command
|
||||
default: op
|
||||
commandgui.get.guiitem.at.login:
|
||||
description: Only players with this permission will receive the GUI item
|
||||
default: op
|
||||
commandgui.useitem:
|
||||
description: Required permission to use the GUI Item
|
||||
default: op
|
||||
commandgui.useitem.toggle:
|
||||
description: Required permission to enable/disable the GUI Item for itself (if the function UseItem/AllowToggle is set to true)
|
||||
default: op
|
||||
commandgui.bypass:
|
||||
description: Bypass to open disabled GUIs
|
||||
default: op
|
||||
commandgui.command.info:
|
||||
description: Permission to view CommandGUI info
|
||||
default: not op
|
||||
commandgui.command.give:
|
||||
description: Kommend in V2.1.0
|
||||
default: op
|
58
Configs/GUIs/default.yml
Normal file
58
Configs/GUIs/default.yml
Normal file
@ -0,0 +1,58 @@
|
||||
GUI:
|
||||
Enable: true
|
||||
Lines: 1
|
||||
Name: '&5default &9GUI'
|
||||
FillItem:
|
||||
Enable: true
|
||||
Item: BLACK_STAINED_GLASS_PANE
|
||||
Command:
|
||||
Alias: true
|
||||
Permission:
|
||||
Required: true
|
||||
Slots:
|
||||
Example:
|
||||
Slot: 5
|
||||
Enable: true
|
||||
Item:
|
||||
PlayerHead:
|
||||
Enable: true
|
||||
Base64:
|
||||
Enable: true
|
||||
Base64Value: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzg3M2MxMmJmZmI1MjUxYTBiODhkNWFlNzVjNzI0N2NiMzlhNzVmZjFhODFjYmU0YzhhMzliMzExZGRlZGEifX19
|
||||
PlayerWhoHasOpenedTheGUI: false
|
||||
PlayerName: ''
|
||||
Material: ''
|
||||
Name: '&3Support Discord'
|
||||
Lore:
|
||||
- '&8-----------------'
|
||||
- '&bIf you need help setting up the plugin,'
|
||||
- '&bfeel free to contact me on the Suport Discord.'
|
||||
- '&8-----------------'
|
||||
- '&eIf you find any errors or bugs,'
|
||||
- '&eplease contact me so I can fix them.'
|
||||
- '&8-----------------'
|
||||
- '&5Discord: §7https://discord.gg/vRyXFFterJ'
|
||||
CustomSound:
|
||||
Enable: false
|
||||
Sound: ''
|
||||
Cost:
|
||||
Enable: false
|
||||
Price: 0.0
|
||||
Command:
|
||||
Enable: false
|
||||
BungeeCommand: false
|
||||
CommandAsConsole: false
|
||||
Command:
|
||||
- ''
|
||||
ServerChange:
|
||||
Enable: false
|
||||
Server: ''
|
||||
OpenGUI:
|
||||
Enable: false
|
||||
GUI: ''
|
||||
Message:
|
||||
Enable: true
|
||||
Message:
|
||||
- '&6You can find more information on Discord: &ehttps://discord.gg/vRyXFFterJ'
|
||||
Permission:
|
||||
Required: false
|
71
Configs/config.yml
Normal file
71
Configs/config.yml
Normal file
@ -0,0 +1,71 @@
|
||||
Plugin:
|
||||
UpdateCheckOnJoin: true
|
||||
Debug: false
|
||||
HelpAlias: true
|
||||
language: english
|
||||
Currency: $
|
||||
DefaultGUI: default
|
||||
Storage:
|
||||
Type: YML
|
||||
MySQL:
|
||||
IP: localhost
|
||||
Port: 3306
|
||||
Database: database
|
||||
User: root
|
||||
Password: password
|
||||
SSL: false
|
||||
BungeeCord:
|
||||
Enable: false
|
||||
ThisServer: server
|
||||
UseItem:
|
||||
Enable: true
|
||||
AllowToggle: true
|
||||
AllowSetSlot: true
|
||||
BlockMoveAndDrop: true
|
||||
OpenGUI: default
|
||||
Permission:
|
||||
NeededToUse: true
|
||||
InventorySlot:
|
||||
Slot: 1
|
||||
SlotEnforce: false
|
||||
FreeSlot: false
|
||||
Item:
|
||||
Material: paper
|
||||
PlayerHead:
|
||||
Enable: false
|
||||
Base64:
|
||||
Enable: false
|
||||
Base64Value: ''
|
||||
PlayerWhoHasOpenedTheGUI: false
|
||||
Playername: ''
|
||||
Name: '&bDefault &6GUI'
|
||||
Lore:
|
||||
- '&eThis is an example GUI'
|
||||
Join:
|
||||
GiveOnEveryJoin: true
|
||||
GiveOnlyOnFirstJoin: false
|
||||
Cursor:
|
||||
ToGUIItem:
|
||||
OnEveryLogin: true
|
||||
OnOnlyFirstLogin: true
|
||||
EXPERIMENTELL_ServerChhange: false
|
||||
Sound:
|
||||
Enable: true
|
||||
OpenInventory:
|
||||
Enable: true
|
||||
Sound: BLOCK_CHEST_OPEN
|
||||
Click:
|
||||
Enable: true
|
||||
Sound: BLOCK_NOTE_BLOCK_HAT
|
||||
NoMoney:
|
||||
Enable: true
|
||||
Sound: BLOCK_NOTE_BLOCK_HARP
|
||||
NoInventorySpace:
|
||||
Enable: true
|
||||
Sound: BLOCK_NOTE_BLOCK_HARP
|
||||
Give:
|
||||
Enable: true
|
||||
Sound: ENTITY_PLAYER_LEVELUP
|
||||
PlayerNotFound:
|
||||
Enable: true
|
||||
Sound: BLOCK_NOTE_BLOCK_HARP
|
54
Configs/languages/english_messages.yml
Normal file
54
Configs/languages/english_messages.yml
Normal file
@ -0,0 +1,54 @@
|
||||
Plugin:
|
||||
VaultNotSetUp: '[prefix] &4Vault / Economy not set up!'
|
||||
SoundNotFound: '[prefix] &4The sound &6[sound] &4was not found! Please check the
|
||||
settings.'
|
||||
OnlyForPlayer: '[prefix] &cThis command is for players only!'
|
||||
DefaultGUI:
|
||||
create: '[prefix] &2DefaultGUI was created. You can find it in the directory::
|
||||
&e[directory]&2!'
|
||||
Reload:
|
||||
Start: '[prefix] &6Plugin is reloaded...'
|
||||
End: '[prefix] &2Plugin was successfully reloaded.'
|
||||
Warning: '[prefix] &6To enable / disable alias commands, reload / restart the
|
||||
server!'
|
||||
NoPermission:
|
||||
ForCommandGUI: '[prefix] &cYou do not have permission for &4Command&9GUI&c!'
|
||||
ForCommand: '[prefix] &cFor &b[cmd] &cyou lack the permission &6[perm]&c!'
|
||||
ForUseItem: '[prefix] &cYou lack the permission &6[perm] &cto use the item for the
|
||||
GUI: &6[gui].'
|
||||
ForItem: '[prefix] &cFor &b[item] &cyou lack the permission &6[perm]&c!'
|
||||
UseItem:
|
||||
UseItem_ON: '[prefix] &2You have activated the GUI item.'
|
||||
UseItem_OFF: '[prefix] &2You have disabled the GUI item.'
|
||||
Change_Slot: '[prefix] &2You have changed the GUI item to slot: &6[slot]&2.'
|
||||
SlotNotEmpty: '[prefix] &6The slot &e[slot] &6is currently occupied!'
|
||||
SlotAlreadySet: '[prefix] &6The slot §e[slot] §6is already set!'
|
||||
ItemSlot_wrongValue: '[prefix] &cThe specified slot must be between 1 and 9!'
|
||||
Cost:
|
||||
Buy_msg: '[prefix] &2You bought [itemname] &2for &6[price]&2.'
|
||||
No_money: '[prefix] &cYou don''t have enough money!'
|
||||
NoInventorySpace: '[prefix] &cYou have no room in your inventory!'
|
||||
ServerChange:
|
||||
onServerChange: '[prefix] &2You will be connected to the server &e[server]§2.'
|
||||
GUI:
|
||||
GUInotFound: '[prefix] &cThe GUI chosen by the does not exist.'
|
||||
GUIisDisabled: '[prefix] &cThe GUI [gui] &cis currently Disabled!'
|
||||
Give:
|
||||
Sender: '[prefix] &2You have given &6[player] &2an [item] &2!'
|
||||
Receiver: '[prefix] &2You got &2, [item] &2from &6[sender]!'
|
||||
Player:
|
||||
PlayerNotFond: '[prefix] &cThe player &6[player] &cwas not found or is not online!'
|
||||
PlayerNoInventorySpace: '[prefix] &6[player] &chas no free space in his inventory!'
|
||||
Help:
|
||||
CGUI: '&8''''&b/commandgui &8| &b/cgui&8'''' &eOpen the default GUI &7(&r[gui]&7)&e.'
|
||||
Help: '&8''''&b/commandguihelp&8'''' &eOpen this help.'
|
||||
Info: '&8''''&b/commandguiadmin info&8'''' &eCall the info from &4Command&9GUI &e.'
|
||||
Open: '&8''''&b/commandgui [gui]&8'''' &eOpen the GUI: &6[guiname]&e.'
|
||||
Give: '&8''''&b/commandguiadmin give &7<player>&8'''' &eGive a player the GUI item.'
|
||||
CreateDefaultGUI: '&8''''&b/commandguiadmin createdefaultgui&8'''' &eCreate a default
|
||||
GUI &7([directory])&e.'
|
||||
Reload: '&8''''&b/commandguiadmin reload&8'''' &eReload the plugin.'
|
||||
UseItem_On: '&8''''&b/gui-item on&8'''' &eActivate the GUIItem for you.'
|
||||
UseItem_Off: '&8''''&b/gui-item off&8'''' &eDisable the GUIItem for yourself.'
|
||||
UseItem_Slot: '&8''''&b/gui-item slot [slot]&8'''' &eSet the slot for GUIItem for
|
||||
you.'
|
56
Configs/languages/german_messages.yml
Normal file
56
Configs/languages/german_messages.yml
Normal file
@ -0,0 +1,56 @@
|
||||
Plugin:
|
||||
VaultNotSetUp: '[prefix] &4Vault / Economy nicht eingerichtet!'
|
||||
SoundNotFound: '[prefix] &4Der Sound &6[sound] &4wurde nicht gefunden! Bitte [ue]berpr[ue]fe
|
||||
die Einstellungen.'
|
||||
OnlyForPlayer: '[prefix] &cDieser Command ist nur f[ue]r Spieler!'
|
||||
DefaultGUI:
|
||||
create: '[prefix] &2DefaultGUI wurde erstellt. Du findst sie im Verzeichnis: &e[directory]&2!'
|
||||
Reload:
|
||||
Start: '[prefix] &6Plugin wird neu geladen...'
|
||||
End: '[prefix] &2Plugin wurde erfolgreich neu geladen.'
|
||||
Warning: '[prefix] &6Um Alias-Befehle zu aktivieren / deaktivieren, lade / starte
|
||||
den Server neu!!'
|
||||
NoPermission:
|
||||
ForCommandGUI: '[prefix] &cDu hast keine Permission f[ue]r &4Command&9GUI&c!'
|
||||
ForCommand: '[prefix] &cF[ue]r &b[cmd] &cfehlt dir die Permission &6[perm]&c!'
|
||||
ForUseItem: '[prefix] &cDir fehlt die Permission &6[perm] &cum das Item f[ue]r die
|
||||
GUI: &6[gui] &cnutzen zu k[oe]nnen.'
|
||||
ForItem: '[prefix] &cF[ue]r &b[item] &cfehlt dir die Permission &6[perm]&c!'
|
||||
UseItem:
|
||||
UseItem_ON: '[prefix] &2Du hast das GUI-Item aktiviert.'
|
||||
UseItem_OFF: '[prefix] &2Du hast das GUI-Item deaktiviert.'
|
||||
Change_Slot: '[prefix] &2Du hast das GUI-Item auf Slot &6[slot] &2umgestellt.'
|
||||
SlotNotEmpty: '[prefix] &6Der Slot §e[slot] §6ist derzeit belegt!.'
|
||||
SlotAlreadySet: '[prefix] &6Der Slot §e[slot] §6ist bereits eingestellt!'
|
||||
ItemSlot_wrongValue: '[prefix] &cDer angegebene Slot muss sich zwischen 1 und 9
|
||||
befinden!'
|
||||
Cost:
|
||||
Buy_msg: '[prefix] &2Du hast dir [itemname] &2f[ue]r &6[price] &2gekauft.'
|
||||
No_money: '[prefix] &cDu hast nicht gen[ue]gend Geld!'
|
||||
NoInventorySpace: '[prefix] &cDu hast keinen Platz in deinem Inventar!'
|
||||
ServerChange:
|
||||
onServerChange: '[prefix] &2Du wirst auf den Server §e[server] §2verbunden.'
|
||||
GUI:
|
||||
GUInotFound: '[prefix] &cDie von die gew[ae]hlte GUI gibt es nicht.'
|
||||
GUIisDisabled: '[prefix] &cDie GUI [gui] &cist derzeit Deaktiviert!'
|
||||
Give:
|
||||
Sender: '[prefix] &2Du hast &6[player] &2ein [item] &2gegeben!'
|
||||
Receiver: '[prefix] &2Du hast von &6[sender] &2, [item] &2bekommen!'
|
||||
Player:
|
||||
PlayerNotFond: '[prefix] &cDer Spieler &6[player] &cwurde nicht gefunden oder ist
|
||||
nicht Online!'
|
||||
PlayerNoInventorySpace: '[prefix] &6[player] &chat keinen freien Platz in seinem
|
||||
Inventar!'
|
||||
Help:
|
||||
CGUI: '&8''''&b/commandgui &8| &b/cgui&8'''' &e[OE]ffne die default GUI &7(&r[gui]&7)&e.'
|
||||
Help: '&8''''&b/commandguihelp&8'''' &e[OE]ffne diese help.'
|
||||
Info: '&8''''&b/commandguiadmin info&8'''' &eRufe die Infos von &4Command&9GUI &eauf.'
|
||||
Open: '&8''''&b/commandgui [gui]&8'''' &e[OE]ffne die GUI: &6[guiname]&e.'
|
||||
Give: '&8''''&b/commandguiadmin give &7<player>&8'''' &eGebe einem Spieler das GUI-Item.'
|
||||
CreateDefaultGUI: '&8''''&b/commandguiadmin createdefaultgui&8'''' &eLasse eine
|
||||
default GUI erstellen &7([directory])&e.'
|
||||
Reload: '&8''''&b/commandguiadmin reload&8'''' &eLade das Plugin neu.'
|
||||
UseItem_On: '&8''''&b/gui-item on&8'''' &eAktiviere f[ue]r dich das GUIItem.'
|
||||
UseItem_Off: '&8''''&b/gui-item off&8'''' &eDeaktiviere f[ue]r dich das GUIItem.'
|
||||
UseItem_Slot: '&8''''&b/gui-item slot [slot]&8'''' &eSetze den Slot für GUIItem
|
||||
für Sie einstellen.'
|
54
Configs/languages/norwegian_messages.yml
Normal file
54
Configs/languages/norwegian_messages.yml
Normal file
@ -0,0 +1,54 @@
|
||||
Plugin:
|
||||
VaultNotSetUp: '[prefix] &4Vault / Økonomi har ikke blitt satt opp!'
|
||||
SoundNotFound: '[prefix] &4Lyden &6[sound] &4ble ikke bli funnet! Vennligst sjekk
|
||||
innstillingene.'
|
||||
OnlyForPlayer: '[prefix] &cDenne kommandoen er for spillere kun!'
|
||||
DefaultGUI:
|
||||
create: '[prefix] &2DefaultGUI har blitt laget. Du kan finne den i mappen: &e[directory]&2!'
|
||||
Reload:
|
||||
Start: '[prefix] &6Pluginet blir relastet...'
|
||||
End: '[prefix] &2Pluginet har blitt lastet inn på nytt.'
|
||||
Warning: '[prefix] &6For å skru på / skru av alias kommandoer, relast / restart
|
||||
serveren!'
|
||||
NoPermission:
|
||||
ForCommandGUI: '[prefix] &cDu har ikke tilgang til &4Command&9GUI&c!'
|
||||
ForCommand: '[prefix] &cFor &b[cmd] &cmangler du tillatelsen &6[perm]&c!'
|
||||
ForUseItem: '[prefix] &cDu mangler tillatelsen &6[perm] &cfor å bruke gjenstanden
|
||||
i GUI: &6[gui].'
|
||||
ForItem: '[prefix] &cFor &b[item] &cmangler du tillatelsen &6[perm]&c!'
|
||||
UseItem:
|
||||
UseItem_ON: '[prefix] &2You have activated the GUI item.'
|
||||
UseItem_OFF: '[prefix] &2You have disabled the GUI item.'
|
||||
Change_Slot: '[prefix] &2You have changed the GUI item to slot: &6[slot]&2.'
|
||||
SlotNotEmpty: '[prefix] &6Plassen &e[slot] &6er opptatt for øyeblikket!'
|
||||
SlotAlreadySet: '[prefix] &6Plassen §e[slot] §6er allerede satt!'
|
||||
ItemSlot_wrongValue: '[prefix] &cDen spesifiserte plassen må være mellom 1 og 9!'
|
||||
Cost:
|
||||
Buy_msg: '[prefix] &2Du kjøpte [itemname] &2for &6[price]&2.'
|
||||
No_money: '[prefix] &cDu har ikke nok penger!'
|
||||
NoInventorySpace: '[prefix] &cDu har ikke nok plass i inventaret ditt!'
|
||||
ServerChange:
|
||||
onServerChange: '[prefix] &2Du vil bli tilkoblet serveren &e[server]&2.'
|
||||
GUI:
|
||||
GUInotFound: '[prefix] &cGUIen som ble spesifisert finnes ikke.'
|
||||
GUIisDisabled: '[prefix] &cGUIen [gui] &cer slått av for øyeblikket!'
|
||||
Give:
|
||||
Sender: '[prefix] &2Du har gitt &6[player] &2en [item]&2!'
|
||||
Receiver: '[prefix] &2Du fikk &2, [item] &2fra &6[sender]!'
|
||||
Player:
|
||||
PlayerNotFond: '[prefix] &cSpilleren &6[player] &cble ikke funnet eller er ikke
|
||||
pålogget!'
|
||||
PlayerNoInventorySpace: '[prefix] &6[player] &char ikke nok plass i inventaret sitt!'
|
||||
Help:
|
||||
CGUI: '&8''''&b/commandgui &8| &b/cgui&8'''' &eÅpne default GUIen &7(&r[gui]&7)&e.'
|
||||
Help: '&8''''&b/commandguihelp&8'''' &eSender denne hjelpe meldingen.'
|
||||
Info: '&8''''&b/commandguiadmin info&8'''' &eKall informasjon fra &4Command&9GUI&e.'
|
||||
Open: '&8''''&b/commandgui [gui]&8'''' &eÅpne GUIen: &6[guiname]&e.'
|
||||
Give: '&8''''&b/commandguiadmin give &7<player>&8'''' &eGi en spiller GUI gjenstanden.'
|
||||
CreateDefaultGUI: '&8''''&b/commandguiadmin createdefaultgui&8'''' &eLag en normalverdi
|
||||
GUI &7([directory])&e.'
|
||||
Reload: '&8''''&b/commandguiadmin reload&8'''' &eLast inn pluginet på nytt.'
|
||||
UseItem_On: '&8''''&b/gui-item on&8'''' &eAktiverer en GUI gjenstand for deg.'
|
||||
UseItem_Off: '&8''''&b/gui-item off&8'''' &eDeaktiverer en GUI gjenstand for deg.'
|
||||
UseItem_Slot: '&8''''&b/gui-item slot [slot]&8'''' &eSett sporet for GUIItem for
|
||||
deg.'
|
56
README.md
Normal file
56
README.md
Normal file
@ -0,0 +1,56 @@
|
||||
<p align="center">
|
||||
<img src="https://i.imgur.com/QHOQIMm.png" width="400">
|
||||
</p>
|
||||
|
||||
---
|
||||
|
||||
# Links
|
||||
* [Download](https://www.spigotmc.org/resources/commandgui-cgui.90671/)
|
||||
* [Discord](http://dc.T2Code.net)
|
||||
|
||||
<img src="https://i.imgur.com/mmnBjBG.png" width="600">
|
||||
|
||||
CommandGUI | FunctionsGUI is a handy plugin that allows you to create as many and different GUIs (user interfaces) as you need for your server.
|
||||
|
||||
Features:
|
||||
- With CommandGUI you can send commands, messages to players.
|
||||
- You can also charge money for it via Economy (Vault and Economy plugin required).
|
||||
- You can decide per slot if the players need certain permissions or not.
|
||||
- You can play a custom sound for each slot.
|
||||
- You can also open another GUI directly via slots.
|
||||
- You can also just display information by setting a lore for the items in the GUIs, these also support placeholders.
|
||||
- There is an item that players can get in the inventory, with which they can open a specific GUI.
|
||||
|
||||
<img src="https://i.imgur.com/2f9Ewnl.png" width="600">
|
||||
|
||||
Optional:
|
||||
- Permission Plugin
|
||||
LuckPerms recommended
|
||||
- Vault
|
||||
- Economy Plugin
|
||||
Recommendations: Economy, EssentialsX, CMI (Paid) (more possible)
|
||||
|
||||
<img src="https://i.imgur.com/wNDEjg9.png" width="600">
|
||||
|
||||
/commandgui - Open the default GUI (adjustable)
|
||||
|
||||
/commandgui [gui] - Open the selected GUI
|
||||
|
||||
/gui-item on - Activate the GUIItem for you.
|
||||
|
||||
/gui-item off - Disable the GUIItem for you.
|
||||
|
||||
/commandguihelp - Open the help file.
|
||||
|
||||
/commandguiadmin info - Open the CommandGUI info.
|
||||
|
||||
/commandguiadmin createdefaultgui - create a default GUI
|
||||
|
||||
/commandguiadmin reload - Reload the plugin.
|
||||
|
||||
|
||||
* [Permissions](https://github.com/JaTiTV/CommandGUI/blob/main/CommandGUI%20V2/src/main/resources/plugin.yml)
|
||||
|
||||
---
|
||||
|
||||
<img src="https://bstats.org/signatures/bukkit/CGUI.svg" width="600">
|
Loading…
Reference in New Issue
Block a user