Compare commits

...

55 Commits

Author SHA1 Message Date
JaTiTV 2f114cca41 Update guiDeclaration.yml 2 days ago
JaTiTV d0277deeb8 Update guiDeclaration.yml 2 days ago
JaTiTV a6dff7e243 2.8.4 | Minor code changes 3 days ago
JaTiTV e2e649aef2 Revert "„README.md“ ändern" 3 weeks ago
JaTiTV 7c7cd51cec „README.md“ ändern 3 weeks ago
JaTiTV e7f5b00b31 Bugfix 3 weeks ago
JaTiTV 57ba6e6687 add new defaultconfigs 3 weeks ago
JaTiTV d168a7afec fix 3 weeks ago
JaTiTV 92d3e9a2d8 files with explanations 3 weeks ago
JaTiTV b45895dff8 Update Util.java 3 weeks ago
JaTiTV c43a5fd90c 2.8.2 3 weeks ago
JaTiTV 48c06696ef 2.8.1 3 weeks ago
JaTiTV 16123ec578 2.8.1 3 weeks ago
JaTiTV 7f2b346f7b Merge pull request '2.8.0-Voting' (#12) from 2.8.0-Voting into main 3 weeks ago
JaTiTV c590255d38 Update pom.xml 3 weeks ago
JaTiTV 5d646fce48 2.8.0 | VotePoints for payment, Items for payment and other new features 3 weeks ago
JaTiTV 5b089a57d8 rename folder 3 weeks ago
JaTiTV 87d0f75a4c Merge branch 'main' of https://git.t2code.net/JaTiTV/CommandGUI 4 weeks ago
JaTiTV 6f3da3e3f4 2.7.7 4 weeks ago
JaTiTV 80255a60eb Merge pull request 'mysql-crash' (#11) from mysql-crash into main 4 weeks ago
JaTiTV f6860e9ab5 2.7.6 4 weeks ago
JaTiTV ebbec1f660 2.7.6_DEV 4 weeks ago
JaTiTV 5674b54593 Merge pull request '2.7.5' (#10) from 2.7.5 into main 4 weeks ago
JaTiTV 381afeba89 2.7.5 4 weeks ago
JaTiTV 19822f7024 2.7.4 | MySQL Bugfix 1 month ago
JaTiTV ed810f31d7 Update pom.xml 1 month ago
JaTiTV b0286e597f Merge branch 'main' of https://git.t2code.net/JaTiTV/CommandGUI 1 month ago
JaTiTV ddfea4eba6 2.7.3 1 month ago
JaTiTV ed86e7b143 „README.md“ ändern 1 month ago
JaTiTV 32c1219bb2 2.7.2 1 month ago
JaTiTV 326dfae0e9 2.7.2 2 months ago
JaTiTV a05b941aaf 2.7.1 | Bug fixes 2 months ago
JaTiTV 36de2ff0ca Small bugfix 2 months ago
JaTiTV 777c6876fc Merge pull request '2.7.0' (#8) from 2.7.0 into main 2 months ago
JaTiTV b6347c8fad 2.7.0 2 months ago
JaTiTV f3feddd317 api changes & clean code 2 months ago
JaTiTV 35a9930017 error fix 2 months ago
JaTiTV fc98f931e2 Bugfix 2 months ago
JaTiTV cfd07b01f2 2.7.0_Snapshot-6 | Fix 2 months ago
JaTiTV c5bc880ab1 Add SQLITE & Bugfix 2 months ago
JaTiTV 3bd0662273 fix use and see perm 2 months ago
JaTiTV 7993dca126 refresh perms by reload 2 months ago
JaTiTV 520df8dc97 2.7.0_Snapshot-3 | Perm Update 2 months ago
JaTiTV 8e90aee0ca 2.7.0_Snapshot-2 | small change 2 months ago
JaTiTV 7fda797cae remove config poll 2 months ago
JaTiTV 007d8776b9 update default config to V5 2 months ago
JaTiTV b0ff520847 new Config 2 months ago
JaTiTV f2a666773f 2.7.0 Snapshot 1 2 months ago
JaTiTV dcd524ab3c „Config poll/new/GUIs/default.yml“ ändern 2 months ago
JaTiTV c3d0990853 „Config poll/new/Functions/SupportDiscord.yml“ ändern 2 months ago
JaTiTV 04a7d4952e „Config poll/new/Functions/SupportDiscord.yml“ ändern 2 months ago
JaTiTV 65a01513ce Snapshot 3 2 months ago
JaTiTV 31a4f2d2ad fix 3 months ago
JaTiTV 0c45b650b8 Update pom.xml 3 months ago
JaTiTV c17733fe3f insert 3 months ago
  1. 129
      CommandGUI V2/pom.xml
  2. 40
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BConfig.java
  3. 1
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BListener.java
  4. 40
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BMain.java
  5. 7
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BMetrics.java
  6. 107
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BMySQL.java
  7. 34
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Listener/ConfigChat.java
  8. 245
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Listener/GUI_Listener.java
  9. 155
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Listener/ItemChange.java
  10. 77
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Listener/PluginEvent.java
  11. 269
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Listener/UseItem_Listener/Events.java
  12. 72
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Main.java
  13. 111
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Objekte/Obj_Select.java
  14. 30
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Objekte/Object.java
  15. 158
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Objekte/Slot.java
  16. 151
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/CmdExecuter_Admin.java
  17. 41
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUI.java
  18. 13
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/CmdExecuter_GUIItem.java
  19. 212
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/Commands.java
  20. 120
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/Help.java
  21. 111
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/register/AliasRegister.java
  22. 19
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/cmdManagement/register/RegisterCommand.java
  23. 191
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/config/DefaultGUICreate.java
  24. 86
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/config/config/ConfigCreate.java
  25. 606
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/config/config/SelectConfig.java
  26. 177
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/config/configConverter/ConfigConverterUnderV5.java
  27. 161
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/config/functions/CreateFunctions.java
  28. 73
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/config/gui/CreateGUI.java
  29. 72
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/config/languages/LanguagesCreate.java
  30. 79
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/config/languages/MSG.java
  31. 68
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/config/languages/SelectMessages.java
  32. 77
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/database/MySQL.java
  33. 135
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/database/SQLITE.java
  34. 150
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/database/SelectDatabase.java
  35. 6
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/database/YML.java
  36. 7
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/enums/EcoEnum.java
  37. 6
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/enums/FunctionItemEnum.java
  38. 5
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/enums/FunctionVoteEnum.java
  39. 10
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/enums/SoundEnum.java
  40. 7
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/enums/StorageEnum.java
  41. 361
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/gui/GUIListener.java
  42. 132
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/gui/GuiBuilder.java
  43. 190
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/gui/OpenGUI.java
  44. 2
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/listener/Bungee_Sender_Reciver.java
  45. 23
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/listener/PluginEvent.java
  46. 3
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/listener/ServerChange.java
  47. 212
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/objects/Obj_Select.java
  48. 191
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/objects/functions/Function.java
  49. 32
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/objects/guis/Gui.java
  50. 28
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/objects/slots/Slot.java
  51. 60
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/sound/Sound.java
  52. 93
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/system/Debug.java
  53. 98
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/system/Give_UseItem.java
  54. 165
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/system/Load.java
  55. 11
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/system/Metrics.java
  56. 51
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/system/Papi.java
  57. 77
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/system/Permissions.java
  58. 38
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/system/Placeholder.java
  59. 22
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/system/RegisterPermissions.java
  60. 69
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/system/database/Select_Database.java
  61. 350
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/useItem/Events.java
  62. 18
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/useItem/EventsFrom110.java
  63. 112
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/useItem/ItemChange.java
  64. 143
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/useItem/UseItem.java
  65. 14
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Util.java
  66. 41
      CommandGUI V2/src/main/java/de/jatitv/commandguiv2/api/CGuiAPI.java
  67. 158
      CommandGUI V2/src/main/resources/Functions/functionDeclaration.yml
  68. 51
      CommandGUI V2/src/main/resources/GUIs/guiDeclaration.yml
  69. 1
      CommandGUI V2/src/main/resources/META-INF/MANIFEST.MF
  70. 313
      CommandGUI V2/src/main/resources/configDeclaration.yml
  71. 60
      CommandGUI V2/src/main/resources/plugin.yml
  72. 4
      Config Update V5/new/Functions/SupportDiscord.yml
  73. 0
      Config Update V5/new/Functions/UseItem.yml
  74. 8
      Config Update V5/new/GUIs/default.yml
  75. 0
      Config Update V5/new/config.yml
  76. 0
      Config Update V5/new/languages/english_messages.yml
  77. 0
      Config Update V5/new/languages/german_messages.yml
  78. 0
      Config Update V5/new/languages/norwegian_messages.yml
  79. 0
      Config Update V5/old/GUIs/default.yml
  80. 0
      Config Update V5/old/config.yml
  81. 0
      Config Update V5/old/languages/english_messages.yml
  82. 0
      Config Update V5/old/languages/german_messages.yml
  83. 0
      Config Update V5/old/languages/norwegian_messages.yml
  84. 71
      Configs/config.yml
  85. 54
      Configs/languages/english_messages.yml
  86. 56
      Configs/languages/german_messages.yml
  87. 54
      Configs/languages/norwegian_messages.yml
  88. 67
      Defaultconfig/Functions/SupportDiscord.yml
  89. 78
      Defaultconfig/Functions/UseItem.yml
  90. 158
      Defaultconfig/Functions/functionDeclaration.yml
  91. 28
      Defaultconfig/GUIs/default.yml
  92. 51
      Defaultconfig/GUIs/guiDeclaration.yml
  93. BIN
      Defaultconfig/Storage/data.db
  94. 227
      Defaultconfig/config.yml
  95. 313
      Defaultconfig/configDeclaration.yml
  96. 86
      Defaultconfig/languages/english_messages.yml
  97. 90
      Defaultconfig/languages/german_messages.yml
  98. 84
      Defaultconfig/languages/norwegian_messages.yml
  99. 1
      README.md

129
CommandGUI V2/pom.xml

@ -6,10 +6,9 @@ @@ -6,10 +6,9 @@
<groupId>net.t2code</groupId>
<artifactId>CommandGUI_V2</artifactId>
<version>2.6.2_Snapshot-2</version>
<version>2.8.4</version>
<packaging>jar</packaging>
<name>CommandGUI</name>
<properties>
@ -54,10 +53,7 @@ @@ -54,10 +53,7 @@
</build>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<!-- repo.t2code / T2Code -->
<repository>
<id>Builders-Paradise</id>
<url>https://repo.t2code.net/repository/Builders-Paradise/</url>
@ -66,124 +62,73 @@ @@ -66,124 +62,73 @@
<id>T2Code</id>
<url>https://repo.t2code.net/repository/T2Code/</url>
</repository>
<!-- placeholderAPI -->
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
</repositories>
<dependencies>
<!-- repo.t2code / T2Code -->
<dependency>
<groupId>net.t2code</groupId>
<artifactId>bungee</artifactId>
<version>1615</version>
</dependency>
<dependency>
<groupId>net.t2code</groupId>
<artifactId>PlugmanGUI</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId>
<version>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>
<artifactId>spigot</artifactId>
<version>1.18r1</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_17.r1</groupId>
<artifactId>spigot</artifactId>
<version>1.17r1</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_16.r3</groupId>
<artifactId>spigot</artifactId>
<version>1.16r3</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_16.r2</groupId>
<artifactId>spigot</artifactId>
<version>1.16r2</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_16.r1</groupId>
<artifactId>spigot</artifactId>
<version>1.16r1</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_15.r1</groupId>
<artifactId>spigot</artifactId>
<version>1.15r1</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_14.r1</groupId>
<artifactId>spigot</artifactId>
<version>1.14r1</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_13.r2</groupId>
<artifactId>spigot</artifactId>
<version>1.13r2</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_13.r1</groupId>
<artifactId>spigot</artifactId>
<version>1.13r1</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_12.r1</groupId>
<artifactId>spigot</artifactId>
<version>1.12r1</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_11.r1</groupId>
<artifactId>spigot</artifactId>
<version>1.11r1</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_10.r1</groupId>
<artifactId>spigot</artifactId>
<version>1.10r1</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_9.r2</groupId>
<groupId>net.t2code.minecraft.1_8.r1</groupId>
<artifactId>spigot</artifactId>
<version>1.9r2</version>
<version>1.8r1</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_9.r1</groupId>
<artifactId>spigot</artifactId>
<version>1.9r1</version>
<groupId>net.t2code</groupId>
<artifactId>PlugmanGUI</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_8.r3</groupId>
<artifactId>spigot</artifactId>
<version>1.8r3</version>
<groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId>
<version>12.1</version>
</dependency>
<dependency>
<groupId>net.t2code.minecraft.1_8.r2</groupId>
<artifactId>spigot</artifactId>
<version>1.8r2</version>
<groupId>net.t2code</groupId>
<artifactId>LuckyBox-API</artifactId>
<version>4.2.2</version>
</dependency>
<!-- placeholderAPI -->
<dependency>
<groupId>net.t2code.minecraft.1_8.r1</groupId>
<artifactId>spigot</artifactId>
<version>1.8r1</version>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.1</version>
<scope>provided</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.zaxxer/HikariCP -->
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>3.4.5</version>
<version>4.0.3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.10</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.22</version>
</dependency>
</dependencies>
</project>

40
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BConfig.java

@ -1,40 +0,0 @@ @@ -1,40 +0,0 @@
package de.jatitv.commandguiv2.Bungee;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
import net.md_5.bungee.config.YamlConfiguration;
import java.io.File;
import java.io.IOException;
public class BConfig {
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");
}
}

1
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BListener.java

@ -8,7 +8,6 @@ import net.md_5.bungee.api.event.PluginMessageEvent; @@ -8,7 +8,6 @@ import net.md_5.bungee.api.event.PluginMessageEvent;
import net.md_5.bungee.api.event.PostLoginEvent;
import net.md_5.bungee.api.plugin.Listener;
import net.md_5.bungee.event.EventHandler;
import net.t2code.lib.Bungee.Lib.messages.Bsend;
import java.io.*;
import java.util.logging.Logger;

40
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BMain.java

@ -5,7 +5,6 @@ import net.md_5.bungee.api.ProxyServer; @@ -5,7 +5,6 @@ import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.plugin.Plugin;
import net.t2code.lib.Bungee.Lib.messages.Bsend;
import java.io.IOException;
import java.util.logging.Level;
public final class BMain extends Plugin {
@ -42,31 +41,11 @@ public final class BMain extends Plugin { @@ -42,31 +41,11 @@ public final class BMain extends Plugin {
Bsend.console(prefix + " §2Version: §6" + version);
Bsend.console(prefix + " §2Spigot: §6" + spigot);
Bsend.console(prefix + " §2Discord: §6" + discord);
/* 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` (" +
" `UUID` VARCHAR(191) NOT NULL COLLATE 'utf8mb4_general_ci'," +
" `Name` TINYTEXT NOT NULL COLLATE 'utf8mb4_general_ci'," +
" `Online` TINYTEXT NOT NULL COLLATE 'utf8mb4_general_ci'," +
" UNIQUE INDEX `UUID` (`UUID`)" +
")" +
"COLLATE='utf8mb4_general_ci'" +
"ENGINE=InnoDB" +
";");
}
*/
BMetrics.Bstats();
Bsend.console(prefix + " §2Plugin loaded successfully." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
Bsend.console(prefix + "§4==============================================================================");
@ -90,7 +69,7 @@ public final class BMain extends Plugin { @@ -90,7 +69,7 @@ public final class BMain extends Plugin {
Bsend.console(prefix + "§4==============================================================================");
}
public static Boolean pluginNotFound(String pl, Integer spigotID, double ver) {
public static Boolean pluginNotFound(String pl, Integer spigotID, String 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: " +
@ -99,10 +78,19 @@ public final class BMain extends Plugin { @@ -99,10 +78,19 @@ public final class BMain extends Plugin {
BMain.plugin.onDisable();
return true;
} else {
if (Double.parseDouble(ProxyServer.getInstance().getPluginManager().getPlugin(pl).getDescription().getVersion()) < ver) {
String plVer = ProxyServer.getInstance().getPluginManager().getPlugin(pl).getDescription().getVersion();
if (ver.contains("_")) {
if (!plVer.equals(ver)) {
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
ProxyServer.getInstance().getConsole().sendMessage(Util.getPrefix() + " §e" + pl + " §4is out of date! This plugin requires the version §2" + ver + " §4of §6" + pl + " §4Please use this version! Please download it here or contact us in Discord: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " Or contact us in Discord: http://dc.t2code.net");
return true;
}
return false;
}
String[] split = plVer.split("_");
if (Double.parseDouble(split[0]) < Double.parseDouble(ver)) {
plugin.getLogger().log(Level.SEVERE, "Plugin can not be loaded!");
ProxyServer.getInstance().getConsole().sendMessage(prefix + " §e" + pl + " §4is out of date! This plugin requires at least version §2" + ver + " §4of §6" + pl + " §4Please update it here: §6https://spigotmc.org/resources/" + pl + "." + spigotID + " §4to use this version of " + plugin.getDescription().getName() + ".");
// BMain.plugin.getPluginLoader().disablePlugin(BMain.plugin);
BMain.plugin.onDisable();
return true;
}

7
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BMetrics.java

@ -27,6 +27,8 @@ import java.util.logging.Level; @@ -27,6 +27,8 @@ import java.util.logging.Level;
import java.util.stream.Collectors;
import java.util.zip.GZIPOutputStream;
import javax.net.ssl.HttpsURLConnection;
import de.jatitv.commandguiv2.Util;
import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.config.Configuration;
import net.md_5.bungee.config.ConfigurationProvider;
@ -34,6 +36,11 @@ import net.md_5.bungee.config.YamlConfiguration; @@ -34,6 +36,11 @@ import net.md_5.bungee.config.YamlConfiguration;
public class BMetrics {
public static void Bstats() {
int pluginId = Util.getBstatsID(); // <-- Replace with the id of your plugin!
BMetrics metrics = new BMetrics(BMain.plugin, pluginId);
}
private final Plugin plugin;
private final MetricsBase metricsBase;

107
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Bungee/BMySQL.java

@ -1,107 +0,0 @@ @@ -1,107 +0,0 @@
package de.jatitv.commandguiv2.Bungee;
import net.md_5.bungee.api.plugin.Plugin;
import net.t2code.lib.Bungee.Lib.messages.Bsend;
import java.sql.*;
import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Calendar;
public class BMySQL {
private static Plugin plugin = BMain.plugin;
protected static Boolean Enable = false;
protected static String ip = "localhost";
protected static Integer port = 3306;
protected static String database;
protected static String user = "root";
protected static String password = "";
protected static String url;
protected static Boolean SSL;
public static void main() {
Long long_ = Long.valueOf(System.currentTimeMillis());
Calendar now = Calendar.getInstance();
ZoneId timeZone = now.getTimeZone().toZoneId();
Bsend.debug(plugin, "Server TimeZone is : " + timeZone);
url = "jdbc:mysql://" + ip + ":" + port + "/" + database + "?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=" + timeZone;
// Europe/Berlin
if (SSL) {
url = url + "&useSSL=true";
} else url = url + "&useSSL=false";
Bsend.debug(plugin, url);
try (Connection con = DriverManager.getConnection(url, user, password)) {
Statement stmt = con.createStatement();
stmt.close();
Bsend.console(BMain.prefix + " §2MySQL successfully connected." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
} catch (SQLException ex) {
Bsend.console(BMain.prefix + " §4MySQL not connected." + " §7- §e" + (System.currentTimeMillis() - long_.longValue()) + "ms");
Bsend.error(plugin, ex.getMessage() + " --- " + (System.currentTimeMillis() - long_.longValue()) + "ms");
}
}
public static void query(String query) {
try (Connection con = DriverManager.getConnection(url, user, password)) {
Statement stmt = con.createStatement();
stmt.execute(query);
stmt.close();
} catch (SQLException ex) {
System.err.println(ex.getMessage());
}
}
public static ArrayList<String> selectAll(String query) {
ArrayList<String> Result = new ArrayList<>();
try (Connection con = DriverManager.getConnection(url, user, password)) {
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
int columns = rs.getMetaData().getColumnCount();
while (rs.next()) {
Result.add(rs.getString(1));
}
rs.close();
stmt.close();
} catch (SQLException ex) {
System.err.println(ex.getMessage());
}
return Result;
}
public static String select(String query) {
String Ausgabe = "";
try (Connection con = DriverManager.getConnection(url, user, password)) {
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
int columns = rs.getMetaData().getColumnCount();
while (rs.next()) {
Ausgabe = String.valueOf(rs.getString(1));
}
rs.close();
stmt.close();
} catch (SQLException ex) {
System.err.println(ex.getMessage());
}
return Ausgabe;
}
public static int count(String query) {
Integer count = 0;
try (Connection con = DriverManager.getConnection(url, user, password)) {
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
int columns = rs.getMetaData().getColumnCount();
while (rs.next()) {
count++;
}
rs.close();
stmt.close();
} catch (SQLException ex) {
System.err.println(ex.getMessage());
}
return count;
}
}

34
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Listener/ConfigChat.java

@ -1,34 +0,0 @@ @@ -1,34 +0,0 @@
package de.jatitv.commandguiv2.Spigot.Listener;
import de.jatitv.commandguiv2.Spigot.Objekte.Slot;
import de.jatitv.commandguiv2.Spigot.Main;
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import java.util.HashMap;
public class ConfigChat implements Listener {
public static HashMap<Player, String> EditChat = new HashMap<>();
@EventHandler
public void onChat(AsyncPlayerChatEvent playerChatEvent) {
Player player = playerChatEvent.getPlayer();
if (EditChat.containsKey(player)) {
if (playerChatEvent.getMessage().equals("cancel")) {
//player.sendMessage(DefaultValue.SettingsGUIchatIsCanceled.replace("[setting]", EditChat.get(player)));
} else {
for (Object gui : Main.guiHashMap.values()) {
for (Slot slot : gui.GUI_Slots) {
if (slot.ConfigOptionPath.equals(EditChat.get(player))) {
}
}
}
}
}
}
}

245
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Listener/GUI_Listener.java

@ -1,245 +0,0 @@ @@ -1,245 +0,0 @@
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.config.languages.SelectMessages;
import de.jatitv.commandguiv2.Spigot.Objekte.Object;
import de.jatitv.commandguiv2.Spigot.gui.OpenGUI;
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;
import net.t2code.lib.Spigot.Lib.messages.send;
import net.t2code.lib.Spigot.Lib.replace.Replace;
import net.t2code.lib.Spigot.Lib.vault.Vault;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.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;
import java.io.IOException;
public class GUI_Listener implements Listener {
private static String prefix = Util.getPrefix();
public static String GUICode;
private static Plugin plugin = Main.plugin;
@EventHandler
public void onInventoryClick(InventoryClickEvent e) {
Player player = (Player) e.getWhoClicked();
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 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);
}
}

155
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Listener/ItemChange.java

@ -1,155 +0,0 @@ @@ -1,155 +0,0 @@
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.config.config.SelectConfig;
import de.jatitv.commandguiv2.Spigot.system.database.Select_Database;
import net.t2code.lib.Spigot.Lib.items.ItemVersion;
import net.t2code.lib.Spigot.Lib.messages.send;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
public class ItemChange {
public static void itemChange(Player player, Boolean setCursor) {
Integer slot;
if (SelectConfig.UseItem_InventorySlotEnforce) {
slot = SelectConfig.UseItem_InventorySlot;
} else {
if (Select_Database.selectSlot(player) == null) {
slot = SelectConfig.UseItem_InventorySlot;
} else {
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()) {
new BukkitRunnable() {
@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) {
player.getInventory().setHeldItemSlot(slot - 1);
}
}
}
send.debug(Main.plugin,"GiveOnlyOnFirstJoin: " +player.getName());
return;
}
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 (empty) {
Give_UseItem.onGiveADD(player);
}
}
}
}
}.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;
}
}
}
}
}
}

77
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Listener/PluginEvent.java

@ -1,77 +0,0 @@ @@ -1,77 +0,0 @@
// This claas was created by JaTiTV
package de.jatitv.commandguiv2.Spigot.Listener;
import de.jatitv.commandguiv2.Spigot.Main;
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;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.server.ServerCommandEvent;
import org.bukkit.scheduler.BukkitRunnable;
public class PluginEvent implements Listener {
private static String prefix = Main.prefix;
@EventHandler
public void onJoinEvent(PlayerLoginEvent event) {
Player player = event.getPlayer();
Select_Database.nameCheck(player);
UpdateAPI.join(Main.plugin, prefix, "commandgui.updatemsg", event.getPlayer(), Util.getSpigot(), Util.getDiscord());
}
@EventHandler
public void onClearServer(ServerCommandEvent event) {
if (SelectConfig.UseItem_KeepAtCommandClear) {
if (event.getCommand().contains("clear " + event.getCommand().replace("/", "").replace("clear ", ""))) {
new BukkitRunnable() {
@Override
public void run() {
try {
Player player = Bukkit.getPlayer(event.getCommand().replace("/", "").replace("clear ", ""));
if (player == null) {
return;
}
clearGive(player);
} catch (Exception ex) {
ex.printStackTrace();
return;
}
}
}.runTaskLater(Main.plugin, 1L);
}
}
}
@EventHandler
public void onClearPlayer(PlayerCommandPreprocessEvent event) {
if (SelectConfig.UseItem_KeepAtCommandClear) {
if (event.getMessage().toLowerCase().contains("clear")) {
new BukkitRunnable() {
@Override
public void run() {
clearGive(event.getPlayer());
}
}.runTaskLater(Main.plugin, 1L);
}
if (event.getMessage().toLowerCase().contains("clear " + event.getMessage().toLowerCase().replace("/", "").replace("clear ", ""))) {
new BukkitRunnable() {
@Override
public void run() {
clearGive(Bukkit.getPlayer(event.getMessage().toLowerCase().replace("/", "").replace("clear ", "")));
}
}.runTaskLater(Main.plugin, 1L);
}
}
}
private static void clearGive(Player player) {
ItemChange.itemChange(player, false);
}
}

269
CommandGUI V2/src/main/java/de/jatitv/commandguiv2/Spigot/Listener/UseItem_Listener/Events.java

@ -1,269 +0,0 @@ @@ -1,269 +0,0 @@
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 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.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryMoveItemEvent;
import org.bukkit.event.inventory.InventoryPickupItemEvent;
import org.bukkit.event.player.*;
import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.ArrayList;
import java.util.Iterator;
public class Events implements Listener {
@EventHandler
public void onJoin(PlayerJoinEvent e) {
if (CGuiAPI.JoinDisable) {
send.debug(Main.plugin,"JoinDisable");
return;
}
if (e.getPlayer().hasPermission("commandgui.get.guiitem.at.login")) {
new BukkitRunnable() {
@Override
public void run() {
send.debug(Main.plugin,"itemChange: " + e.getPlayer().getName());
ItemChange.itemChange(e.getPlayer(), true);
}
}.runTaskLater(Main.plugin, 20L * 1);
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onDeathDrop(PlayerDeathEvent e) {
Player player = e.getEntity().getPlayer();
for (int iam = 0; iam < player.getInventory().getSize() - 5; iam++) {
ItemStack itm = player.getInventory().getItem(iam);
if (itm != null) {
if (itm.getType() == Material.valueOf(SelectConfig.UseItem_Material) || itm.getType() == ItemVersion.getHead()) {
if (itm.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
player.getInventory().remove(itm);
player.updateInventory();
break;
}
}
}
}
if (!e.getDrops().isEmpty()) {
Iterator var3 = (new ArrayList(e.getDrops())).iterator();
while (var3.hasNext()) {
ItemStack items = (ItemStack) var3.next();
if (items != null && items.hasItemMeta() && items.getItemMeta().hasDisplayName()
&& items.getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
e.getDrops().remove(items);
}
}
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onRespawn(PlayerRespawnEvent e) {
Player player = e.getPlayer();
if (SelectConfig.UseItem_Enable) {
ItemChange.itemChange(player, false);
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onGameModeChange(PlayerGameModeChangeEvent e) {
Player player = e.getPlayer();
if (!SelectConfig.UseItemGameModeChangeEnable) {
return;
}
new BukkitRunnable() {
@Override
public void run() {
ItemChange.itemChange(player, false);
}
}.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() {