32 Commits

Author SHA1 Message Date
d96205887c Config poll 2022-04-16 15:46:26 +02:00
5e4998734d Update pom.xml 2022-04-16 14:26:08 +02:00
JaTiTV
c2782bbb97 Merge pull request 'open-gui-test' (#7) from open-gui-test into main
Reviewed-on: JaTiTV/CommandGUI#7
2022-04-16 14:09:16 +02:00
58409dc523 Update pom.xml 2022-04-15 20:30:20 +02:00
17b1a0568e bugfix
If you didn't have the permission to see an item, you could still click on it and get the message that you don't have the permission. This has now been changed so that you only get the message if you can see the item.
2022-04-06 20:21:19 +02:00
1c6e6d6660 2.6.2_Snapshop-1
The GUI listener has been redesigned in terms of code and improved in terms of performance.
2022-03-28 21:56:57 +02:00
JaTiTV
ff2cb3ce96 Merge pull request '2.6.1' (#6) from perm-change into main
Reviewed-on: JaTiTV/CommandGUI#6
2022-03-21 22:23:25 +01:00
92d4c86aa0 2.6.1 2022-03-21 22:21:54 +01:00
e98c047ff0 Update pom.xml 2022-03-10 22:54:24 +01:00
4cbe8ed802 2.6.0
Add:
- 1.18.2 Support

Bugfix:
- Fixed a bug where bungee commands were executed multiple times when multiple players were on the server.

New features:
- Bungee commands can now also be executed from the server
2022-03-08 20:12:02 +01:00
JaTiTV
e8b5d49822 Merge pull request 'Bugfix' (#5) from 2.5.23 into main
Reviewed-on: JaTiTV/CommandGUI#5
2022-02-09 22:54:29 +01:00
ce07fd2f37 Bugfix 2022-02-09 22:53:18 +01:00
c7fe0603fe Update pom.xml 2022-01-19 11:15:53 +01:00
4849ca06e7 Update ItemChange.java 2022-01-19 11:15:47 +01:00
fe7ae61242 Update database to Hikari 2022-01-16 03:03:04 +01:00
b3934e22cc Update T2C-LuckyBox API 2022-01-13 03:46:08 +01:00
7808a3bf6e Update pom.xml 2022-01-13 03:30:08 +01:00
f1e1c0de57 LuckyBox was added to OpenGui 2022-01-13 03:28:06 +01:00
c4525a0055 add debugmessages 2022-01-11 02:44:36 +01:00
7e81c3403d 2.5.20 | bugfix 2022-01-08 07:47:49 +01:00
JaTiTV
cb5f8a7350 Merge pull request '2.5.19' (#4) from world-black-/-whitelist into main
Reviewed-on: JaTiTV/CommandGUI#4
2022-01-07 20:43:37 +01:00
811d6a7a9d Update Events.java 2022-01-07 20:42:32 +01:00
88bdac1fc8 small changes 2022-01-07 20:40:43 +01:00
JaTiTV
2e29bfb270 Merge pull request '2.5.19 | Add UseItem World Protection and Change and minor code changes' (#3) from world-black-/-whitelist into main
Reviewed-on: JaTiTV/CommandGUI#3
2022-01-07 20:40:17 +01:00
89030215a1 2.5.19 | Add UseItem World Protection and Change and minor code changes 2022-01-07 20:32:59 +01:00
b212b68f67 recode Bungee config 2022-01-07 19:19:40 +01:00
JaTiTV
ee587742d1 Merge pull request '2.5.18' (#2) from 2.5.18 into main
Reviewed-on: JaTiTV/CommandGUI#2
2022-01-07 18:17:43 +01:00
908e137943 Update pom.xml 2022-01-06 19:18:09 +01:00
47c2329ff9 Update pom.xml 2022-01-06 18:28:27 +01:00
75ab60bbaa Changes
- If the option Join.Cursor.ToGUIItem.OnLogin was set to true the cursor was set to the UseItem even if the GameMode was changed, this was fixed.
- Protection was completed
2022-01-06 03:04:56 +01:00
8377667f55 code changes 2022-01-06 02:21:27 +01:00
7afbdd695c 2.5.18_DEV 2022-01-06 02:20:59 +01:00
49 changed files with 1812 additions and 982 deletions

View File

@@ -6,9 +6,10 @@
<groupId>net.t2code</groupId>
<artifactId>CommandGUI_V2</artifactId>
<version>2.5.17</version>
<version>2.6.2_Snapshot-2</version>
<packaging>jar</packaging>
<name>CommandGUI</name>
<properties>
@@ -53,6 +54,10 @@
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>Builders-Paradise</id>
<url>https://repo.t2code.net/repository/Builders-Paradise/</url>
@@ -61,10 +66,7 @@
<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>
@@ -81,7 +83,17 @@
<dependency>
<groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId>
<version>9.0</version>
<version>11.4</version>
</dependency>
<dependency>
<groupId>net.t2code</groupId>
<artifactId>LuckyBox-API</artifactId>
<version>4.2.2</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_18.r2</groupId>
<artifactId>spigot</artifactId>
<version>1.18r2</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_18.r1</groupId>
@@ -168,5 +180,10 @@
<artifactId>spigot</artifactId>
<version>1.8r1</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.4.5</version>
</dependency>
</dependencies>
</project>

View File

@@ -1,56 +1,39 @@
package de.jatitv.commandguiv2.Bungee;
import de.jatitv.commandguiv2.Util;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
import net.t2code.lib.Bungee.Lib.messages.Bsend;
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();
}
}
Configuration configuration;
try {
configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(BMain.plugin.getDataFolder(), "config.yml"));
BMySQL.Enable = configuration.getBoolean("MySQL.Enable");
} catch (IOException e) {
Bsend.console(Util.getSpigot() + " Please replace the config: MySQL.Enable: [false,true]");
e.printStackTrace();
}
try {
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();
public static void create() throws IOException {
File config = new File(BMain.plugin.getDataFolder(), "config.yml");
if (!BMain.plugin.getDataFolder().exists()) BMain.plugin.getDataFolder().mkdir();
if (!config.exists()) {
config.createNewFile();
}
Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(config);
configuration.set("MySQL.Enable", false);
configuration.set("MySQL.IP", "localhost");
configuration.set("MySQL.Port", 3306);
configuration.set("MySQL.Database", "database");
configuration.set("MySQL.User", "user");
configuration.set("MySQL.Password", "");
configuration.set("MySQL.SSL", false);
ConfigurationProvider.getProvider(YamlConfiguration.class).save(configuration, config);
BMySQL.Enable = configuration.getBoolean("MySQL.Enable");
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");
}

View File

@@ -1,6 +1,7 @@
package de.jatitv.commandguiv2.Bungee;
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;
@@ -16,13 +17,20 @@ 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);
if (channel.equals("cgui-Console")) {
ProxyServer.getInstance().getConsole().sendMessage("Command Console: "+ input);
ProxyServer.getInstance().getPluginManager().dispatchCommand(ProxyServer.getInstance().getConsole(), input);
} else {
ProxiedPlayer player = ProxyServer.getInstance().getPlayer(channel);
if (player != null) {
ProxyServer.getInstance().getConsole().sendMessage("Command " + player +": "+ input);
ProxyServer.getInstance().getPluginManager().dispatchCommand(player, input);
}
}
} catch (IOException e) {
e.printStackTrace();
@@ -34,20 +42,24 @@ public class BListener implements Listener {
public void onJoin(PostLoginEvent e) {
ProxiedPlayer player = e.getPlayer();
sendToSpigotPlayer(player.getName(), true);
/*
if (BMySQL.Enable) {
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);
/*
if (BMySQL.Enable) {
BMySQL.query("INSERT INTO `gui-bungeeplayer` (`UUID`, `Name`, `Online`) VALUES ('" + player.getUniqueId() + "', '" + player.getName()
+ "', 'true') ON DUPLICATE KEY UPDATE `Name` = '" + player.getName() + "', `Online` = 'false';");
}
*/
}
@@ -65,7 +77,8 @@ public class BListener implements Listener {
Logger.getLogger(e.getMessage());
}
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
server.sendData("cgui:onlineplayers", stream.toByteArray());
server.sendData("cgui:onlinepl", stream.toByteArray());
});
}
@@ -79,7 +92,7 @@ public class BListener implements Listener {
Logger.getLogger(e.getMessage());
}
BungeeCord.getInstance().getServers().values().stream().forEach((server) -> {
server.sendData("cgui:onlineplayers", stream.toByteArray());
server.sendData("cgui:onlinepl", stream.toByteArray());
});
}
}

View File

