forked from Upstream/CommandPanels
3.16.2.3
This commit is contained in:
parent
c3274d7193
commit
6aa3593a3f
@ -1,4 +1,4 @@
|
||||
version: 3.16.2.2
|
||||
version: 3.16.2.3
|
||||
main: me.rockyhawk.commandpanels.CommandPanels
|
||||
name: CommandPanels
|
||||
author: RockyHawk
|
||||
|
@ -271,9 +271,7 @@ public class CommandPanels extends JavaPlugin{
|
||||
//save files
|
||||
panelData.saveDataFile();
|
||||
inventorySaver.saveInventoryFile();
|
||||
if (Objects.requireNonNull(this.config.getString("updater.auto-update")).equalsIgnoreCase("true")) {
|
||||
updater.autoUpdatePlugin(this.getFile().getName());
|
||||
}
|
||||
updater.autoUpdatePlugin(this.getFile().getName());
|
||||
Bukkit.getLogger().info("RockyHawk's CommandPanels Plugin Disabled, aww man.");
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import me.rockyhawk.commandpanels.CommandPanels;
|
||||
import me.rockyhawk.commandpanels.classresources.placeholders.PanelPlaceholders;
|
||||
import me.rockyhawk.commandpanels.openpanelsmanager.PanelOpenType;
|
||||
import me.rockyhawk.commandpanels.openpanelsmanager.PanelPosition;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
|
@ -58,7 +58,7 @@ public class Commandpanel implements CommandExecutor {
|
||||
return true;
|
||||
}else if(args.length == 3){
|
||||
if (args[1].equals("item")) {
|
||||
plugin.openVoids.giveHotbarItem(sender,plugin.getServer().getPlayer(args[2]),panel,true);
|
||||
plugin.openVoids.giveHotbarItem(sender,plugin.getServer().getPlayer(args[2]),panel.copy(),true);
|
||||
}else{
|
||||
sender.sendMessage(plugin.tex.colour(plugin.tag + ChatColor.RED + "Usage: /cp <panel> item [player]"));
|
||||
}
|
||||
@ -78,7 +78,7 @@ public class Commandpanel implements CommandExecutor {
|
||||
return true;
|
||||
}else if(args.length == 2){
|
||||
if (args[1].equals("item")) {
|
||||
plugin.openVoids.giveHotbarItem(sender, p, panel, false);
|
||||
plugin.openVoids.giveHotbarItem(sender, p, panel.copy(), false);
|
||||
}else{
|
||||
if(!disableCommand) {
|
||||
plugin.openVoids.openCommandPanel(sender, plugin.getServer().getPlayer(args[1]), panel.copy(),PanelPosition.Top, true);
|
||||
@ -86,7 +86,7 @@ public class Commandpanel implements CommandExecutor {
|
||||
}
|
||||
return true;
|
||||
}else if(args.length == 3){
|
||||
plugin.openVoids.giveHotbarItem(sender, plugin.getServer().getPlayer(args[2]), panel,true);
|
||||
plugin.openVoids.giveHotbarItem(sender, plugin.getServer().getPlayer(args[2]), panel.copy(),true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class Commandpanelcustom implements Listener {
|
||||
for(String cmd : panelCommands){
|
||||
if(cmd.equalsIgnoreCase(e.getMessage().replace("/", ""))){
|
||||
e.setCancelled(true);
|
||||
panel.open(e.getPlayer(), PanelPosition.Top);
|
||||
panel.copy().open(e.getPlayer(), PanelPosition.Top);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,6 @@ public class HotbarPlayerManager {
|
||||
}
|
||||
|
||||
public Panel getPanel(int slot){
|
||||
return list.get(slot);
|
||||
return list.get(slot).copy();
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ public class SwapItemEvent implements Listener {
|
||||
this.plugin = pl;
|
||||
}
|
||||
@EventHandler
|
||||
public void onPlayerSwapHandItemsEvent(PlayerSwapHandItemsEvent e){
|
||||
public void onPlayerSwapHandItemsEvent(PlayerSwapHandItemsEvent e){
|
||||
if(!plugin.openWithItem){
|
||||
//if none of the panels have open-with-item
|
||||
return;
|
||||
|
@ -119,6 +119,10 @@ public class Updater implements Listener {
|
||||
//no need to update or running custom version
|
||||
return;
|
||||
}
|
||||
if (Objects.requireNonNull(plugin.config.getString("updater.auto-update")).equalsIgnoreCase("true")) {
|
||||
//don't update the plugin automatically if it is disabled
|
||||
return;
|
||||
}
|
||||
if(Objects.equals(plugin.config.getString("updater.minor-updates-only"), "true")){
|
||||
//only update versions that will not break
|
||||
if(thisVersion.split("\\.")[1].equals(latestVersion.split("\\.")[1]) && thisVersion.split("\\.")[0].equals(latestVersion.split("\\.")[0])){
|
||||
|
Loading…
Reference in New Issue
Block a user