forked from Upstream/CommandPanels
3.17.1.5
This commit is contained in:
parent
156e5ccb83
commit
1cb26d35f3
@ -1,4 +1,4 @@
|
|||||||
version: 3.17.1.4
|
version: 3.17.1.5
|
||||||
main: me.rockyhawk.commandpanels.CommandPanels
|
main: me.rockyhawk.commandpanels.CommandPanels
|
||||||
name: CommandPanels
|
name: CommandPanels
|
||||||
author: RockyHawk
|
author: RockyHawk
|
||||||
|
@ -82,6 +82,7 @@ public class Panel{
|
|||||||
return plugin.itemCreate.makeCustomItemFromConfig(this,PanelPosition.Top,itemSection, p, true, true, false);
|
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){
|
public ItemStack getHotbarItem(Player p){
|
||||||
ItemStack s = plugin.itemCreate.makeItemFromConfig(this,PanelPosition.Top,getHotbarSection(p), p, true, true, false);
|
ItemStack s = plugin.itemCreate.makeItemFromConfig(this,PanelPosition.Top,getHotbarSection(p), p, true, true, false);
|
||||||
int slot = -1;
|
int slot = -1;
|
||||||
|
@ -71,7 +71,12 @@ public class BasicTags implements Listener {
|
|||||||
if(e.name.equalsIgnoreCase("sound=")) {
|
if(e.name.equalsIgnoreCase("sound=")) {
|
||||||
e.commandTagUsed();
|
e.commandTagUsed();
|
||||||
try {
|
try {
|
||||||
|
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);
|
e.p.playSound(e.p.getLocation(), Sound.valueOf(e.args[0]), 1F, 1F);
|
||||||
|
}
|
||||||
} catch (Exception s) {
|
} catch (Exception s) {
|
||||||
plugin.debug(s, e.p);
|
plugin.debug(s, e.p);
|
||||||
plugin.tex.sendMessage(e.p, plugin.config.getString("config.format.error") + " " + "commands: " + e.args[0]);
|
plugin.tex.sendMessage(e.p, plugin.config.getString("config.format.error") + " " + "commands: " + e.args[0]);
|
||||||
|
@ -120,7 +120,10 @@ public class HotbarItemLoader {
|
|||||||
for(int i = 0; i <= 35; i++){
|
for(int i = 0; i <= 35; i++){
|
||||||
try {
|
try {
|
||||||
if (plugin.nbt.getNBT(p.getInventory().getItem(i), "CommandPanelsHotbar") != null) {
|
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){}
|
}catch(NullPointerException | IllegalArgumentException ignore){}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user