->Players can swap the quiver out normally when they do not have a Bow
equipped in their main hand slot.
This commit is contained in:
parent
a7c367f8f1
commit
cdea201c12
Binary file not shown.
@ -3111,7 +3111,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
@EventHandler(priority=EventPriority.LOW,ignoreCancelled = true)
|
||||||
public void onPlayerSwapItem(PlayerSwapHandItemsEvent ev) {
|
public void onPlayerSwapItem(PlayerSwapHandItemsEvent ev) {
|
||||||
Player p = ev.getPlayer();
|
Player p = ev.getPlayer();
|
||||||
if (ArrowQuiver.isValidQuiver(ev.getMainHandItem())) {
|
if (ev.getMainHandItem()!=null &&
|
||||||
|
ev.getMainHandItem().getType()==Material.BOW && ArrowQuiver.isValidQuiver(ev.getMainHandItem())) {
|
||||||
ev.setCancelled(true);
|
ev.setCancelled(true);
|
||||||
//Swap forward or backward modes, depending on whether we are sneaking of not.
|
//Swap forward or backward modes, depending on whether we are sneaking of not.
|
||||||
ItemStack quiver = p.getEquipment().getItemInOffHand();
|
ItemStack quiver = p.getEquipment().getItemInOffHand();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user