When using setItem(Material) on item frame using the spigot API, when the item is set the sound is triggered as if a player actually placed the item in the item frame. For what I am doing it would be nice if said item frame was silent.
private stockId = 0; private List<Material> stock = new ArrayList(Material.STONE, Material.COBBLESTONE, Material.GRAVEL); public void rotateStock() { if(!this.stock.isEmpty()) { if(this.stockId >= this.stock.size()) this.stockId = 0; this.linkedFrame.setItem(new ItemStack(this.stock.get(this.stockId),1)); this.stockId++; } }
on each call of rotateStock() the sound for placing an item in the item frame is played, if this were on say a timer and stock was rotated once a second it would be undesirable.
Steps to reproduce:
1) Create plugin
2) create array or array list of a few materials
3) create an item frame in the world
4) link the item frame in the world to your code
5) have a way to invoke rotateStock() or similar code that sets the item manually.
6) run plugin
7) have sound on
8) be near item frame
9) trigger the code to set the item
10) listen
11) repeat 10-20x and experience the sound irritation.