@@ -5,7 +5,7 @@ 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.io.IOException;
import java.util.logging.Level;
public final class BMain extends Plugin {
@@ -42,13 +42,18 @@ public final class BMain extends Plugin {
Bsend.console(prefix + " §2Version: §6" + version);
Bsend.console(prefix + " §2Spigot: §6" + spigot);
Bsend.console(prefix + " §2Discord: §6" + discord);
BConfig.create();
/* try {
BConfig.create();
} catch (IOException e) {
e.printStackTrace();
}
*/
plugin.getProxy().registerChannel("cgui:bungee");
plugin.getProxy().getPluginManager().registerListener(plugin, new BListener());
BListener.sendToSpigotDeleteAll();
BMetrics metrics = new BMetrics(this, bstatsID);
/*
if (BMySQL.Enable){
BMySQL.main();
BMySQL.query("CREATE TABLE IF NOT EXISTS `gui-bungeeplayer` (" +
@@ -60,8 +65,8 @@ public final class BMain extends Plugin {
"COLLATE='utf8mb4_general_ci'" +
"ENGINE=InnoDB" +
";");
}
*/
Bsend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
Bsend.console(prefix + "§4==============================================================================");
@@ -86,7 +91,6 @@ public final class BMain extends Plugin {
}
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: " +

View File

@@ -27,13 +27,12 @@ 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("§6Your version: §c" + foundVersion + " §7- §6Current version: §a" + update_version);
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() {

View File

@@ -2,10 +2,10 @@ 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.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.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
@@ -22,6 +22,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import java.io.File;
@@ -36,362 +37,209 @@ public class GUI_Listener implements Listener {
@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.getHead() || 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.getClick() == ClickType.LEFT) {
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.getClick() == ClickType.RIGHT) {
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);
}
JavaPlugin plugin = Main.plugin;
if (e.getInventory() == null) return;
if (e.getCurrentItem() == null) return;
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 (e.getSlot() != slot.Slot) continue;
if (e.getCurrentItem().getType() == ItemVersion.getHead() || e.getCurrentItem().getType() == Material.valueOf(slot.Item.toUpperCase().replace(".", "_"))) {
if (!slot.Perm
|| player.hasPermission("commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1))
|| player.hasPermission("commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1) + ".use")
|| player.hasPermission("commandgui.admin")) {
if (!slot.Enable) continue;
if (!e.getCurrentItem().getItemMeta().getDisplayName().equals(Replace.replace(prefix, slot.Name))) continue;
if (slot.Cost_Enable) {
if (slot.Command_Enable || slot.Message_Enable || slot.OpenGUI_Enable || slot.ServerChange) {
if (!Vault.buy(prefix, player, slot.Price)) {
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 {
player.sendMessage(SelectMessages.Buy_msg.replace("[itemname]", Replace.replace(prefix, slot.Name))
.replace("[price]", slot.Price + " " + SelectConfig.Currency));
execute(slot, player, e, gui);
}
}
} else {
player.sendMessage(SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, slot.Name))
.replace("[perm]", "commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1)));
}
}
} else execute(slot, player, e, gui);
} else player.sendMessage(SelectMessages.NoPermissionForItem.replace("[item]", Replace.replace(prefix, slot.Name))
.replace("[perm]", "commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1)));
}
}
}
}
}
private static void execute(Slot slot, Player player, InventoryClickEvent e, Object gui) {
if (slot.Command_Enable) command(slot, player);
if (slot.OpenGUI_Enable) openGUI(slot, player);
if (slot.Message_Enable) message(slot, player);
if (slot.ServerChange) serverChange(slot, player);
if (slot.SetConfigEnable) setConfig(slot, player, e);
if (SelectConfig.Sound_Enable && SelectConfig.Sound_Click_Enable) sound(slot, player, gui);
}
private static void command(Slot slot, Player player) {
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, cmd.replace("[player]", player.getName()), slot.CommandAsConsole);
}
} 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 {
for (String cmd : slot.Command) {
if (slot.CommandAsConsole) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), cmd.replace("[player]", player.getName()));
} else player.chat("/" + cmd.replace("[player]", player.getName()));
}
}
}
}.runTaskLater(plugin, 2L);
}
private static void openGUI(Slot slot, Player player) {
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);
}
private static void message(Slot slot, Player player) {
new BukkitRunnable() {
@Override
public void run() {
player.closeInventory();
}
}.runTaskLater(plugin, 1L);
for (String msg : slot.Message) {
if (Main.PaPi) {
if (slot.Cost_Enable) {
player.sendMessage(Replace.replacePrice(prefix, player, msg, slot.Price + " " + SelectConfig.Currency));
} else player.sendMessage(Replace.replace(prefix, player, msg.replace("[prefix]", prefix)));
} else {
if (slot.Cost_Enable) {
player.sendMessage(Replace.replacePrice(prefix, msg, slot.Price + " " + SelectConfig.Currency));
} else player.sendMessage(Replace.replace(prefix, msg.replace("[prefix]", prefix)));
}
}
}
private static void serverChange(Slot slot, Player player) {
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);
}
private static void setConfig(Slot slot, Player player, InventoryClickEvent e) {
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.getClick() == ClickType.LEFT) {
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.getClick() == ClickType.RIGHT) {
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);
}
private static void sound(Slot slot, Player player, Object gui) {
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);
}
}

View File

@@ -2,7 +2,7 @@ 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.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;
@@ -12,9 +12,9 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
public class ItemChange {
public static void itemChange(Player player) {
public static void itemChange(Player player, Boolean setCursor) {
Integer slot;
if (SelectConfig.UseItem_InventorySlotEnforce){
if (SelectConfig.UseItem_InventorySlotEnforce) {
slot = SelectConfig.UseItem_InventorySlot;
} else {
if (Select_Database.selectSlot(player) == null) {
@@ -23,10 +23,33 @@ public class ItemChange {
slot = Select_Database.selectSlot(player);
}
}
if (!SelectConfig.UseItem_Enable) {
return;
}
if (SelectConfig.UseItemGameModeProtection) {
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) {
if (SelectConfig.UseItemGameModeRemoveItemWhenItIsDisabled) removeItem(player);
send.debug(Main.plugin,"GameMode disabled: " +player.getName() +" " +player.getGameMode().toString());
return;
}
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) {
if (SelectConfig.UseItemGameModeRemoveItemWhenItIsDisabled) removeItem(player);
send.debug(Main.plugin,"GameMode disabled: " +player.getName() +" " +player.getGameMode().toString());
return;
}
}
if (SelectConfig.UseItemWorldProtection) {
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) {
if (SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled)removeItem(player);
send.debug(Main.plugin,"World disabled: " +player.getName() +" " +player.getWorld().toString());
return;
}
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) {
if (SelectConfig.UseItemWorldRemoveItemWhenItIsDisabled)removeItem(player);
send.debug(Main.plugin,"World disabled: " +player.getName() +" " +player.getWorld().toString());
return;
}
}
if (SelectConfig.UseItem_GiveOnlyOnFirstJoin) {
if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
if (!player.hasPlayedBefore()) {
@@ -34,6 +57,9 @@ public class ItemChange {
@Override
public void run() {
Give_UseItem.onGive(player);
if (setCursor) {
setCursor(player, slot);
}
}
}.runTaskLater(Main.plugin, 1L * 1);
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin || SelectConfig.Cursor_ToGUIItem_OnLogin) {
@@ -41,60 +67,89 @@ public class ItemChange {
}
}
}
send.debug(Main.plugin,"GiveOnlyOnFirstJoin: " +player.getName());
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.getHead()) {
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
player.getInventory().remove(itm);
player.updateInventory();
break;
}
if (!SelectConfig.UseItem_GiveOnEveryJoin) {
send.debug(Main.plugin,"!GiveOnEveryJoin: " +player.getName());
return;
}
new BukkitRunnable() {
@Override
public void run() {
removeItem(player);
if (!SelectConfig.UseItem_AllowToggle || Select_Database.selectItemStatus(player)) {
if (SelectConfig.UseItem_InventorySlotEnforce || player.getInventory().getItem(slot - 1) == null) {
send.debug(Main.plugin,"Give: " +player.getName());
Give_UseItem.onGive(player);
if (setCursor) {
setCursor(player, slot);
}
} 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 (!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);
}
if (empty) {
Give_UseItem.onGiveADD(player);
}
}
}
}.runTaskLater(Main.plugin, 1L * 1);
}
}.runTaskLater(Main.plugin, 1L * 1);
}
private static void setCursor(Player player, int slot) {
send.debug(Main.plugin,"setCursor 1 Player: "+player.getName());
if (!SelectConfig.Cursor_ToGUIItem_OnLogin) {
return;
}
send.debug(Main.plugin,"setCursor 2 Player: "+player.getName());
if (SelectConfig.Cursor_ToGUIItem_OnlyOnFirstLogin) {
if (!player.hasPlayedBefore()) {
player.getInventory().setHeldItemSlot(slot - 1);
send.debug(Main.plugin,"setCursor 3 Player: "+player.getName());
}
return;
}
send.debug(Main.plugin,"setCursor 4 Player: "+player.getName());
if (!SelectConfig.Bungee) {
player.getInventory().setHeldItemSlot(slot - 1);
send.debug(Main.plugin,"setCursor 5 Player: "+player.getName());
return;
}
send.debug(Main.plugin,"setCursor 6 Player: "+player.getName());
if (SelectConfig.UseItem_ServerChange) {
player.getInventory().setHeldItemSlot(slot - 1);
send.debug(Main.plugin,"setCursor 7 Player: "+player.getName());
return;
}
send.debug(Main.plugin,"setCursor 8 Player: "+player.getName());
send.debug(Main.plugin,"setCursor bungeejoinplayers: " +Main.bungeejoinplayers);
send.debug(Main.plugin,"setCursor Player: " +player.getName());
if (Main.bungeejoinplayers.contains(player.getName())) {
player.getInventory().setHeldItemSlot(slot - 1);
send.debug(Main.plugin,"setCursor 9 Player: "+player.getName());
Main.bungeejoinplayers.remove(player.getName());
}
}
private static void removeItem(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.getHead()) {
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
player.getInventory().remove(itm);
player.updateInventory();
break;
}
}
}
}
}
}

