|
45 | 45 | import net.md_5.bungee.api.chat.BaseComponent;
|
46 | 46 | import net.md_5.bungee.api.chat.ComponentBuilder;
|
47 | 47 | import net.md_5.bungee.api.chat.HoverEvent;
|
48 |
| -import org.apache.logging.log4j.util.TriConsumer; |
49 | 48 | import org.bukkit.Chunk;
|
50 | 49 | import org.bukkit.Location;
|
51 | 50 | import org.bukkit.Material;
|
|
55 | 54 | import org.bukkit.entity.Player;
|
56 | 55 | import org.bukkit.event.Event;
|
57 | 56 | import org.bukkit.event.Listener;
|
58 |
| -import org.bukkit.event.inventory.ClickType; |
| 57 | +import org.bukkit.event.inventory.InventoryClickEvent; |
59 | 58 | import org.bukkit.event.player.PlayerInteractEvent;
|
60 | 59 | import org.bukkit.inventory.Inventory;
|
61 | 60 | import org.bukkit.inventory.ItemStack;
|
@@ -513,109 +512,62 @@ public static GuiItem createGuiItem(ItemStack itemStack, Consumer<OnlineUser> co
|
513 | 512 |
|
514 | 513 | /**
|
515 | 514 | * Creates new gui-item, based on a specific itemstack with a specific callback.
|
516 |
| - * Gui-items can be added to inventory-guis (built by gui-builder). If a player clicks the gui-item, the callback is called with the player-object. |
517 |
| - * |
518 |
| - * @param itemBuilder item which should be displayed in the inventory |
519 |
| - * @param consumer consumer which gets called if a player clicks the item |
520 |
| - * @return gui-item-object to add to the gui-builder |
521 |
| - */ |
522 |
| - public static GuiItem createGuiItem(ItemBuilder itemBuilder, Consumer<OnlineUser> consumer) { |
523 |
| - return server.createGuiItem(itemBuilder.build(), consumer); |
524 |
| - } |
525 |
| - |
526 |
| - /** |
527 |
| - * Creates new gui-item, based on a specific itemstack with a specific callback. |
528 |
| - * Gui-items can be added to inventory-guis (built by gui-builder). If a player clicks the gui-item, the callback is called with the player-object. |
529 |
| - * |
530 |
| - * @param item item which should be displayed in the inventory |
531 |
| - * @param consumer consumer which gets called if a player clicks the item |
532 |
| - * @return gui-item-object to add to the gui-builder |
533 |
| - */ |
534 |
| - public static GuiItem createGuiItem(InterfaceItem item, Consumer<OnlineUser> consumer) { |
535 |
| - return server.createGuiItem(item.toItemStack(), consumer); |
536 |
| - } |
537 |
| - |
538 |
| - /** |
539 |
| - * Creates new gui-item, based on a specific itemstack with a specific callback. |
540 |
| - * Gui-items can be added to inventory-guis (built by gui-builder). If a player clicks the gui-item, the callback is called with the player-object. |
541 |
| - * |
542 |
| - * @param itemStack item which should be displayed in the inventory |
543 |
| - * @param consumer consumer which gets called if a player clicks the item |
544 |
| - * @return gui-item-object to add to the gui-builder |
545 |
| - */ |
546 |
| - public static GuiItem createGuiItem(ItemStack itemStack, BiConsumer<OnlineUser, ClickType> consumer) { |
547 |
| - return server.createAdvancedGuiItem(itemStack, consumer); |
548 |
| - } |
549 |
| - |
550 |
| - /** |
551 |
| - * Creates new gui-item, based on a specific itemstack with a specific callback. |
552 |
| - * Gui-items can be added to inventory-guis (built by gui-builder). If a player clicks the gui-item, the callback is called with the player-object. |
| 515 | + * Gui-items can be added to inventory-guis (built by gui-builder). |
553 | 516 | *
|
554 | 517 | * @param itemBuilder item which should be displayed in the inventory
|
555 |
| - * @param consumer consumer which gets called if a player clicks the item |
| 518 | + * @param callback consumer which gets called if a player clicks the item |
556 | 519 | * @return gui-item-object to add to the gui-builder
|
557 | 520 | */
|
558 |
| - public static GuiItem createGuiItem(ItemBuilder itemBuilder, BiConsumer<OnlineUser, ClickType> consumer) { |
559 |
| - return server.createAdvancedGuiItem(itemBuilder.build(), consumer); |
| 521 | + public static GuiItem createGuiItem(ItemBuilder itemBuilder, Consumer<OnlineUser> callback) { |
| 522 | + return server.createGuiItem(itemBuilder.build(), callback); |
560 | 523 | }
|
561 | 524 |
|
562 | 525 | /**
|
563 | 526 | * Creates new gui-item, based on a specific itemstack with a specific callback.
|
564 |
| - * Gui-items can be added to inventory-guis (built by gui-builder). If a player clicks the gui-item, the callback is called with the player-object. |
| 527 | + * Gui-items can be added to inventory-guis (built by gui-builder). |
565 | 528 | *
|
566 | 529 | * @param item item which should be displayed in the inventory
|
567 |
| - * @param consumer consumer which gets called if a player clicks the item |
| 530 | + * @param callback consumer which gets called if a player clicks the item |
568 | 531 | * @return gui-item-object to add to the gui-builder
|
569 | 532 | */
|
570 |
| - public static GuiItem createGuiItem(InterfaceItem item, BiConsumer<OnlineUser, ClickType> consumer) { |
571 |
| - return server.createAdvancedGuiItem(item.toItemStack(), consumer); |
| 533 | + public static GuiItem createGuiItem(InterfaceItem item, Consumer<OnlineUser> callback) { |
| 534 | + return server.createGuiItem(item.toItemStack(), callback); |
572 | 535 | }
|
573 | 536 |
|
574 | 537 | /**
|
575 | 538 | * Creates new gui-item, based on a specific itemstack with a specific callback.
|
576 | 539 | * Gui-items can be added to inventory-guis (built by gui-builder). If a player clicks the gui-item, the callback is called with the player-object.
|
577 | 540 | *
|
578 | 541 | * @param itemStack item which should be displayed in the inventory
|
579 |
| - * @param consumer consumer which gets called if a player clicks the item |
| 542 | + * @param callback consumer which gets called if a player clicks the item |
580 | 543 | * @return gui-item-object to add to the gui-builder
|
581 | 544 | */
|
582 |
| - public static GuiItem createGuiItem(ItemStack itemStack, TriConsumer<OnlineUser, ClickType, Inventory> consumer) { |
583 |
| - return server.createAdvancedGuiItem(itemStack, consumer); |
| 545 | + public static GuiItem createGuiItem(ItemStack itemStack, BiConsumer<OnlineUser, InventoryClickEvent> callback) { |
| 546 | + return server.createAdvancedGuiItem(itemStack, callback); |
584 | 547 | }
|
585 | 548 |
|
586 | 549 | /**
|
587 | 550 | * Creates new gui-item, based on a specific itemstack with a specific callback.
|
588 | 551 | * Gui-items can be added to inventory-guis (built by gui-builder). If a player clicks the gui-item, the callback is called with the player-object.
|
589 | 552 | *
|
590 | 553 | * @param itemBuilder item which should be displayed in the inventory
|
591 |
| - * @param consumer consumer which gets called if a player clicks the item |
| 554 | + * @param callback consumer which gets called if a player clicks the item |
592 | 555 | * @return gui-item-object to add to the gui-builder
|
593 | 556 | */
|
594 |
| - public static GuiItem createGuiItem(ItemBuilder itemBuilder, TriConsumer<OnlineUser, ClickType, Inventory> consumer) { |
595 |
| - return server.createAdvancedGuiItem(itemBuilder.build(), consumer); |
| 557 | + public static GuiItem createGuiItem(ItemBuilder itemBuilder, BiConsumer<OnlineUser, InventoryClickEvent> callback) { |
| 558 | + return server.createAdvancedGuiItem(itemBuilder.build(), callback); |
596 | 559 | }
|
597 | 560 |
|
598 | 561 | /**
|
599 | 562 | * Creates new gui-item, based on a specific itemstack with a specific callback.
|
600 | 563 | * Gui-items can be added to inventory-guis (built by gui-builder). If a player clicks the gui-item, the callback is called with the player-object.
|
601 | 564 | *
|
602 | 565 | * @param item item which should be displayed in the inventory
|
603 |
| - * @param consumer consumer which gets called if a player clicks the item |
604 |
| - * @return gui-item-object to add to the gui-builder |
605 |
| - */ |
606 |
| - public static GuiItem createGuiItem(InterfaceItem item, TriConsumer<OnlineUser, ClickType, Inventory> consumer) { |
607 |
| - return server.createAdvancedGuiItem(item.toItemStack(), consumer); |
608 |
| - } |
609 |
| - |
610 |
| - /** |
611 |
| - * Creates new gui-item, based on a specific itemstack without any callback. |
612 |
| - * Gui-items can be added to inventory-guis (built by gui-builder). If a player clicks the gui-item, the callback is called with the player-object. |
613 |
| - * |
614 |
| - * @param itemStack item which should be displayed in the inventory (use item-builder to create this item) |
| 566 | + * @param callback consumer which gets called if a player clicks the item |
615 | 567 | * @return gui-item-object to add to the gui-builder
|
616 | 568 | */
|
617 |
| - public static GuiItem createGuiItem(ItemStack itemStack) { |
618 |
| - return server.createGuiItem(itemStack, null); |
| 569 | + public static GuiItem createGuiItem(InterfaceItem item, BiConsumer<OnlineUser, InventoryClickEvent> callback) { |
| 570 | + return server.createAdvancedGuiItem(item.toItemStack(), callback); |
619 | 571 | }
|
620 | 572 |
|
621 | 573 | /**
|
|
0 commit comments