From 1b736b5e31d083a579b4b2c818b7092f0ee3a5c6 Mon Sep 17 00:00:00 2001 From: Ninjdai Date: Wed, 2 Oct 2024 12:06:15 +0200 Subject: [PATCH] feat: duo roles support --- .../ninjdai/werewolf/commands/lg/LGConfiguration.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/ninjdai/werewolf/commands/lg/LGConfiguration.java b/src/main/java/dev/ninjdai/werewolf/commands/lg/LGConfiguration.java index 3957b68..ca92f0f 100644 --- a/src/main/java/dev/ninjdai/werewolf/commands/lg/LGConfiguration.java +++ b/src/main/java/dev/ninjdai/werewolf/commands/lg/LGConfiguration.java @@ -48,8 +48,14 @@ public class LGConfiguration extends Command { if (integer==null) integer = 0; switch (event.getClickType()) { - case LEFT_CLICK -> integer = Math.min(integer+1, role.get().getRoleMaxCount()); - case RIGHT_CLICK -> integer = Math.max(integer-1, 0); + case LEFT_CLICK -> { + if (role.get().isDuo()) integer = 2; + else integer = Math.min(integer+1, role.get().getRoleMaxCount()); + } + case RIGHT_CLICK -> { + if (role.get().isDuo()) integer = 0; + else integer = Math.max(integer-1, 0); + } } if (integer > 0) guiItem.setItemStack(guiItem.getItemStack().withMaterial(Material.GREEN_TERRACOTTA).withAmount(integer));