View File

@@ -3,7 +3,7 @@
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.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.update.UpdateAPI;
@@ -23,10 +23,9 @@ public class PluginEvent implements Listener {
public void onJoinEvent(PlayerLoginEvent event) {
Player player = event.getPlayer();
Select_Database.nameCheck(player);
UpdateAPI.join(Main.plugin,prefix, "commandgui.updatemsg", event.getPlayer(), Util.getSpigot(), Util.getDiscord());
UpdateAPI.join(Main.plugin, prefix, "commandgui.updatemsg", event.getPlayer(), Util.getSpigot(), Util.getDiscord());
}
@EventHandler
public void onClearServer(ServerCommandEvent event) {
if (SelectConfig.UseItem_KeepAtCommandClear) {
@@ -36,11 +35,11 @@ public class PluginEvent implements Listener {
public void run() {
try {
Player player = Bukkit.getPlayer(event.getCommand().replace("/", "").replace("clear ", ""));
if (player == null){
if (player == null) {
return;
}
clearGive(player);
} catch (Exception ex){
} catch (Exception ex) {
ex.printStackTrace();
return;
}
@@ -50,7 +49,6 @@ public class PluginEvent implements Listener {
}
}
@EventHandler
public void onClearPlayer(PlayerCommandPreprocessEvent event) {
if (SelectConfig.UseItem_KeepAtCommandClear) {
@@ -74,6 +72,6 @@ public class PluginEvent implements Listener {
}
private static void clearGive(Player player) {
ItemChange.itemChange(player);
ItemChange.itemChange(player, false);
}
}

View File

@@ -3,13 +3,14 @@ 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.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
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.Bungee.Lib.messages.Bsend;
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 org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
@@ -32,12 +33,16 @@ public class Events implements Listener {
@EventHandler
public void onJoin(PlayerJoinEvent e) {
if (CGuiAPI.JoinDisable) return;
if (CGuiAPI.JoinDisable) {
send.debug(Main.plugin,"JoinDisable");
return;
}
if (e.getPlayer().hasPermission("commandgui.get.guiitem.at.login")) {
new BukkitRunnable() {
@Override
public void run() {
ItemChange.itemChange(e.getPlayer());
send.debug(Main.plugin,"itemChange: " + e.getPlayer().getName());
ItemChange.itemChange(e.getPlayer(), true);
}
}.runTaskLater(Main.plugin, 20L * 1);
}
@@ -74,55 +79,36 @@ public class Events implements Listener {
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);
// }
//}
ItemChange.itemChange(player, false);
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onGameModeChange(PlayerGameModeChangeEvent e) {
Player player = e.getPlayer();
if (!SelectConfig.UseItemGameModeChangeEnable) {
return;
}
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.getHead()) {
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
player.getInventory().remove(itm);
player.updateInventory();
break;
}
}
}
}
} else ItemChange.itemChange(player);
ItemChange.itemChange(player, false);
}
}.runTaskLater(Main.plugin, 1L);
}.runTaskLater(Main.plugin, SelectConfig.UseItemGameModeChangeDelayInTicks * 1L);
}
@EventHandler
public void onWorldChange(PlayerChangedWorldEvent e) {
Player player = e.getPlayer();
if (!SelectConfig.UseItemWorldChangeEnable) {
return;
}
new BukkitRunnable() {
@Override
public void run() {
ItemChange.itemChange(player, false);
}
}.runTaskLater(Main.plugin, SelectConfig.UseItemWorldChangeDelayInTicks * 1L);
}
@EventHandler(priority = EventPriority.HIGHEST)
@@ -132,51 +118,64 @@ public class Events implements Listener {
if (SelectConfig.UseItem_PlayerHead_Enable) {
if (e.getItem() != null && p.getItemInHand().getType() == ItemVersion.getHead()) {
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));
}
openGUI(e, p);
}
}
} 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));
}
openGUI(e, p);
}
}
}
}
}
private static void openGUI(PlayerInteractEvent e, Player p) {
e.setCancelled(true);
if (p.isSneaking()) {
Commands.info(p);
return;
}
if (!legacy()) {
if (!topInventoryIsEmpty(p)) return;
}
if (SelectConfig.UseItemGameModeProtection) {
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemGameModeList.contains(p.getGameMode().toString())) {
e.setCancelled(true);
send.player(p, SelectMessages.UseItemDisabledInGameMode);
return;
}
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemGameModeList.contains(p.getGameMode().toString())) {
e.setCancelled(true);
send.player(p, SelectMessages.UseItemDisabledInGameMode);
return;
}
}
if (SelectConfig.UseItemWorldProtection) {
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemWorldList.contains(p.getWorld().getName())) {
e.setCancelled(true);
send.player(p, SelectMessages.UseItemDisabledInWorld);
return;
}
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("whitelist") && !SelectConfig.UseItemWorldList.contains(p.getWorld().getName())) {
e.setCancelled(true);
send.player(p, SelectMessages.UseItemDisabledInWorld);
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;
@@ -187,7 +186,6 @@ public class Events implements Listener {
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onItemMove(InventoryDragEvent e) {
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
@@ -197,14 +195,14 @@ public class Events implements Listener {
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
p.closeInventory();
e.setCancelled(true);
ItemChange.itemChange(p);
ItemChange.itemChange(p, false);
}
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);
ItemChange.itemChange(p, false);
}
}
}

View File

@@ -1,6 +1,6 @@
package de.jatitv.commandguiv2.Spigot.Listener.UseItem_Listener;
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import net.t2code.lib.Spigot.Lib.minecraftVersion.MCVersion;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;

View File

