forked from Upstream/CommandPanels
v3.14.4.6 #2
This commit is contained in:
parent
2fb64f9eb4
commit
aabdd8a839
9
.idea/libraries/ChestSort.xml
Normal file
9
.idea/libraries/ChestSort.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="ChestSort">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$PROJECT_DIR$/../../Tools/Build Tools/Jar Libraries/ChestSort.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
@ -18,5 +18,6 @@
|
|||||||
<orderEntry type="library" name="spigot-1.16.4" level="project" />
|
<orderEntry type="library" name="spigot-1.16.4" level="project" />
|
||||||
<orderEntry type="library" name="spigot-1.13.2" level="project" />
|
<orderEntry type="library" name="spigot-1.13.2" level="project" />
|
||||||
<orderEntry type="library" name="CustomItemsAPI_PLACEHOLDER" level="project" />
|
<orderEntry type="library" name="CustomItemsAPI_PLACEHOLDER" level="project" />
|
||||||
|
<orderEntry type="library" name="ChestSort" level="project" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
@ -4,7 +4,7 @@ name: CommandPanels
|
|||||||
author: RockyHawk
|
author: RockyHawk
|
||||||
api-version: '1.13'
|
api-version: '1.13'
|
||||||
description: Fully Custom GUIs. Make your Server Professional.
|
description: Fully Custom GUIs. Make your Server Professional.
|
||||||
softdepend: [PlaceholderAPI, Vault, HeadDatabase, TokenManager, VotingPlugin, MMOItems, CustomItems]
|
softdepend: [PlaceholderAPI, Vault, HeadDatabase, TokenManager, VotingPlugin, MMOItems, CustomItems, ChestSort]
|
||||||
commands:
|
commands:
|
||||||
commandpanel:
|
commandpanel:
|
||||||
description: Open a command panel.
|
description: Open a command panel.
|
||||||
|
@ -31,6 +31,7 @@ import me.rockyhawk.commandpanels.openpanelsmanager.OpenPanelsLoader;
|
|||||||
import me.rockyhawk.commandpanels.openpanelsmanager.UtilsPanelsLoader;
|
import me.rockyhawk.commandpanels.openpanelsmanager.UtilsPanelsLoader;
|
||||||
import me.rockyhawk.commandpanels.openwithitem.HotbarItemLoader;
|
import me.rockyhawk.commandpanels.openwithitem.HotbarItemLoader;
|
||||||
import me.rockyhawk.commandpanels.openwithitem.SwapItemEvent;
|
import me.rockyhawk.commandpanels.openwithitem.SwapItemEvent;
|
||||||
|
import me.rockyhawk.commandpanels.openwithitem.UtilsChestSortEvent;
|
||||||
import me.rockyhawk.commandpanels.openwithitem.UtilsOpenWithItem;
|
import me.rockyhawk.commandpanels.openwithitem.UtilsOpenWithItem;
|
||||||
import me.rockyhawk.commandpanels.panelblocks.BlocksTabComplete;
|
import me.rockyhawk.commandpanels.panelblocks.BlocksTabComplete;
|
||||||
import me.rockyhawk.commandpanels.panelblocks.Commandpanelblocks;
|
import me.rockyhawk.commandpanels.panelblocks.Commandpanelblocks;
|
||||||
@ -84,7 +85,6 @@ public class CommandPanels extends JavaPlugin {
|
|||||||
|
|
||||||
public File panelsf;
|
public File panelsf;
|
||||||
public YamlConfiguration blockConfig; //where panel block locations are stored
|
public YamlConfiguration blockConfig; //where panel block locations are stored
|
||||||
public YamlConfiguration dataConfig; //where arbitrary data is stored for players
|
|
||||||
|
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
Bukkit.getLogger().info("[CommandPanels] RockyHawk's CommandPanels v" + this.getDescription().getVersion() + " Plugin Loading...");
|
Bukkit.getLogger().info("[CommandPanels] RockyHawk's CommandPanels v" + this.getDescription().getVersion() + " Plugin Loading...");
|
||||||
@ -170,6 +170,11 @@ public class CommandPanels extends JavaPlugin {
|
|||||||
this.getServer().getPluginManager().registerEvents(new SwapItemEvent(this), this);
|
this.getServer().getPluginManager().registerEvents(new SwapItemEvent(this), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if plugin ChestSort is enabled
|
||||||
|
if(getServer().getPluginManager().isPluginEnabled("ChestSort")){
|
||||||
|
this.getServer().getPluginManager().registerEvents(new UtilsChestSortEvent(this), this);
|
||||||
|
}
|
||||||
|
|
||||||
//save the example.yml file and the template.yml file
|
//save the example.yml file and the template.yml file
|
||||||
if (!this.panelsf.exists() || Objects.requireNonNull(this.panelsf.list()).length == 0) {
|
if (!this.panelsf.exists() || Objects.requireNonNull(this.panelsf.list()).length == 0) {
|
||||||
try {
|
try {
|
||||||
|
@ -7,6 +7,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
|
@ -6,8 +6,6 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||||
import org.bukkit.event.inventory.InventoryOpenEvent;
|
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
@ -32,6 +32,14 @@ public class HotbarItemLoader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ArrayList<Integer> getStationaryItemSlots(){
|
||||||
|
ArrayList<Integer> tempItems = new ArrayList<>();
|
||||||
|
for(int[] tempItem : stationaryItems){
|
||||||
|
tempItems.add(tempItem[0]);
|
||||||
|
}
|
||||||
|
return tempItems;
|
||||||
|
}
|
||||||
|
|
||||||
//return true if found
|
//return true if found
|
||||||
public boolean stationaryExecute(int slot, Player p, boolean openPanel){
|
public boolean stationaryExecute(int slot, Player p, boolean openPanel){
|
||||||
for(int[] temp : stationaryItems){
|
for(int[] temp : stationaryItems){
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
package me.rockyhawk.commandpanels.openwithitem;
|
||||||
|
|
||||||
|
import de.jeff_media.ChestSortAPI.ChestSortEvent;
|
||||||
|
import me.rockyhawk.commandpanels.CommandPanels;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.inventory.InventoryType;
|
||||||
|
|
||||||
|
public class UtilsChestSortEvent implements Listener {
|
||||||
|
CommandPanels plugin;
|
||||||
|
public UtilsChestSortEvent(CommandPanels pl) {
|
||||||
|
this.plugin = pl;
|
||||||
|
}
|
||||||
|
@EventHandler
|
||||||
|
public void onChestSortEvent(ChestSortEvent e){
|
||||||
|
if(!plugin.openWithItem){
|
||||||
|
//if none of the panels have open-with-item
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//If the ChestSort plugin triggers an event
|
||||||
|
plugin.getServer().getConsoleSender().sendMessage(e.getInventory().getType().toString());
|
||||||
|
if(e.getInventory().getType() == InventoryType.PLAYER){
|
||||||
|
for(int slot : plugin.hotbar.getStationaryItemSlots()){
|
||||||
|
e.setUnmovable(slot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user