1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Switch to sfItem.isItem()

This commit is contained in:
Senne 2022-01-12 22:23:19 +01:00
parent 7f8ef8be84
commit fc8ffabbcf
No known key found for this signature in database
GPG Key ID: EA68733326BBA376

View File

@ -63,8 +63,7 @@ public class MiddleClickListener implements Listener {
* This is sometimes bypassed by the client itself (not fixable though).
*/
for (int i = 0; i < 9; i++) {
SlimefunItem hotbarItem = SlimefunItem.getByItem(player.getInventory().getItem(i));
if (hotbarItem != null && hotbarItem.getId() == sfItem.getId()) {
if (sfItem.isItem(player.getInventory().getItem(i))) {
player.getInventory().setHeldItemSlot(i);
// Has to be cancelled in order for it to work properly.
e.setCancelled(true);