mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-23 04:47:34 +01:00
1.12 "compatability update"
Now only loads the CustomBlockListener if running 1.13+ Block editing menu is now disabled completely on 1.12 Added a small lore indicator to the Block option in MI browse
This commit is contained in:
parent
66a27dcb10
commit
ad3736a1a6
@ -166,14 +166,15 @@ public class MMOItems extends JavaPlugin {
|
||||
Bukkit.getPluginManager().registerEvents(new ItemUse(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new PlayerListener(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new MitigationListener(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new CustomBlockListener(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new CustomSoundListener(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new CustomDurability(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new DisableInteractions(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new GuiListener(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new ElementListener(), this);
|
||||
if (version.isStrictlyHigher(1, 12))
|
||||
if (version.isStrictlyHigher(1, 12)) {
|
||||
Bukkit.getPluginManager().registerEvents(new CustomBlockListener(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new Listener_v1_13(), this);
|
||||
}
|
||||
|
||||
/*
|
||||
* this class implements the Listener, if the option
|
||||
|
@ -91,7 +91,9 @@ public class MMOItemsCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
if (args[1].equalsIgnoreCase("blocks")) {
|
||||
new BlockBrowser((Player) sender).open();
|
||||
if (MMOItems.plugin.getVersion().isStrictlyHigher(1, 12))
|
||||
new BlockBrowser((Player) sender).open();
|
||||
else sender.sendMessage(ChatColor.RED + "Blocks are only for 1.13+.");
|
||||
return true;
|
||||
}
|
||||
if (!Type.isValid(args[1])) {
|
||||
|
@ -93,6 +93,15 @@ public class ItemBrowser extends PluginInventory {
|
||||
ItemStack switchBrowse = new ItemStack(Material.STONE);
|
||||
ItemMeta switchMeta = switchBrowse.getItemMeta();
|
||||
switchMeta.setDisplayName(ChatColor.GREEN + "Switch to Block Explorer");
|
||||
|
||||
if(!MMOItems.plugin.getVersion().isStrictlyHigher(1, 12)) {
|
||||
List<String> lore = new ArrayList<String>();
|
||||
lore.add("");
|
||||
lore.add("&cThis feature is disabled.");
|
||||
lore.add("&cUpdating to 1.13+ is recommended.");
|
||||
switchMeta.setLore(lore);
|
||||
}
|
||||
|
||||
switchBrowse.setItemMeta(switchMeta);
|
||||
|
||||
while (n < slots.length)
|
||||
@ -220,7 +229,9 @@ public class ItemBrowser extends PluginInventory {
|
||||
|
||||
|
||||
if (item.getItemMeta().getDisplayName().equals(ChatColor.GREEN + "Switch to Block Explorer")) {
|
||||
new BlockBrowser(player).open();
|
||||
if (MMOItems.plugin.getVersion().isStrictlyHigher(1, 12))
|
||||
new BlockBrowser(player).open();
|
||||
else player.sendMessage(ChatColor.RED + "Blocks are only for 1.13+.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user