Closed alvileg closed 3 years ago
I have the same problem.
Hi, what version of SmartInvs are you both using ?
A little test on my side with SmartInvs in 1.3.0 (& spigot 1.6.3) this works perfectly fine both with the old API :
.type(type)
.provider(new InventoryProvider() {
@Override
public void init(Player player, InventoryContents contents) {
contents.set(1, 1, ClickableItem.of(new ItemStack(Material.POTATO),
e -> player.sendMessage(ChatColor.GOLD + "You clicked on a potato.")));
}
@Override
public void update(Player player, InventoryContents contents) {}
})
.closeable(true)
.build().open(player);
And with the new API :
SmartInventory.builder()
.type(type)
.provider(new InventoryProvider() {
@Override
public void init(Player player, InventoryContents contents) {
contents.set(1, 1, ClickableItem.of(new ItemStack(Material.POTATO),
e -> player.sendMessage(ChatColor.GOLD + "You clicked on a potato.")));
}
@Override
public void update(Player player, InventoryContents contents) {}
})
.closeable(true)
.build().open(player);
Make sure that you register yourself correctly if you are using this lib as a dependancy (and not as a plugin) : SmartInvsPlugin.setPlugin(this);
As you use your own InventoryManager, make sure to initialize it with the init()
method.
Hello, I was testing this plugin, and when clicking an item, the event does not fire. I am using Spigot 1.16.3
Here is the code:
` public class TaskPickerGUI implements InventoryProvider {
}
` No errors in console. GUI opens, but when clicking an item, nothing happens