This commit is contained in:
rockyhawk64 2021-10-24 14:49:09 +11:00
parent 156e5ccb83
commit 1cb26d35f3
4 changed files with 12 additions and 3 deletions
resource
src/me/rockyhawk/commandpanels
api
commandtags/tags/standard
openwithitem

View File

@ -1,4 +1,4 @@
version: 3.17.1.4
version: 3.17.1.5
main: me.rockyhawk.commandpanels.CommandPanels
name: CommandPanels
author: RockyHawk

View File

@ -82,6 +82,7 @@ public class Panel{
return plugin.itemCreate.makeCustomItemFromConfig(this,PanelPosition.Top,itemSection, p, true, true, false);
}
//NBT will equal to panelName:slot and the slot will be -1 if item is not stationery
public ItemStack getHotbarItem(Player p){
ItemStack s = plugin.itemCreate.makeItemFromConfig(this,PanelPosition.Top,getHotbarSection(p), p, true, true, false);
int slot = -1;

View File

@ -71,7 +71,12 @@ public class BasicTags implements Listener {
if(e.name.equalsIgnoreCase("sound=")) {
e.commandTagUsed();
try {
e.p.playSound(e.p.getLocation(), Sound.valueOf(e.args[0]), 1F, 1F);
if(e.args.length == 3){
//volume (0.0 to 1.0), pitch (0.5 to 2.0)
e.p.playSound(e.p.getLocation(), Sound.valueOf(e.args[0]), Float.parseFloat(e.args[1]), Float.parseFloat(e.args[2]));
}else{
e.p.playSound(e.p.getLocation(), Sound.valueOf(e.args[0]), 1F, 1F);
}
} catch (Exception s) {
plugin.debug(s, e.p);
plugin.tex.sendMessage(e.p, plugin.config.getString("config.format.error") + " " + "commands: " + e.args[0]);

View File

@ -120,7 +120,10 @@ public class HotbarItemLoader {
for(int i = 0; i <= 35; i++){
try {
if (plugin.nbt.getNBT(p.getInventory().getItem(i), "CommandPanelsHotbar") != null) {
p.getInventory().setItem(i,new ItemStack(Material.AIR));
//do not remove items that are not stationary
if(!plugin.nbt.getNBT(p.getInventory().getItem(i), "CommandPanelsHotbar").endsWith("-1")) {
p.getInventory().setItem(i, new ItemStack(Material.AIR));
}
}
}catch(NullPointerException | IllegalArgumentException ignore){}
}