@@ -1,8 +1,10 @@
package de.jatitv.commandguiv2.Spigot;
//s<ds
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.system.Load;
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.T2CodeTemplate;
import net.t2code.lib.Spigot.Lib.messages.send;
@@ -18,7 +20,6 @@ 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() {
@@ -39,6 +40,7 @@ public final class Main extends JavaPlugin {
public static String update_version = null;
public static Boolean PaPi = false;
public static Boolean PlotSquaredGUI = false;
public static Boolean LuckyBox = false;
public static Boolean PlugManGUI = false;
public static HashMap<String, Object> guiHashMap = new HashMap<>();
@@ -64,11 +66,15 @@ public final class Main extends JavaPlugin {
}
public static void addonLoad() {
if (Bukkit.getPluginManager().getPlugin("PlotSquaredGUI") != null) {
if (PluginCheck.plotSquaredGUI()) {
PlotSquaredGUI = true;
addonEnable(Bukkit.getPluginManager().getPlugin("PlotSquaredGUI"));
}
if (Bukkit.getPluginManager().getPlugin("PlugManGUI") != null) {
if (PluginCheck.luckyBox()) {
LuckyBox = true;
addonEnable(Bukkit.getPluginManager().getPlugin("T2C-LuckyBox"));
}
if (PluginCheck.plugManGUI()) {
PlugManGUI = true;
addonEnable(Bukkit.getPluginManager().getPlugin("PlugManGUI"));
}
@@ -110,5 +116,6 @@ public final class Main extends JavaPlugin {
public void onDisable() {
// Plugin shutdown logic
if (enable) T2CodeTemplate.onDisable(prefix, autor, version, Util.getSpigot(), Util.getDiscord());
MySQL.close();
}
}

View File

@@ -93,7 +93,6 @@ public class Obj_Select {
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);
@@ -107,7 +106,6 @@ public class Obj_Select {
e.printStackTrace();
}
}
}
}
}

View File

@@ -1,8 +1,8 @@
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.config.DefaultGUICreate;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Util;
import org.bukkit.Bukkit;

View File

@@ -2,8 +2,8 @@ package de.jatitv.commandguiv2.Spigot.cmdManagement;
import de.jatitv.commandguiv2.Spigot.Main;
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.config.DefaultGUICreate;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.commands.Tab;
import org.bukkit.Bukkit;

View File

@@ -1,7 +1,7 @@
package de.jatitv.commandguiv2.Spigot.cmdManagement;
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import org.bukkit.command.Command;

View File

@@ -6,10 +6,10 @@ 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.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.system.config.languages.LanguagesCreate;
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.config.config.ConfigCreate;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
@@ -26,7 +26,7 @@ public class Commands {
if (sender instanceof Player) {
Player player = (Player) sender;
send.player(player, Util.getPrefix() + "§4======= §8[§4Command§9GUI§8] §4=======");
send.player(player, Util.getPrefix() + " §2String.valueOf(Main.autor): §6" + String.valueOf(String.valueOf(Main.autor)).replace("[", "").replace("]", ""));
send.player(player, Util.getPrefix() + " §2Autor: §6" + String.valueOf(Main.autor).replace("[", "").replace("]", ""));
if (UpdateAPI.PluginVersionen.get(Main.plugin.getName()).publicVersion.equalsIgnoreCase(Main.version)) {
send.player(player, Util.getPrefix() + " §2Version: §6" + Main.version);

View File

@@ -1,9 +1,9 @@
package de.jatitv.commandguiv2.Spigot.cmdManagement;
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.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.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.replace.Replace;

View File

@@ -7,6 +7,7 @@ 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 org.eclipse.sisu.space.ClassFinder;
import java.io.File;
@@ -110,6 +111,11 @@ public class AliasRegister {
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 (NMSVersion.v1_18_R2) {
send.debug(plugin, "Alias register 1.18_R2");
org.bukkit.craftbukkit.v1_18_R2.CraftServer craftServer = (org.bukkit.craftbukkit.v1_18_R2.CraftServer) plugin.getServer();
craftServer.getCommandMap().register(alias, new RegisterCommand(alias));
}
}
}
}

View File

@@ -4,8 +4,8 @@ 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 de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

View File

@@ -1,4 +1,4 @@
package de.jatitv.commandguiv2.Spigot.system.config;
package de.jatitv.commandguiv2.Spigot.config;
import de.jatitv.commandguiv2.Spigot.Main;
import net.t2code.lib.Spigot.Lib.messages.send;

View File

@@ -0,0 +1,160 @@
package de.jatitv.commandguiv2.Spigot.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;
public class ConfigCreate {
public static Integer ConfigVersion = 4;
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);
if (yamlConfiguration.getInt("ConfigVersion") < ConfigVersion && new File(Main.getPath(), "config.yml").exists()) {
send.console(Util.getPrefix() +" §4----------------------");
send.console(Util.getPrefix() +" ");
send.console(Util.getPrefix() +" §6New features have been added to CommandGUI. The Config is adapted!");
send.console(Util.getPrefix() +" ");
send.console(Util.getPrefix() +" §4----------------------");
}
yamlConfiguration.set("ConfigVersion", ConfigVersion);
Config.set("Plugin.UpdateCheckOnJoin", true, yamlConfiguration);
Config.set("Plugin.Debug", false, yamlConfiguration);
Config.set("Plugin.HelpAlias", true, yamlConfiguration);
Config.set("Plugin.language", "english", yamlConfiguration);
Config.set("Plugin.Currency", "$", yamlConfiguration);
Config.set("Plugin.DefaultGUI", "default", yamlConfiguration);
Config.set("Storage.Type", "YML", yamlConfiguration);
Config.set("Storage.MySQL.IP", "localhost", yamlConfiguration);
Config.set("Storage.MySQL.Port", 3306, yamlConfiguration);
Config.set("Storage.MySQL.Database", "database", yamlConfiguration);
Config.set("Storage.MySQL.User", "root", yamlConfiguration);
Config.set("Storage.MySQL.Password", "password", yamlConfiguration);
Config.set("Storage.MySQL.SSL", false, yamlConfiguration);
Config.set("BungeeCord.Enable", false, yamlConfiguration);
Config.set("BungeeCord.ThisServer", "server", yamlConfiguration);
Config.set("UseItem.Enable", true, yamlConfiguration);
Config.set("UseItem.AllowToggle", true, yamlConfiguration);
Config.set("UseItem.AllowSetSlot", true, yamlConfiguration);
Config.set("UseItem.BlockMoveAndDrop", true, yamlConfiguration);
Config.set("UseItem.OpenGUI", "default", yamlConfiguration);
Config.set("UseItem.Permission.NeededToUse", true, yamlConfiguration);
Config.set("UseItem.KeepAtCommandClear", true, yamlConfiguration);
Config.set("UseItem.InventorySlot.Slot", 1, yamlConfiguration);
Config.set("UseItem.InventorySlot.SlotEnforce", false, yamlConfiguration);
Config.set("UseItem.InventorySlot.FreeSlot", false, yamlConfiguration);
Config.set("UseItem.Item.Material", "paper", yamlConfiguration);
if (!(MCVersion.minecraft1_8 || MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12)) {
Config.set("UseItem.Item.PlayerHead.Enable", false, yamlConfiguration);
Config.set("UseItem.Item.PlayerHead.Base64.Enable", false, yamlConfiguration);
Config.set("UseItem.Item.PlayerHead.Base64.Base64Value", "", yamlConfiguration);
Config.set("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI", false, yamlConfiguration);
Config.set("UseItem.Item.PlayerHead.Playername", "", yamlConfiguration);
}
Config.set("UseItem.Item.Name", "&bDefault &6GUI", yamlConfiguration);
Config.set("UseItem.Item.Lore", Arrays.asList("&eThis is an example GUI"), yamlConfiguration);
Config.set("UseItem.Join.GiveOnEveryJoin", true, yamlConfiguration);
Config.set("UseItem.Join.GiveOnlyOnFirstJoin", false, 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", true, yamlConfiguration);
Config.set("UseItem.Join.Cursor.ToGUIItem.Spigot.OnOnlyFirstLogin", true, yamlConfiguration);
Config.set("UseItem.Join.Cursor.ToGUIItem.Bungee.OnServerChange", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Change.Enable", true, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Change.DelayInTicks", 1, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.Enable", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.Mode", "blacklist", yamlConfiguration);
Config.set("Advanced.UseItem.GameMode.Protection.List", Arrays.asList("CREATIVE", "Spectator"), yamlConfiguration);
Config.set("Advanced.UseItem.World.Change.Enable", true, yamlConfiguration);
Config.set("Advanced.UseItem.World.Change.DelayInTicks", 1, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.Enable", false, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled", false, yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.Mode", "blacklist", yamlConfiguration);
Config.set("Advanced.UseItem.World.Protection.List", Arrays.asList("World1", "World2"), yamlConfiguration);
Config.set("Sound.Enable", true, yamlConfiguration);
Config.set("Sound.OpenInventory.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.OpenInventory.Sound", "CHEST_OPEN", yamlConfiguration);
} else Config.set("Sound.OpenInventory.Sound", "BLOCK_CHEST_OPEN", yamlConfiguration);
Config.set("Sound.Click.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.Click.Sound", "NOTE_STICKS", yamlConfiguration);
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
Config.set("Sound.Click.Sound", "BLOCK_NOTE_HAT", yamlConfiguration);
} else Config.set("Sound.Click.Sound", "BLOCK_NOTE_BLOCK_HAT", yamlConfiguration);
Config.set("Sound.NoMoney.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.NoMoney.Sound", "NOTE_PIANO", yamlConfiguration);
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
Config.set("Sound.NoMoney.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
} else Config.set("Sound.NoMoney.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
Config.set("Sound.NoInventorySpace.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.NoInventorySpace.Sound", "NOTE_PIANO", yamlConfiguration);
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
Config.set("Sound.NoInventorySpace.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
} else Config.set("Sound.NoInventorySpace.Sound", "BLOCK_NOTE_BLOCK_HARP", yamlConfiguration);
Config.set("Sound.Give.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.Give.Sound", "LEVEL_UP", yamlConfiguration);
} else Config.set("Sound.Give.Sound", "ENTITY_PLAYER_LEVELUP", yamlConfiguration);
Config.set("Sound.PlayerNotFound.Enable", true, yamlConfiguration);
if (MCVersion.minecraft1_8) {
Config.set("Sound.PlayerNotFound.Sound", "NOTE_PIANO", yamlConfiguration);
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_HARP", yamlConfiguration);
} else Config.set("Sound.PlayerNotFound.Sound", "BLOCK_NOTE_BLOCK_HARP", 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");
}
}

View File

@@ -1,7 +1,7 @@
package de.jatitv.commandguiv2.Spigot.system.config.config;
package de.jatitv.commandguiv2.Spigot.config.config;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.system.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.system.database.MySQL;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
@@ -11,6 +11,7 @@ import org.bukkit.Sound;
import org.bukkit.configuration.file.YamlConfiguration;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class SelectConfig {
@@ -42,8 +43,19 @@ public class SelectConfig {
public static Boolean UseItem_Permission;
public static Boolean UseItem_KeepAtCommandClear;
public static Boolean UseItemGameModeChangeEnable;
public static int UseItemGameModeChangeDelayInTicks;
public static Boolean UseItemGameModeChangeDisableInSpectator;
public static Boolean UseItemGameModeProtection;
public static Boolean UseItemGameModeRemoveItemWhenItIsDisabled;
public static String UseItemGameModeMode;
public static List<String> UseItemGameModeList;
public static Boolean UseItemWorldChangeEnable;
public static int UseItemWorldChangeDelayInTicks;
public static Boolean UseItemWorldProtection;
public static Boolean UseItemWorldRemoveItemWhenItIsDisabled;
public static String UseItemWorldMode;
public static List<String> UseItemWorldList;
public static Boolean UseItem_InventorySlot_FreeSlot;
public static Integer UseItem_InventorySlot;
@@ -55,7 +67,7 @@ public class SelectConfig {
public static Boolean UseItem_PlayerWhoHasOpenedTheGUI;
public static String UseItem_PlayerName;
public static String UseItem_Name;
public static List UseItem_Lore;
public static List<String> UseItem_Lore;
public static Boolean Sound_Enable = true;
@@ -71,7 +83,6 @@ public class SelectConfig {
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;
@@ -130,15 +141,30 @@ public class SelectConfig {
UseItem_PlayerWhoHasOpenedTheGUI = yamlConfiguration.getBoolean("UseItem.Item.PlayerHead.PlayerWhoHasOpenedTheGUI");
UseItem_PlayerName = yamlConfiguration.getString("UseItem.Item.PlayerHead.PlayerName");
UseItem_Name = Replace.replace(Util.getPrefix(),yamlConfiguration.getString("UseItem.Item.Name"));
UseItem_Lore = yamlConfiguration.getList("UseItem.Item.Lore");
UseItem_Lore = yamlConfiguration.getStringList("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");
UseItemGameModeChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Change.Enable");
UseItemGameModeChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.GameMode.Change.DelayInTicks");
UseItemGameModeProtection = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.Enable");
UseItemGameModeRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.GameMode.Protection.RemoveItemWhenItIsDisabled");
UseItemGameModeMode = yamlConfiguration.getString("Advanced.UseItem.GameMode.Protection.Mode");
List<String> gml = new ArrayList<>();
for (String gm : yamlConfiguration.getStringList("Advanced.UseItem.GameMode.Protection.List")){
gml.add(gm.toUpperCase());
}
UseItemGameModeList = gml;
UseItemWorldChangeEnable = yamlConfiguration.getBoolean("Advanced.UseItem.World.Change.Enable");
UseItemWorldChangeDelayInTicks = yamlConfiguration.getInt("Advanced.UseItem.World.Change.DelayInTicks");
UseItemWorldProtection = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.Enable");
UseItemWorldRemoveItemWhenItIsDisabled = yamlConfiguration.getBoolean("Advanced.UseItem.World.Protection.RemoveItemWhenItIsDisabled");
UseItemWorldMode = yamlConfiguration.getString("Advanced.UseItem.World.Protection.Mode");
UseItemWorldList =yamlConfiguration.getStringList("Advanced.UseItem.World.Protection.List");
Sound_Enable = yamlConfiguration.getBoolean("Sound.Enable");
Sound_OpenInventory_Enable = yamlConfiguration.getBoolean("Sound.OpenInventory.Enable");
@@ -154,33 +180,33 @@ public class SelectConfig {
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;
soundOpenInventory = "CHEST_OPEN";
} else {
soundOpenInventory = ConfigCreate.Sound_OpenInventory_ab_1_9;
soundOpenInventory = "BLOCK_CHEST_OPEN";
}
String soundClick;
if (MCVersion.minecraft1_8) {
soundClick = ConfigCreate.Sound_Click_1_8;
soundClick = "NOTE_STICKS";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
soundClick = ConfigCreate.Sound_Click_1_9_bis_1_12;
soundClick = "BLOCK_NOTE_HAT";
} else {
soundClick = ConfigCreate.Sound_Click_ab_1_13;
soundClick = "BLOCK_NOTE_BLOCK_HAT";
}
String soundNoMoney;
if (MCVersion.minecraft1_8) {
soundNoMoney = ConfigCreate.Sound_NoMoney_1_8;
soundNoMoney = "NOTE_PIANO";
} else if (MCVersion.minecraft1_9 || MCVersion.minecraft1_10 || MCVersion.minecraft1_11 || MCVersion.minecraft1_12) {
soundNoMoney = ConfigCreate.Sound_NoMoney_1_9_bis_1_12;
soundNoMoney = "BLOCK_NOTE_HARP";
} else {
soundNoMoney = ConfigCreate.Sound_NoMoney_ab_1_13;
soundNoMoney = "BLOCK_NOTE_BLOCK_HARP";
}
String soundNoInventorySpace;

View File

@@ -1,4 +1,4 @@
package de.jatitv.commandguiv2.Spigot.system.config.languages;
package de.jatitv.commandguiv2.Spigot.config.languages;
import de.jatitv.commandguiv2.Spigot.Main;
import net.t2code.lib.Spigot.Lib.messages.send;
@@ -42,6 +42,8 @@ public class LanguagesCreate {
set("UseItem.SlotNotEmpty", MSG.EN_ItemSlotNotEmpty, yamlConfigurationEN);
set("UseItem.SlotAlreadySet", MSG.EN_ItemSlotAlreadySet, yamlConfigurationEN);
set("UseItem.ItemSlot_wrongValue", MSG.EN_ItemSlot_wrongValue, yamlConfigurationEN);
set("UseItem.DisabledInGameMode", MSG.EN_UseItemDisabledInGameMode, yamlConfigurationEN);
set("UseItem.DisabledInWorld", MSG.EN_UseItemDisabledInWorld, yamlConfigurationEN);
set("Cost.Buy_msg", MSG.EN_Buy_msg, yamlConfigurationEN);
set("Cost.No_money", MSG.EN_No_money, yamlConfigurationEN);
@@ -104,6 +106,8 @@ public class LanguagesCreate {
set("UseItem.SlotNotEmpty", MSG.DE_ItemSlotNotEmpty, yamlConfigurationDE);
set("UseItem.SlotAlreadySet", MSG.DE_ItemSlotAlreadySet, yamlConfigurationDE);
set("UseItem.ItemSlot_wrongValue", MSG.DE_ItemSlot_wrongValue, yamlConfigurationDE);
set("UseItem.DisabledInGameMode", MSG.DE_UseItemDisabledInGameMode, yamlConfigurationDE);
set("UseItem.DisabledInWorld", MSG.DE_UseItemDisabledInWorld, yamlConfigurationDE);
set("Cost.Buy_msg", MSG.DE_Buy_msg, yamlConfigurationDE);
set("Cost.No_money", MSG.DE_No_money, yamlConfigurationDE);
@@ -167,6 +171,8 @@ public class LanguagesCreate {
set("UseItem.SlotNotEmpty", MSG.NO_ItemSlotNotEmpty, yamlConfigurationNO);
set("UseItem.SlotAlreadySet", MSG.NO_ItemSlotAlreadySet, yamlConfigurationNO);
set("UseItem.ItemSlot_wrongValue", MSG.NO_ItemSlot_wrongValue, yamlConfigurationNO);
set("UseItem.DisabledInGameMode", MSG.NO_UseItemDisabledInGameMode, yamlConfigurationNO);
set("UseItem.DisabledInWorld", MSG.NO_UseItemDisabledInWorld, yamlConfigurationNO);
set("Cost.Buy_msg", MSG.NO_Buy_msg, yamlConfigurationNO);
set("Cost.No_money", MSG.NO_No_money, yamlConfigurationNO);

View File

@@ -9,7 +9,7 @@
// \_____\_____|\____/|_____|
// -----------------------------
package de.jatitv.commandguiv2.Spigot.system.config.languages;
package de.jatitv.commandguiv2.Spigot.config.languages;
public class MSG {
@@ -38,6 +38,8 @@ public class MSG {
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_UseItemDisabledInGameMode = "[prefix] &cThe UseItem is disabled in this GameMode!";
public static String EN_UseItemDisabledInWorld = "[prefix] &cThe UseItem is disabled in this World!";
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!";
@@ -79,6 +81,8 @@ public class MSG {
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_UseItemDisabledInGameMode = "[prefix] &cDas UseItem ist in diesem GameMode deaktiviert!";
public static String DE_UseItemDisabledInWorld = "[prefix] &cDas UseItem ist in dieser Welt deaktiviert!";
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!";
@@ -130,6 +134,8 @@ public class MSG {
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_UseItemDisabledInGameMode = "[prefix] &cBrukselementet er deaktivert i denne spillmodusen!!";
public static String NO_UseItemDisabledInWorld = "[prefix] &cUseItem er deaktivert i denne verden!";
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!";

View File

@@ -1,7 +1,7 @@
package de.jatitv.commandguiv2.Spigot.system.config.languages;
package de.jatitv.commandguiv2.Spigot.config.languages;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Util;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.replace.Replace;
@@ -32,6 +32,8 @@ public class SelectMessages {
public static String ItemSlotNotEmpty;
public static String ItemSlotAlreadySet;
public static String ItemSlot_wrongValue;
public static String UseItemDisabledInGameMode;
public static String UseItemDisabledInWorld;
public static String Buy_msg;
public static String No_money;
@@ -97,6 +99,8 @@ public class SelectMessages {
ItemSlotNotEmpty = select("UseItem.SlotNotEmpty", yamlConfiguration_msg);
ItemSlotAlreadySet = select("UseItem.SlotAlreadySet", yamlConfiguration_msg);
ItemSlot_wrongValue = select("UseItem.ItemSlot_wrongValue", yamlConfiguration_msg);
UseItemDisabledInGameMode =select("UseItem.DisabledInGameMode",yamlConfiguration_msg);
UseItemDisabledInWorld =select("UseItem.DisabledInWorld",yamlConfiguration_msg);
Buy_msg = select("Cost.Buy_msg", yamlConfiguration_msg);
No_money = select("Cost.No_money", yamlConfiguration_msg);

View File

@@ -5,15 +5,16 @@ 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.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.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 net.t2code.luckyBox.api.LuckyBoxAPI;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@@ -54,6 +55,16 @@ public class OpenGUI {
}
}
return;
case "plugin.T2C-LuckyBox":
if (Main.LuckyBox) {
LuckyBoxAPI.openShop(player);
} else {
if (player.hasPermission("commandgui.admin")) {
send.player(player, prefix + " §4T2C-LuckyBox could not be found! §9Please download it here: " +
"§6https://www.spigotmc.org/resources/luckybox.98154/");
}
}
return;
}
if (MCVersion.minecraft1_13) {
@@ -79,47 +90,25 @@ public class OpenGUI {
}
}
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 {
ItemStack item = ItemVersion.getHeadIS();
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
if (slot.Base64_Enable) {
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);
if (!slot.Perm
|| player.hasPermission("commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1))
|| player.hasPermission("commandgui.gui." + gui.Command_Command + ".slot." + (slot.Slot + 1)+".see")
|| player.hasPermission("commandgui.admin")) {
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.PlayerWhoHasOpenedTheGUI) {
ItemStack item = ItemVersion.getHeadIS();
SkullMeta itemMeta = (SkullMeta) item.getItemMeta();
if (slot.Base64_Enable) {
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));
@@ -127,7 +116,16 @@ public class OpenGUI {
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());
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) {
@@ -136,46 +134,63 @@ public class OpenGUI {
item.setAmount(am);
inventory.setItem(slot.Slot, item);
} else {
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));
if (slot.PlayerWhoHasOpenedTheGUI) {
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 {
itemMeta.setDisplayName(Replace.replace(prefix, slot.Name.replace("[player]", player.getName())));
itemMeta.setLore(Replace.replacePrice(prefix, player, slot.Lore, slot.Price + " " + SelectConfig.Currency));
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);
}
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));
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);
}
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)));

View File

@@ -2,6 +2,8 @@ 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.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;
@@ -9,35 +11,51 @@ import java.io.*;
public class Bungee_Sender_Reciver implements PluginMessageListener {
public static void sendToBungee(Player player,String channel, String information) {
public static void sendToBungee(CommandSender sender, String information, Boolean console) {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
DataOutputStream output = new DataOutputStream(stream);
try {
output.writeUTF(channel);
if (console) {
output.writeUTF("cgui-Console");
} else {
if (sender instanceof Player) {
output.writeUTF(sender.getName());
} else {
output.writeUTF("cgui-Console");
}
}
output.writeUTF(information);
} catch (IOException e) {
e.printStackTrace();
}
player.sendPluginMessage(Main.plugin, "cgui:bungee", stream.toByteArray());
if (sender instanceof Player) {
Player player = (Player) sender;
player.sendPluginMessage(Main.plugin, "cgui:bungee", stream.toByteArray());
}else {
for(Player player : Bukkit.getOnlinePlayers()){
player.sendPluginMessage(Main.plugin, "cgui:bungee", stream.toByteArray());
return;
}
}
}
@Override
public void onPluginMessageReceived(String channel, Player player, byte[] message) {
DataInputStream stream = new DataInputStream(new ByteArrayInputStream(message));
send.debug(Main.plugin,"stream: "+stream.toString());
try {
String subChannel = stream.readUTF();
String input = stream.readUTF();
send.debug(Main.plugin,"subChannel: " +subChannel);
send.debug(Main.plugin,"input: " +input);
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;
}

View File

@@ -3,7 +3,7 @@ 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.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;
@@ -35,7 +35,10 @@ public class Give_UseItem {
}
if (SelectConfig.UseItem_InventorySlot_FreeSlot) {
player.getInventory().addItem(itemStack(player));
} else player.getInventory().setItem(slot - 1, itemStack(player));
} else {
send.debug(Main.plugin,"setUseItem: " + player.getName() + " Slot: "+ Integer.parseInt(String.valueOf(slot-1)));
player.getInventory().setItem(slot - 1, itemStack(player));
}
}
public static void onGiveADD(Player player) {

View File

@@ -2,21 +2,20 @@ 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.config.DefaultGUICreate;
import de.jatitv.commandguiv2.Spigot.config.languages.LanguagesCreate;
import de.jatitv.commandguiv2.Spigot.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 de.jatitv.commandguiv2.Spigot.config.config.ConfigCreate;
import de.jatitv.commandguiv2.Spigot.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;
@@ -62,9 +61,13 @@ public class Load {
if (SelectConfig.Bungee) {
if (!Bukkit.getMessenger().isOutgoingChannelRegistered(plugin,"cgui:bungee")){
send.debug(plugin, "registerIncomingPluginChannel §ecgui:bungee");
send.debug(plugin, "registerOutgoingPluginChannel §ecgui:bungee");
Bukkit.getMessenger().registerOutgoingPluginChannel(plugin,"cgui:bungee");
}
if (!Bukkit.getMessenger().isIncomingChannelRegistered(plugin,"cgui:onlinepl")){
send.debug(plugin, "registerIncomingPluginChannel §ecgui:onlinepl");
Bukkit.getMessenger().registerIncomingPluginChannel(plugin,"cgui:onlinepl", new Bungee_Sender_Reciver());
}
}
try {

View File

@@ -4,7 +4,7 @@
package de.jatitv.commandguiv2.Spigot.system;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Util;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;

View File

@@ -1,223 +0,0 @@
package de.jatitv.commandguiv2.Spigot.system.config.config;
import de.jatitv.commandguiv2.Spigot.Main;
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 {
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");
}
}

View File

@@ -1,5 +1,7 @@
package de.jatitv.commandguiv2.Spigot.system.database;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import de.jatitv.commandguiv2.Spigot.Main;
import net.t2code.lib.Spigot.Lib.messages.send;
import org.bukkit.plugin.Plugin;
@@ -8,57 +10,84 @@ import java.sql.*;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
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;
protected static String url;
public static Boolean SSL;
private static final HikariConfig config = new HikariConfig();
private static HikariDataSource ds;
public static void main() {
Long long_ = Long.valueOf(System.currentTimeMillis());
long long_ = 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");
send.debug(Main.plugin, "Server TimeZone is : " + timeZone);
try {
config.setJdbcUrl("jdbc:mysql://" + ip + ":" + port + "/" + database + "?useJDBCCompliantTimezoneShift=true&allowMultiQueries=true&useLegacyDatetimeCode=false&autoReconnect=true&serverTimezone=" + timeZone + "&useSSL=" + SSL);
config.setUsername(user);
config.setPassword(password);
config.addDataSourceProperty("cachePrepStmts", "true");
config.addDataSourceProperty("prepStmtCacheSize", "250");
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
ds = new HikariDataSource(config);
send.console(Main.prefix + " §2MySQL successfully connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
} catch (Exception ex) {
send.console(Main.prefix + " §4MySQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_) + "ms");
send.error(Main.plugin, ex.getMessage() + " --- " + (System.currentTimeMillis() - long_) + "ms");
}
//Bukkit.getConsoleSender().sendMessage((System.currentTimeMillis() - long_) + "ms");
}
public static void query(String query) {
try (Connection con = DriverManager.getConnection(url, user, password)) {
if (ds == null){
return;
}
send.debug(Main.plugin, query);
try (Connection con = ds.getConnection()) {
Statement stmt = con.createStatement();
stmt.execute(query);
stmt.close();
} catch (SQLException ex) {
System.err.println(ex.getMessage());
} catch (SQLException e) {
System.err.println(e.getMessage());
}
}
public static void query(ArrayList<String> queryList) {
try (Connection con = ds.getConnection()) {
Statement stmt = con.createStatement();
for (String query : queryList) {
send.debug(Main.plugin, query);
stmt.addBatch(query);
}
stmt.executeBatch();
stmt.close();
} catch (SQLException e) {
System.err.println(e.getMessage());
}
}
public static ArrayList<String> selectAll(String query) {
ArrayList<String> Result = new ArrayList<>();
try (Connection con = DriverManager.getConnection(url, user, password)) {
public static HashMap<String, ArrayList<String>> selectAll(String query) {
send.debug(Main.plugin, query);
HashMap<String, ArrayList<String>> Result = new HashMap<>();
try (Connection con = ds.getConnection()) {
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
int columns = rs.getMetaData().getColumnCount();
while (rs.next()) {
Result.add(rs.getString(1));
ArrayList<String> columnList = new ArrayList<>();
for (int i = 1; i <= columns; i++) {
columnList.add(rs.getString(i));
}
Result.put(rs.getString(1), columnList);
}
rs.close();
stmt.close();
@@ -69,11 +98,11 @@ public class MySQL {
}
public static String select(String query) {
send.debug(Main.plugin, query);
String Ausgabe = "";
try (Connection con = DriverManager.getConnection(url, user, password)) {
try (Connection con = ds.getConnection()) {
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
int columns = rs.getMetaData().getColumnCount();
while (rs.next()) {
Ausgabe = String.valueOf(rs.getString(1));
}
@@ -86,11 +115,11 @@ public class MySQL {
}
public static int count(String query) {
Integer count = 0;
try (Connection con = DriverManager.getConnection(url, user, password)) {
send.debug(Main.plugin, query);
int count = 0;
try (Connection con = ds.getConnection()) {
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
int columns = rs.getMetaData().getColumnCount();
while (rs.next()) {
count++;
}
@@ -101,4 +130,28 @@ public class MySQL {
}
return count;
}
public static ArrayList<String> selectRow(String query) {
send.debug(Main.plugin, query);
ArrayList<String> Result = new ArrayList<>();
try (Connection con = ds.getConnection()) {
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
int columns = rs.getMetaData().getColumnCount();
while (rs.next()) {
for (int i = 1; i <= columns; i++) {
Result.add(rs.getString(i));
}
}
rs.close();
stmt.close();
} catch (SQLException ex) {
System.err.println(ex.getMessage());
}
return Result;
}
public static void close() {
ds.close();
}
}

View File

@@ -1,6 +1,6 @@
package de.jatitv.commandguiv2.Spigot.system.database;
import de.jatitv.commandguiv2.Spigot.system.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import org.bukkit.entity.Player;
public class Select_Database {

View File

@@ -1,7 +1,7 @@
package de.jatitv.commandguiv2;
public class Util {
private static double requiredT2CodeLibVersion = 8;
private static double requiredT2CodeLibVersion = 10.3;
private static String Prefix = "§8[§4C§9GUI§8]";
private static Integer SpigotID = 90671;
private static Integer BstatsID = 10840;

View File

@@ -1,26 +1,43 @@
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.config.DefaultGUICreate;
import de.jatitv.commandguiv2.Spigot.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.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 net.t2code.lib.Spigot.Lib.messages.send;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class CGuiAPI {
public static Boolean JoinDisable = false;
public static void onItemChange(Player player) {
ItemChange.itemChange(player);
ItemChange.itemChange(player, false);
}
public static boolean hasUseItemInMainHand(Player player) {
ItemStack item = player.getInventory().getItemInMainHand();
return item.hasItemMeta() && item.getItemMeta().hasDisplayName()
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name);
}
public static boolean hasUseItemInOffHand(Player player) {
ItemStack item = player.getInventory().getItemInOffHand();
return item.hasItemMeta() && item.getItemMeta().hasDisplayName()
&& item.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name);
}
public static void onItemChange(Player player, Boolean setCursor) {
ItemChange.itemChange(player, setCursor);
}
public static void disableItemGiveOnJoin(Boolean disableItemGiveOnJoin) {
send.debug(Main.plugin, "CGuiAPI: " + disableItemGiveOnJoin);
JoinDisable = disableItemGiveOnJoin;
}

View File

@@ -0,0 +1,10 @@
Manifest-Version: 1.0
Main-Class:
Class-Path: PlugmanGUI-3.0.jar spigot-1.8r3.jar spigot-1.9r1.jar spigot-
1.15r1.jar T2CodeLib-10.3.jar spigot-1.18r1.jar bungee-1615.jar spigot-
1.9r2.jar spigot-1.16r3.jar spigot-1.14r1.jar slf4j-api-1.7.25.jar Luck
yBox-API-4.2.2.jar spigot-1.10r1.jar spigot-1.16r1.jar spigot-1.13r2.ja
r HikariCP-3.4.5.jar spigot-1.11r1.jar spigot-1.13r1.jar spigot-1.8r2.j
ar spigot-1.17r1.jar spigot-1.12r1.jar spigot-1.16r2.jar spigot-1.8r1.j
ar

View File

@@ -1,8 +0,0 @@
MySQL:
Enable: false
IP: localhost
Port: 3306
Database: database
User: user
Password: ''
SSL: false

View File

@@ -0,0 +1,159 @@
GUI:
Enable: true
Lines: 1
Name: '&5default &9GUI'
FillItem:
Enable: true
Item: BLACK_STAINED_GLASS_PANE
Command:
Alias: true
Permission:
Required: true
Slots:
SupportDiscord:
Slot: 4
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: §7http://dc.t2code.net'
CustomSound:
Enable: false
NoSound: false
Sound: ''
Cost:
Enable: false
Price: 0.0
Command:
Enable: false
BungeeCommand: false
CommandAsConsole: false
Command: []
ServerChange:
Enable: false
Server: ''
OpenGUI:
Enable: false
GUI: ''
Toggle:
Permission:
Enable: false
Permission: ''
UseItem:
Enable: false
Message:
Enable: true
Message:
- '&6You can find more information on Discord: &ehttp://dc.t2code.net'
Permission:
Required: false
SetConfig:
Enable: false
File:
Path: ''
Option:
Path: ''
Premat: String
Value:
LeftClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
RightClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
PluginReload:
Enable: false
Command: ''
UseItem:
Slot: 6
Enable: true
Item:
Empty: false
Amount: 1
PlayerHead:
Enable: false
Base64:
Enable: false
Base64Value: ''
PlayerWhoHasOpenedTheGUI: false
PlayerName: ''
Material: ''
Name: '&6Toggle UseItem'
Lore:
- '&bYou currently have the UseItem set to: %commandgui_useitem%'
CustomSound:
Enable: false
NoSound: false
Sound: ''
Cost:
Enable: false
Price: 0.0
Command:
Enable: false
BungeeCommand: false
CommandAsConsole: false
Command: []
ServerChange:
Enable: false
Server: ''
OpenGUI:
Enable: false
GUI: ''
Toggle:
Permission:
Enable: false
Permission: ''
UseItem:
Enable: true
Message:
Enable: true
Message:
- '&bYour UseItem was set to: %commandgui_useitem%&b.'
Permission:
Required: false
SetConfig:
Enable: false
File:
Path: ''
Option:
Path: ''
Premat: String
Value:
LeftClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
RightClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
PluginReload:
Enable: false
Command: ''

View File

@@ -0,0 +1,121 @@
ConfigVersion: 4
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
KeepAtCommandClear: 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:
OnLogin:
Enable: true
Spigot:
OnOnlyFirstLogin: true
Bungee:
OnServerChange: false
Advanced:
UseItem:
GameMode:
Change:
Enable: true
DelayInTicks: 1
Protection:
Enable: false
RemoveItemWhenItIsDisabled: false
Mode: blacklist
List:
- CREATIVE
- Spectator
World:
Change:
Enable: true
DelayInTicks: 1
Protection:
Enable: false
RemoveItemWhenItIsDisabled: false
Mode: blacklist
List:
- World1
- World2
Toggle:
Items:
OnOrYes:
Item:
Base64:
Enable: false
Base64Value: ''
Material: GREEN_WOOL
OffOrNo:
Item:
Base64:
Enable: false
Base64Value: ''
Material: RED_WOOL
Permission:
Commands:
'True': luckperms user [player] permission set [perm] true
'False': luckperms user [player] permission set [perm] false
Placeholder:
'True': '&2true'
'False': '&4false'
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

View File

@@ -0,0 +1,55 @@
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.'
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!'
DisabledInGameMode: '[prefix] &cThe UseItem is disabled in this GameMode!'
DisabledInWorld: '[prefix] &cThe UseItem is disabled in this World!'
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/commandgui admin info&8'''' &eCall the info from &4Command&9GUI
&e.'
Open: '&8''''&b/commandgui [gui]&8'''' &eOpen the GUI: &6[guiname]&e.'
Give: '&8''''&b/commandgui admin give &7<player>&8'''' &eGive a player the GUI item.'
CreateDefaultGUI: '&8''''&b/commandgui admin createdefaultgui&8'''' &eCreate a default
GUI &7([directory])&e.'
Reload: '&8''''&b/commandgui admin 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.'

View File

@@ -0,0 +1,58 @@
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.'
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!'
DisabledInGameMode: '[prefix] &cDas UseItem ist in diesem GameMode deaktiviert!'
DisabledInWorld: '[prefix] &cDas UseItem ist in dieser Welt deaktiviert!'
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/commandgui admin 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/commandgui admin give &7<player>&8'''' &eGebe einem Spieler das
GUI-Item.'
CreateDefaultGUI: '&8''''&b/commandgui admin createdefaultgui&8'''' &eLasse eine
default GUI erstellen &7([directory])&e.'
Reload: '&8''''&b/commandgui admin 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.'

View 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.'
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!'
DisabledInGameMode: '[prefix] &cBrukselementet er deaktivert i denne spillmodusen!!'
DisabledInWorld: '[prefix] &cUseItem er deaktivert i denne verden!'
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/commandgui admin info&8'''' &eKall informasjon fra &4Command&9GUI&e.'
Open: '&8''''&b/commandgui [gui]&8'''' &eÅpne GUIen: &6[guiname]&e.'
Give: '&8''''&b/commandgui admin give &7<player>&8'''' &eGi en spiller GUI gjenstanden.'
CreateDefaultGUI: '&8''''&b/commandgui admin createdefaultgui&8'''' &eLag en normalverdi
GUI &7([directory])&e.'
Reload: '&8''''&b/commandgui admin 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.'

View File

@@ -1,18 +1,5 @@
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
Slot:
Functions:
Item:
Empty: false
Amount: 1
@@ -26,14 +13,14 @@ Slots:
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'
- '&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: §7http://dc.t2code.net'
CustomSound:
Enable: false
NoSound: false
@@ -45,20 +32,25 @@ Slots:
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
Command: []
ServerChange:
Enable: false
Server: ''
OpenGUI:
Enable: false
GUI: ''
Toggle:
Permission:
Enable: false
Permission: ''
UseItem:
Enable: false
Message:
Enable: true
Message:
- '&6You can find more information on Discord: &ehttp://dc.t2code.net'
Permission:
Required: false
SetConfig:
Enable: false
File:
@@ -68,14 +60,12 @@ Slots:
Premat: String
Value:
LeftClick:
ChatInput: false
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
RightClick:
ChatInput: false
String: ''
Boolean: false
Integer: 0

View File

@@ -0,0 +1,69 @@
Slot:
Functions:
Item:
Empty: false
Amount: 1
PlayerHead:
Enable: false
Base64:
Enable: false
Base64Value: ''
PlayerWhoHasOpenedTheGUI: false
PlayerName: ''
Material: ''
Name: '&6Toggle UseItem'
Lore:
- '&bYou currently have the UseItem set to: %commandgui_useitem%'
CustomSound:
Enable: false
NoSound: false
Sound: ''
Cost:
Enable: false
Price: 0.0
Command:
Enable: false
BungeeCommand: false
CommandAsConsole: false
Command: []
ServerChange:
Enable: false
Server: ''
OpenGUI:
Enable: false
GUI: ''
Toggle:
Permission:
Enable: false
Permission: ''
UseItem:
Enable: true
Message:
Enable: true
Message:
- '&bYour UseItem was set to: %commandgui_useitem%&b.'
Permission:
Required: false
SetConfig:
Enable: false
File:
Path: ''
Option:
Path: ''
Premat: String
Value:
LeftClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
RightClick:
String: ''
Boolean: false
Integer: 0
Double: 0.0
List: []
PluginReload:
Enable: false
Command: ''

View File

@@ -0,0 +1,20 @@
GUI:
Enable: true
Lines: 1
Name: '&5default &9GUI'
FillItem:
Enable: true
Item: BLACK_STAINED_GLASS_PANE
Command:
Alias: true
Permission:
Required: true
Slots:
SupportDiscord:
Slot: 4
Enable: true
Function: SupportDiscord
UseItem:
Slot: 6
Enable: true
Function: UseItem

121
Config poll/new/config.yml Normal file
View File

@@ -0,0 +1,121 @@
ConfigVersion: 4
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
KeepAtCommandClear: 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:
OnLogin:
Enable: true
Spigot:
OnOnlyFirstLogin: true
Bungee:
OnServerChange: false
Advanced:
UseItem:
GameMode:
Change:
Enable: true
DelayInTicks: 1
Protection:
Enable: false
RemoveItemWhenItIsDisabled: false
Mode: blacklist
List:
- CREATIVE
- Spectator
World:
Change:
Enable: true
DelayInTicks: 1
Protection:
Enable: false
RemoveItemWhenItIsDisabled: false
Mode: blacklist
List:
- World1
- World2
Toggle:
Items:
OnOrYes:
Item:
Base64:
Enable: false
Base64Value: ''
Material: GREEN_WOOL
OffOrNo:
Item:
Base64:
Enable: false
Base64Value: ''
Material: RED_WOOL
Permission:
Commands:
'True': luckperms user [player] permission set [perm] true
'False': luckperms user [player] permission set [perm] false
Placeholder:
'True': '&2true'
'False': '&4false'
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

View File

@@ -0,0 +1,55 @@
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.'
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!'
DisabledInGameMode: '[prefix] &cThe UseItem is disabled in this GameMode!'
DisabledInWorld: '[prefix] &cThe UseItem is disabled in this World!'
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/commandgui admin info&8'''' &eCall the info from &4Command&9GUI
&e.'
Open: '&8''''&b/commandgui [gui]&8'''' &eOpen the GUI: &6[guiname]&e.'
Give: '&8''''&b/commandgui admin give &7<player>&8'''' &eGive a player the GUI item.'
CreateDefaultGUI: '&8''''&b/commandgui admin createdefaultgui&8'''' &eCreate a default
GUI &7([directory])&e.'
Reload: '&8''''&b/commandgui admin 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.'

View File

@@ -0,0 +1,58 @@
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.'
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!'
DisabledInGameMode: '[prefix] &cDas UseItem ist in diesem GameMode deaktiviert!'
DisabledInWorld: '[prefix] &cDas UseItem ist in dieser Welt deaktiviert!'
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/commandgui admin 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/commandgui admin give &7<player>&8'''' &eGebe einem Spieler das
GUI-Item.'
CreateDefaultGUI: '&8''''&b/commandgui admin createdefaultgui&8'''' &eLasse eine
default GUI erstellen &7([directory])&e.'
Reload: '&8''''&b/commandgui admin 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.'

View 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.'
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!'
DisabledInGameMode: '[prefix] &cBrukselementet er deaktivert i denne spillmodusen!!'
DisabledInWorld: '[prefix] &cUseItem er deaktivert i denne verden!'
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/commandgui admin info&8'''' &eKall informasjon fra &4Command&9GUI&e.'
Open: '&8''''&b/commandgui [gui]&8'''' &eÅpne GUIen: &6[guiname]&e.'
Give: '&8''''&b/commandgui admin give &7<player>&8'''' &eGi en spiller GUI gjenstanden.'
CreateDefaultGUI: '&8''''&b/commandgui admin createdefaultgui&8'''' &eLag en normalverdi
GUI &7([directory])&e.'
Reload: '&8''''&b/commandgui admin 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.'