2.7.0 #8
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>CommandGUI_V2</artifactId>
|
<artifactId>CommandGUI_V2</artifactId>
|
||||||
<version>2.7.0_Snapshot-6</version>
|
<version>2.7.0</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>CommandGUI</name>
|
<name>CommandGUI</name>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>placeholderapi</id>
|
<id>placeholderapi</id>
|
||||||
<url>http://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
@ -85,7 +85,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
<artifactId>T2CodeLib</artifactId>
|
<artifactId>T2CodeLib</artifactId>
|
||||||
<version>11.4</version>
|
<version>11.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.t2code</groupId>
|
<groupId>net.t2code</groupId>
|
||||||
|
@ -36,6 +36,7 @@ public class Events implements Listener {
|
|||||||
|
|
||||||
public static HashMap<Player, Boolean> useItemHashMap = new HashMap<>();
|
public static HashMap<Player, Boolean> useItemHashMap = new HashMap<>();
|
||||||
public static HashMap<Player, Integer> useItemSlotHashMap = new HashMap<>();
|
public static HashMap<Player, Integer> useItemSlotHashMap = new HashMap<>();
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onJoin(PlayerJoinEvent e) {
|
public void onJoin(PlayerJoinEvent e) {
|
||||||
if (SelectDatabase.selectItemStatus(e.getPlayer())) {
|
if (SelectDatabase.selectItemStatus(e.getPlayer())) {
|
||||||
@ -159,14 +160,17 @@ public class Events implements Listener {
|
|||||||
private static void openGUI(PlayerInteractEvent e, Player player) {
|
private static void openGUI(PlayerInteractEvent e, Player player) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
|
||||||
if (player.isSneaking()) {
|
if (SelectConfig.disableInfoBySneak && player.isSneaking()) {
|
||||||
Commands.info(player);
|
Commands.info(player);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!legacy()) {
|
if (!legacy()) {
|
||||||
if (!topInventoryIsEmpty(player)) return;
|
if (!topInventoryIsEmpty(player)) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UseItem.protection(player, true)) return;
|
if (UseItem.protection(player, true)) return;
|
||||||
|
|
||||||
if (SelectConfig.UseItemGameModeProtection) {
|
if (SelectConfig.UseItemGameModeProtection) {
|
||||||
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) {
|
if (SelectConfig.UseItemGameModeMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemGameModeList.contains(player.getGameMode().toString())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
@ -179,6 +183,7 @@ public class Events implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SelectConfig.UseItemWorldProtection) {
|
if (SelectConfig.UseItemWorldProtection) {
|
||||||
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) {
|
if (SelectConfig.UseItemWorldMode.equalsIgnoreCase("blacklist") && SelectConfig.UseItemWorldList.contains(player.getWorld().getName())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
@ -191,6 +196,7 @@ public class Events implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SelectConfig.UseItem_Permission || player.hasPermission("commandgui.useitem")) {
|
if (!SelectConfig.UseItem_Permission || player.hasPermission("commandgui.useitem")) {
|
||||||
OpenGUI.openGUI(player, SelectConfig.UseItem_OpenGUI, true);
|
OpenGUI.openGUI(player, SelectConfig.UseItem_OpenGUI, true);
|
||||||
} else {
|
} else {
|
||||||
@ -213,6 +219,7 @@ public class Events implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onItemMove(InventoryDragEvent e) {
|
public void onItemMove(InventoryDragEvent e) {
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||||
|
|
||||||
if (e.getWhoClicked() instanceof Player) {
|
if (e.getWhoClicked() instanceof Player) {
|
||||||
Player p = (Player) e.getWhoClicked();
|
Player p = (Player) e.getWhoClicked();
|
||||||
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
|
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
|
||||||
@ -234,7 +241,6 @@ public class Events implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onItemMove(InventoryClickEvent e) {
|
public void onItemMove(InventoryClickEvent e) {
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||||
Player player = (Player) e.getWhoClicked();
|
|
||||||
|
|
||||||
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
|
if (e.getCursor() != null && e.getCursor().hasItemMeta() && e.getCursor().getItemMeta().hasDisplayName()
|
||||||
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getCursor().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||||
@ -244,13 +250,13 @@ public class Events implements Listener {
|
|||||||
&& e.getCurrentItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getCurrentItem().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||||
|
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onItemMove(InventoryPickupItemEvent e) {
|
public void onItemMove(InventoryPickupItemEvent e) {
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||||
|
|
||||||
if (e.getItem() != null && e.getItem().getItemStack() != null) {
|
if (e.getItem() != null && e.getItem().getItemStack() != null) {
|
||||||
ItemStack item = e.getItem().getItemStack();
|
ItemStack item = e.getItem().getItemStack();
|
||||||
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
||||||
@ -263,6 +269,7 @@ public class Events implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onPlace(BlockPlaceEvent e) {
|
public void onPlace(BlockPlaceEvent e) {
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||||
|
|
||||||
if (e.getItemInHand() != null && e.getItemInHand().hasItemMeta() && e.getItemInHand().getItemMeta().hasDisplayName()
|
if (e.getItemInHand() != null && e.getItemInHand().hasItemMeta() && e.getItemInHand().getItemMeta().hasDisplayName()
|
||||||
&& e.getItemInHand().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
&& e.getItemInHand().getItemMeta().getDisplayName().equals(SelectConfig.UseItem_Name)) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
@ -272,6 +279,7 @@ public class Events implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onDrop(PlayerDropItemEvent e) {
|
public void onDrop(PlayerDropItemEvent e) {
|
||||||
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
if (!SelectConfig.UseItem_BlockMoveAndDrop || !SelectConfig.UseItem_Enable) return;
|
||||||
|
|
||||||
if (e.getItemDrop() != null && e.getItemDrop().getItemStack() != null) {
|
if (e.getItemDrop() != null && e.getItemDrop().getItemStack() != null) {
|
||||||
ItemStack item = e.getItemDrop().getItemStack();
|
ItemStack item = e.getItemDrop().getItemStack();
|
||||||
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
if (item.hasItemMeta() && item.getItemMeta().hasDisplayName()
|
||||||
|
@ -26,8 +26,6 @@ public class ConfigCreate {
|
|||||||
|
|
||||||
if (!config.exists()) Config.set("ConfigVersion", Util.getConfigVersion(), yamlConfiguration);
|
if (!config.exists()) Config.set("ConfigVersion", Util.getConfigVersion(), yamlConfiguration);
|
||||||
|
|
||||||
|
|
||||||
Config.set("Plugin.UpdateCheckOnJoin", true, yamlConfiguration);
|
|
||||||
Config.set("Plugin.Debug", false, yamlConfiguration);
|
Config.set("Plugin.Debug", false, yamlConfiguration);
|
||||||
Config.set("Plugin.HelpAlias", true, yamlConfiguration);
|
Config.set("Plugin.HelpAlias", true, yamlConfiguration);
|
||||||
Config.set("Plugin.language", "english", yamlConfiguration);
|
Config.set("Plugin.language", "english", yamlConfiguration);
|
||||||
@ -102,7 +100,6 @@ public class ConfigCreate {
|
|||||||
Config.set("Advanced.UseItem.World.Protection.Mode", "blacklist", yamlConfiguration);
|
Config.set("Advanced.UseItem.World.Protection.Mode", "blacklist", yamlConfiguration);
|
||||||
Config.set("Advanced.UseItem.World.Protection.List", Arrays.asList("World1", "World2"), yamlConfiguration);
|
Config.set("Advanced.UseItem.World.Protection.List", Arrays.asList("World1", "World2"), yamlConfiguration);
|
||||||
|
|
||||||
|
|
||||||
Config.set("Toggle.Items.OnOrYes.Item.Base64.Enable", false, yamlConfiguration);
|
Config.set("Toggle.Items.OnOrYes.Item.Base64.Enable", false, yamlConfiguration);
|
||||||
Config.set("Toggle.Items.OnOrYes.Item.Base64.Base64Value", "", yamlConfiguration);
|
Config.set("Toggle.Items.OnOrYes.Item.Base64.Base64Value", "", yamlConfiguration);
|
||||||
Config.set("Toggle.Items.OnOrYes.Item.Material", ItemVersion.getGreenWool().getType().toString(), yamlConfiguration);
|
Config.set("Toggle.Items.OnOrYes.Item.Material", ItemVersion.getGreenWool().getType().toString(), yamlConfiguration);
|
||||||
|
@ -22,9 +22,6 @@ public class SelectConfig {
|
|||||||
|
|
||||||
private static final File config = new File(Main.getPath(), "config.yml");
|
private static final File config = new File(Main.getPath(), "config.yml");
|
||||||
private static final YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
private static final YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
|
||||||
|
|
||||||
public static Boolean DisableUpdateChecker;
|
|
||||||
public static Boolean UpdateCheckOnJoin;
|
|
||||||
public static Boolean Debug;
|
public static Boolean Debug;
|
||||||
public static Boolean HelpAlias;
|
public static Boolean HelpAlias;
|
||||||
public static String language;
|
public static String language;
|
||||||
@ -64,6 +61,8 @@ public class SelectConfig {
|
|||||||
public static String UseItemWorldMode;
|
public static String UseItemWorldMode;
|
||||||
public static List<String> UseItemWorldList;
|
public static List<String> UseItemWorldList;
|
||||||
|
|
||||||
|
public static Boolean disableInfoBySneak;
|
||||||
|
|
||||||
public static Boolean UseItem_InventorySlot_FreeSlot;
|
public static Boolean UseItem_InventorySlot_FreeSlot;
|
||||||
public static Integer UseItem_InventorySlot;
|
public static Integer UseItem_InventorySlot;
|
||||||
public static Boolean UseItem_InventorySlotEnforce;
|
public static Boolean UseItem_InventorySlotEnforce;
|
||||||
@ -129,10 +128,6 @@ public class SelectConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (yamlConfiguration.get("Plugin.DisableUpdateChecker") == null) {
|
|
||||||
DisableUpdateChecker = false;
|
|
||||||
} else DisableUpdateChecker = yamlConfiguration.getBoolean("Plugin.DisableUpdateChecker");
|
|
||||||
UpdateCheckOnJoin = yamlConfiguration.getBoolean("Plugin.UpdateCheckOnJoin");
|
|
||||||
Debug = yamlConfiguration.getBoolean("Plugin.Debug");
|
Debug = yamlConfiguration.getBoolean("Plugin.Debug");
|
||||||
HelpAlias = yamlConfiguration.getBoolean("Plugin.HelpAlias");
|
HelpAlias = yamlConfiguration.getBoolean("Plugin.HelpAlias");
|
||||||
language = yamlConfiguration.getString("Plugin.language");
|
language = yamlConfiguration.getString("Plugin.language");
|
||||||
@ -194,6 +189,9 @@ public class SelectConfig {
|
|||||||
UseItemWorldMode = yamlConfiguration.getString("Advanced.UseItem.World.Protection.Mode");
|
UseItemWorldMode = yamlConfiguration.getString("Advanced.UseItem.World.Protection.Mode");
|
||||||
UseItemWorldList = yamlConfiguration.getStringList("Advanced.UseItem.World.Protection.List");
|
UseItemWorldList = yamlConfiguration.getStringList("Advanced.UseItem.World.Protection.List");
|
||||||
|
|
||||||
|
if (yamlConfiguration.get("Advanced.UseItem.DisableInfoBySneak") != null){
|
||||||
|
disableInfoBySneak = yamlConfiguration.getBoolean("Advanced.UseItem.DisableInfoBySneak");
|
||||||
|
}
|
||||||
|
|
||||||
toggleItemOnOrYesBase64 = yamlConfiguration.getBoolean("Toggle.Items.OnOrYes.Item.Base64.Enable");
|
toggleItemOnOrYesBase64 = yamlConfiguration.getBoolean("Toggle.Items.OnOrYes.Item.Base64.Enable");
|
||||||
toggleItemOnOrYesBase64Value = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Base64.Base64Value");
|
toggleItemOnOrYesBase64Value = yamlConfiguration.getString("Toggle.Items.OnOrYes.Item.Base64.Base64Value");
|
||||||
|
@ -36,7 +36,6 @@ public class Metrics {
|
|||||||
public static void Bstats() {
|
public static void Bstats() {
|
||||||
int pluginId = Util.getBstatsID(); // <-- Replace with the id of your plugin!
|
int pluginId = Util.getBstatsID(); // <-- Replace with the id of your plugin!
|
||||||
Metrics metrics = new Metrics(Main.plugin, pluginId);
|
Metrics metrics = new Metrics(Main.plugin, pluginId);
|
||||||
metrics.addCustomChart(new Metrics.SimplePie("updatecheckonjoin", () -> String.valueOf(SelectConfig.UpdateCheckOnJoin)));
|
|
||||||
metrics.addCustomChart(new DrilldownPie("storage_type_mysql", () -> {
|
metrics.addCustomChart(new DrilldownPie("storage_type_mysql", () -> {
|
||||||
Map<String, Map<String, Integer>> map = new HashMap<>();
|
Map<String, Map<String, Integer>> map = new HashMap<>();
|
||||||
String storage = SelectDatabase.getStorage().toString();
|
String storage = SelectDatabase.getStorage().toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user