diff --git a/commons/src/main/java/net/swofty/commons/skyblock/item/attribute/attributes/ItemAttributeAbiphoneContacts.java b/commons/src/main/java/net/swofty/commons/skyblock/item/attribute/attributes/ItemAttributeAbiphoneContacts.java new file mode 100644 index 000000000..954b1f544 --- /dev/null +++ b/commons/src/main/java/net/swofty/commons/skyblock/item/attribute/attributes/ItemAttributeAbiphoneContacts.java @@ -0,0 +1,33 @@ +package net.swofty.commons.skyblock.item.attribute.attributes; + +import net.swofty.commons.skyblock.item.attribute.ItemAttribute; +import net.swofty.commons.skyblock.statistics.ItemStatistics; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class ItemAttributeAbiphoneContacts extends ItemAttribute> { + @Override + public String getKey() { + return "abiphone_contacts"; + } + + @Override + public List getDefaultValue(@Nullable ItemStatistics defaultStatistics) { + return List.of(); + } + + @Override + public List loadFromString(String string) { + try { + return List.of(string.split(",")); + } catch (NumberFormatException e) { + return List.of(); + } + } + + @Override + public String saveIntoString() { + return String.join(",", getValue()); + } +} diff --git a/type.bedwarsgame/src/main/java/net/swofty/type/bedwarsgame/game/GameWorldManager.java b/type.bedwarsgame/src/main/java/net/swofty/type/bedwarsgame/game/GameWorldManager.java index aeee40478..77862f729 100644 --- a/type.bedwarsgame/src/main/java/net/swofty/type/bedwarsgame/game/GameWorldManager.java +++ b/type.bedwarsgame/src/main/java/net/swofty/type/bedwarsgame/game/GameWorldManager.java @@ -14,6 +14,7 @@ import net.swofty.type.bedwarsgame.user.BedWarsPlayer; import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.VillagerConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; import net.swofty.type.generic.user.HypixelPlayer; import org.tinylog.Logger; diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDoormanDave.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDoormanDave.java index 0d819ef53..030257f48 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDoormanDave.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDoormanDave.java @@ -5,6 +5,7 @@ import net.minestom.server.coordinate.Pos; import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; import net.swofty.type.generic.user.HypixelPlayer; public class NPCDoormanDave extends HypixelNPC { diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDoubles.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDoubles.java index ce7798890..3b57739c6 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDoubles.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDoubles.java @@ -9,11 +9,14 @@ import net.swofty.type.bedwarslobby.gui.GUIPlay; import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; import net.swofty.type.generic.user.HypixelPlayer; import java.util.ArrayList; import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCDoubles extends HypixelNPC { private static List cacheServers = new ArrayList<>(); private static long lastCacheTime = 0; diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDream.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDream.java index 437d40860..bf905f97f 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDream.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCDream.java @@ -14,6 +14,8 @@ import java.util.ArrayList; import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCDream extends HypixelNPC { private static List cacheServers = new ArrayList<>(); private static long lastCacheTime = 0; diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCFourFour.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCFourFour.java index 3e2e96141..42dd20451 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCFourFour.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCFourFour.java @@ -14,6 +14,8 @@ import java.util.ArrayList; import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCFourFour extends HypixelNPC { private static List cacheServers = new ArrayList<>(); private static long lastCacheTime = 0; diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCHolidayMan.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCHolidayMan.java index 5febf0cf0..88853df11 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCHolidayMan.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCHolidayMan.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCHolidayMan extends HypixelNPC { public NPCHolidayMan() { diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCHypixelStore.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCHypixelStore.java index 5b94f985b..1fa15e267 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCHypixelStore.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCHypixelStore.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCHypixelStore extends HypixelNPC { public NPCHypixelStore() { diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSlumberTourGuide.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSlumberTourGuide.java index 97fe2e030..a96c064d7 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSlumberTourGuide.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSlumberTourGuide.java @@ -8,6 +8,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCSlumberTourGuide extends HypixelNPC { public NPCSlumberTourGuide() { diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSolo.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSolo.java index ce3e52b58..c578c6660 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSolo.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSolo.java @@ -14,6 +14,8 @@ import java.util.ArrayList; import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCSolo extends HypixelNPC { private static List cacheServers = new ArrayList<>(); private static long lastCacheTime = 0; diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSquads.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSquads.java index 02e13c516..5af3bfda4 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSquads.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCSquads.java @@ -14,6 +14,8 @@ import java.util.ArrayList; import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCSquads extends HypixelNPC { private static List cacheServers = new ArrayList<>(); private static long lastCacheTime = 0; diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCStats.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCStats.java index f08c8e5c6..4122150f4 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCStats.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCStats.java @@ -16,6 +16,8 @@ import static net.swofty.commons.bedwars.BedwarsLevelUtil.suffix; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCStats extends HypixelNPC { public NPCStats() { diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCTrios.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCTrios.java index ba9805888..13b9ef3e6 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCTrios.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/NPCTrios.java @@ -14,6 +14,8 @@ import java.util.ArrayList; import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCTrios extends HypixelNPC { private static List cacheServers = new ArrayList<>(); private static long lastCacheTime = 0; diff --git a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/villagers/QuestMasterNPC.java b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/villagers/QuestMasterNPC.java index bf17fd039..3df9cc86e 100644 --- a/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/villagers/QuestMasterNPC.java +++ b/type.bedwarslobby/src/main/java/net/swofty/type/bedwarslobby/npcs/villagers/QuestMasterNPC.java @@ -8,6 +8,8 @@ import net.swofty.type.generic.user.HypixelPlayer; import net.swofty.type.lobby.gui.GUIGameQuests; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class QuestMasterNPC extends HypixelNPC { public QuestMasterNPC() { diff --git a/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCLapisMiner.java b/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCLapisMiner.java index e9ac90e24..c25629bd8 100644 --- a/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCLapisMiner.java +++ b/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCLapisMiner.java @@ -8,6 +8,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCLapisMiner extends HypixelNPC { public NPCLapisMiner() { diff --git a/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCLiftOperator.java b/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCLiftOperator.java index 3e1087189..ce7b54ac4 100644 --- a/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCLiftOperator.java +++ b/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCLiftOperator.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCLiftOperator extends HypixelNPC { public NPCLiftOperator() { diff --git a/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCRedstoneMiner.java b/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCRedstoneMiner.java index 7f03bc182..f3c71e4e3 100644 --- a/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCRedstoneMiner.java +++ b/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCRedstoneMiner.java @@ -8,6 +8,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCRedstoneMiner extends HypixelNPC { public NPCRedstoneMiner() { diff --git a/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCRhys.java b/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCRhys.java index 9185749f5..3eb75d53c 100644 --- a/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCRhys.java +++ b/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCRhys.java @@ -8,6 +8,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCRhys extends HypixelNPC { public NPCRhys() { diff --git a/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCWalter.java b/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCWalter.java index fc52568e7..699cc1e1a 100644 --- a/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCWalter.java +++ b/type.deepcaverns/src/main/java/net/swofty/type/deepcaverns/npcs/NPCWalter.java @@ -5,6 +5,7 @@ import net.minestom.server.item.ItemStack; import net.swofty.type.deepcaverns.gui.GUIShopWalter; import net.swofty.type.generic.entity.npc.HypixelNPC; +import net.swofty.type.generic.entity.npc.NPCAbiphoneTrait; import net.swofty.type.generic.entity.npc.NPCOption; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.generic.user.HypixelPlayer; @@ -16,7 +17,9 @@ import java.util.Collections; import java.util.stream.Stream; -public class NPCWalter extends HypixelNPC { +import net.swofty.type.generic.event.custom.NPCInteractEvent; + +public class NPCWalter extends HypixelNPC implements NPCAbiphoneTrait { public NPCWalter() { super(new HumanConfiguration() { @@ -52,23 +55,6 @@ public void onClick(NPCInteractEvent event) { SkyBlockPlayer player = (SkyBlockPlayer) event.player(); if (isInDialogue(player)) return; - ItemStack itemStack = player.getItemInMainHand(); - SkyBlockItem item = new SkyBlockItem(itemStack); - - if (item.hasComponent(AbiphoneComponent.class)) { - setDialogue(player, "abiphone").thenRun(() -> { - NPCOption.sendOption(player, "walter", Collections.singletonList(new NPCOption.Option( - "pay", // actual id from Hypixel - NamedTextColor.GREEN, - "DONATE CUBE", - (p) -> { - setDialogue(player, "donate_cube_no_requirements"); - } - ))); - }); - return; - } - setDialogue(player, "none").thenRun(() -> { MathUtility.delay(() -> new GUIShopWalter().open(player), 20); }); @@ -80,23 +66,12 @@ public DialogueSet[] dialogues(HypixelPlayer player) { DialogueSet.builder() .key("none").lines(new String[]{ "With the right tools, you can get through anything!", - }).build(), - DialogueSet.builder() - .key("abiphone").lines(new String[]{ // when clicking with an Abiphone - "My abiphone is for Platinum-level donors of the Walter cause only.", - "You know these superbooms don't craft themselves right?", - "You just need §3Sulphur Collection 7 §fand to then donate an Enchanted Sulphur Cube!", // then show "donate cube" option - }).abiPhone(true).build(), - DialogueSet.builder() - .key("donate_cube").lines(new String[]{ // when donating the cube with requirements met - "Welcome to the Platinum club, high roller!", - "Call me anytime!", - "And before you ask... yes, I do try to commercialize all of my friendships.", - }).abiPhone(true).build(), - DialogueSet.builder() - .key("donate_cube_no_requirements").lines(new String[]{ // when donating the cube without requirements met - "Mmh... you're missing something to become a Platinum-level donor...", - }).abiPhone(true).build() + }).build() ).toArray(DialogueSet[]::new); } + + @Override + public String getAbiphoneKey() { + return "walter"; + } } \ No newline at end of file diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/INPCRoyalGuard.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/INPCRoyalGuard.java index 945fefeab..0f960f7e7 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/INPCRoyalGuard.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/INPCRoyalGuard.java @@ -9,6 +9,8 @@ import java.util.function.Function; import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class INPCRoyalGuard extends HypixelNPC { public INPCRoyalGuard(Function signature, Function texture, Function position) { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBankerBroadjaw.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBankerBroadjaw.java index ac0035a68..717a34b60 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBankerBroadjaw.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBankerBroadjaw.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.user.HypixelPlayer; import net.swofty.type.skyblockgeneric.gui.inventories.banker.GUIBanker; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBankerBroadjaw extends HypixelNPC { public NPCBankerBroadjaw() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBubu.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBubu.java index eed3ceb34..1862aa81b 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBubu.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBubu.java @@ -8,6 +8,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBubu extends HypixelNPC { public NPCBubu() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBulvar.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBulvar.java index 118f9b6c9..d6d0ee21f 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBulvar.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCBulvar.java @@ -8,6 +8,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBulvar extends HypixelNPC { public NPCBulvar() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardEight.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardEight.java index ddcd24c1c..cd4439511 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardEight.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardEight.java @@ -8,6 +8,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCCastleGuardEight extends HypixelNPC { public NPCCastleGuardEight() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardFive.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardFive.java index 8e6406e98..b619fc023 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardFive.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardFive.java @@ -8,6 +8,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCCastleGuardFive extends HypixelNPC { public NPCCastleGuardFive() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardFour.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardFour.java index d82675a2f..405df1a8e 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardFour.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardFour.java @@ -8,6 +8,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCCastleGuardFour extends HypixelNPC { public NPCCastleGuardFour() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardOne.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardOne.java index 51f1cff30..849a629bf 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardOne.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardOne.java @@ -8,6 +8,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCCastleGuardOne extends HypixelNPC { public NPCCastleGuardOne() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardSeven.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardSeven.java index cef59d696..8d3a80a41 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardSeven.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardSeven.java @@ -8,6 +8,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCCastleGuardSeven extends HypixelNPC { public NPCCastleGuardSeven() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardSix.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardSix.java index 5fec3471a..3949b01da 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardSix.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardSix.java @@ -8,6 +8,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCCastleGuardSix extends HypixelNPC { public NPCCastleGuardSix() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardThree.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardThree.java index c9ecaabe3..770f875d8 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardThree.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardThree.java @@ -8,6 +8,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCCastleGuardThree extends HypixelNPC { public NPCCastleGuardThree() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardTwo.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardTwo.java index 495bb2fc2..61decfcf8 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardTwo.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCCastleGuardTwo.java @@ -8,6 +8,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCCastleGuardTwo extends HypixelNPC { public NPCCastleGuardTwo() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCFragilis.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCFragilis.java index 222c45c96..0afea4c91 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCFragilis.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCFragilis.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCFragilis extends HypixelNPC { public NPCFragilis() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCLiftOperator.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCLiftOperator.java index 4384bd1da..20bfcf913 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCLiftOperator.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCLiftOperator.java @@ -8,6 +8,8 @@ import net.swofty.type.generic.user.HypixelPlayer; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCLiftOperator extends HypixelNPC { public NPCLiftOperator() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCPuzzler.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCPuzzler.java index 524bddd5f..64a479390 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCPuzzler.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCPuzzler.java @@ -8,6 +8,8 @@ import net.swofty.type.generic.user.HypixelPlayer; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCPuzzler extends HypixelNPC { public NPCPuzzler() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCRhys.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCRhys.java index e0073dcc4..370c44461 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCRhys.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCRhys.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCRhys extends HypixelNPC { public NPCRhys() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCSilnar.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCSilnar.java index 04a5555a5..8dc626255 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCSilnar.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/NPCSilnar.java @@ -8,6 +8,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCSilnar extends HypixelNPC { public NPCSilnar() { diff --git a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/VillagerBlacksmith.java b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/VillagerBlacksmith.java index 97200e690..35211934f 100644 --- a/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/VillagerBlacksmith.java +++ b/type.dwarvenmines/src/main/java/net/swofty/type/dwarvenmines/npcs/VillagerBlacksmith.java @@ -8,6 +8,8 @@ import net.swofty.type.skyblockgeneric.gui.inventories.GUIReforge; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerBlacksmith extends HypixelNPC { public VillagerBlacksmith() { super(new VillagerConfiguration() { diff --git a/type.generic/src/main/java/net/swofty/type/generic/data/datapoints/DatapointToggles.java b/type.generic/src/main/java/net/swofty/type/generic/data/datapoints/DatapointToggles.java index a2256612e..53d1a7801 100644 --- a/type.generic/src/main/java/net/swofty/type/generic/data/datapoints/DatapointToggles.java +++ b/type.generic/src/main/java/net/swofty/type/generic/data/datapoints/DatapointToggles.java @@ -80,6 +80,9 @@ public enum ToggleType { HAS_SPOKEN_TO_BAKER(false), HAS_SPOKEN_TO_RUSTY(false), HAS_SPOKEN_TO_RUSTY_ABOUT_PICKAXE(false), + HAS_SPOKEN_TO_RUSTY_ABOUT_ABIPHONE(false), + HAS_GIVEN_WALTER_CUBE(false), + HAS_GIVEN_BUILDER_BUILDERS_WAND(false), HAS_SPOKEN_TO_CURATOR(false), HAS_SPOKEN_TO_MADAME_ELEANOR(false), HAS_DONE_COAL_TRADE_WITH_BLACKSMITH(false), diff --git a/type.generic/src/main/java/net/swofty/type/generic/entity/npc/DialogueController.java b/type.generic/src/main/java/net/swofty/type/generic/entity/npc/DialogueController.java index e884ea9ba..92f26d690 100644 --- a/type.generic/src/main/java/net/swofty/type/generic/entity/npc/DialogueController.java +++ b/type.generic/src/main/java/net/swofty/type/generic/entity/npc/DialogueController.java @@ -64,11 +64,8 @@ public void cancelDialogue(HypixelPlayer player) { } private void handleLineSendingLoop(HypixelPlayer player, HypixelNPC.DialogueSet dialogueSet) { - if (dialogueSet.abiPhone()) { - npc.sendNPCAbiphoneMessage(player, dialogueSet.lines()[0]); - } else { - npc.sendNPCMessage(player, dialogueSet.lines()[0]); - } + npc.sendNPCMessage(player, dialogueSet.lines()[0]); + String[] newLines = new String[dialogueSet.lines().length - 1]; System.arraycopy(dialogueSet.lines(), 1, newLines, 0, dialogueSet.lines().length - 1); @@ -89,7 +86,6 @@ private void handleLineSendingLoop(HypixelPlayer player, HypixelNPC.DialogueSet handleLineSendingLoop(player, HypixelNPC.DialogueSet.builder() .key(dialogueSet.key()) .lines(newLines) - .abiPhone(dialogueSet.abiPhone()) .build()); } }).delay(TaskSchedule.seconds(2)).schedule(); diff --git a/type.generic/src/main/java/net/swofty/type/generic/entity/npc/HypixelNPC.java b/type.generic/src/main/java/net/swofty/type/generic/entity/npc/HypixelNPC.java index 0fd6be4ed..79e4f8252 100644 --- a/type.generic/src/main/java/net/swofty/type/generic/entity/npc/HypixelNPC.java +++ b/type.generic/src/main/java/net/swofty/type/generic/entity/npc/HypixelNPC.java @@ -4,6 +4,7 @@ import lombok.Getter; import net.minestom.server.coordinate.Pos; import net.minestom.server.entity.Entity; +import net.minestom.server.item.ItemStack; import net.minestom.server.network.packet.server.play.EntityHeadLookPacket; import net.minestom.server.network.packet.server.play.EntityRotationPacket; import net.swofty.type.generic.entity.hologram.PlayerHolograms; @@ -14,6 +15,7 @@ import net.swofty.type.generic.entity.npc.impl.NPCAnimalEntityImpl; import net.swofty.type.generic.entity.npc.impl.NPCEntityImpl; import net.swofty.type.generic.entity.npc.impl.NPCVillagerEntityImpl; +import net.swofty.type.generic.event.custom.NPCInteractEvent; import net.swofty.type.generic.user.HypixelPlayer; import net.swofty.type.generic.utility.MathUtility; @@ -214,15 +216,6 @@ private static List getInRangeList(Entity entity) { public abstract void onClick(NPCInteractEvent event); - /** - * Called when a NPC is called (with an Abiphone) by a player. - * - * @param player The player who called the NPC. - */ - public void onCalled(HypixelPlayer player) { - - } - public void register() { registeredNPCs.add(this); } @@ -235,13 +228,6 @@ public void sendNPCMessage(HypixelPlayer player, String message) { player.sendMessage("§e[NPC] " + getName() + "§f: " + message); } - public void sendNPCAbiphoneMessage(HypixelPlayer player, String message) { - player.sendMessage("§e[NPC] " + getName() + "§f: §b✆ §f" + message); - } - - public record NPCInteractEvent(HypixelPlayer player, HypixelNPC npc) { - } - protected DialogueController dialogue() { return dialogueController; } @@ -306,7 +292,7 @@ public Map.Entry get(HypixelNPC } @Builder - public record DialogueSet(String key, String[] lines, boolean abiPhone) { + public record DialogueSet(String key, String[] lines) { public static final DialogueSet[] EMPTY = new DialogueSet[0]; } } diff --git a/type.generic/src/main/java/net/swofty/type/generic/entity/npc/NPCAbiphoneTrait.java b/type.generic/src/main/java/net/swofty/type/generic/entity/npc/NPCAbiphoneTrait.java new file mode 100644 index 000000000..ade2b6585 --- /dev/null +++ b/type.generic/src/main/java/net/swofty/type/generic/entity/npc/NPCAbiphoneTrait.java @@ -0,0 +1,5 @@ +package net.swofty.type.generic.entity.npc; + +public interface NPCAbiphoneTrait { + String getAbiphoneKey(); +} diff --git a/type.generic/src/main/java/net/swofty/type/generic/event/HypixelEventHandler.java b/type.generic/src/main/java/net/swofty/type/generic/event/HypixelEventHandler.java index c359efb19..92d7cdf64 100644 --- a/type.generic/src/main/java/net/swofty/type/generic/event/HypixelEventHandler.java +++ b/type.generic/src/main/java/net/swofty/type/generic/event/HypixelEventHandler.java @@ -164,7 +164,12 @@ private static void runEvent(HypixelEvent event, Method method, Object eventClas public static void callCustomEvent(Event event) { if (customEventNode != null) { if (event instanceof PlayerEvent playerEvent) { - if (HypixelDataHandler.getUser(playerEvent.getPlayer()) == null) return; + if (HypixelDataHandler.getUser(playerEvent.getPlayer()) == null) { + Logger.warn("Tried to call custom event {} for player {} but their data is not loaded.", + event.getClass().getSimpleName(), + playerEvent.getPlayer().getUsername()); + return; + } } customEventNode.call(event); } diff --git a/type.generic/src/main/java/net/swofty/type/generic/event/actions/npc/ActionPlayerClickedNPC.java b/type.generic/src/main/java/net/swofty/type/generic/event/actions/npc/ActionPlayerClickedNPC.java index 792422dab..d01deab86 100644 --- a/type.generic/src/main/java/net/swofty/type/generic/event/actions/npc/ActionPlayerClickedNPC.java +++ b/type.generic/src/main/java/net/swofty/type/generic/event/actions/npc/ActionPlayerClickedNPC.java @@ -11,7 +11,7 @@ import net.swofty.type.generic.event.HypixelEvent; import net.swofty.type.generic.event.HypixelEventClass; import net.swofty.type.generic.event.HypixelEventHandler; -import net.swofty.type.generic.event.custom.VillagerSpokenToEvent; +import net.swofty.type.generic.event.custom.NPCInteractEvent; import net.swofty.type.generic.user.HypixelPlayer; import org.tinylog.Logger; @@ -27,30 +27,16 @@ public void run(PlayerEntityInteractEvent event) { HypixelNPC npc = HypixelNPC.getFromImpl(player, entity); if (npc == null) return; - switch (entity) { - case NPCEntityImpl _ -> npc.onClick(new HypixelNPC.NPCInteractEvent( - player, - npc - )); - case NPCVillagerEntityImpl _ -> { - VillagerSpokenToEvent spokenToEvent = new VillagerSpokenToEvent(player, npc); - HypixelEventHandler.callCustomEvent(spokenToEvent); + NPCInteractEvent clickEvent = new NPCInteractEvent(player, event.getHand(), npc); + HypixelEventHandler.callCustomEvent(clickEvent); + if (clickEvent.isCancelled()) return; - if (spokenToEvent.isCancelled()) return; - - npc.onClick(new HypixelNPC.NPCInteractEvent( - player, - npc - )); - } - case NPCAnimalEntityImpl _ -> npc.onClick(new HypixelNPC.NPCInteractEvent( - player, - npc - )); - default -> { + switch (entity) { + case NPCEntityImpl _, NPCVillagerEntityImpl _, NPCAnimalEntityImpl _ -> npc.onClick(clickEvent); + default -> { // This is not a NPC we can handle here Logger.warn("Player " + player.getUsername() + " clicked on an unknown NPC type: " + entity.getClass().getName()); - } - } + } + } } } diff --git a/type.generic/src/main/java/net/swofty/type/generic/event/custom/NPCInteractEvent.java b/type.generic/src/main/java/net/swofty/type/generic/event/custom/NPCInteractEvent.java new file mode 100644 index 000000000..bcd4c5f21 --- /dev/null +++ b/type.generic/src/main/java/net/swofty/type/generic/event/custom/NPCInteractEvent.java @@ -0,0 +1,44 @@ +package net.swofty.type.generic.event.custom; + +import lombok.Getter; +import net.minestom.server.entity.Player; +import net.minestom.server.entity.PlayerHand; +import net.minestom.server.event.trait.CancellableEvent; +import net.minestom.server.event.trait.PlayerInstanceEvent; +import net.swofty.type.generic.entity.npc.HypixelNPC; +import net.swofty.type.generic.user.HypixelPlayer; +import org.jspecify.annotations.NonNull; + + +public class NPCInteractEvent implements PlayerInstanceEvent, CancellableEvent { + private Boolean cancelled = false; + private final PlayerHand hand; + private final HypixelPlayer player; + @Getter + private final HypixelNPC npc; + + public NPCInteractEvent(HypixelPlayer player, PlayerHand hand, HypixelNPC npc) { + this.player = player; + this.hand = hand; + this.npc = npc; + } + + @Override + public @NonNull Player getPlayer() { + return player; + } + + public HypixelPlayer player() { + return player; + } + + @Override + public boolean isCancelled() { + return cancelled; + } + + @Override + public void setCancelled(boolean cancel) { + this.cancelled = cancel; + } +} diff --git a/type.generic/src/main/java/net/swofty/type/generic/event/custom/VillagerSpokenToEvent.java b/type.generic/src/main/java/net/swofty/type/generic/event/custom/VillagerSpokenToEvent.java deleted file mode 100644 index 93b2c08ee..000000000 --- a/type.generic/src/main/java/net/swofty/type/generic/event/custom/VillagerSpokenToEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -package net.swofty.type.generic.event.custom; - -import lombok.Getter; -import net.minestom.server.event.trait.CancellableEvent; -import net.minestom.server.event.trait.PlayerInstanceEvent; - -import net.swofty.type.generic.entity.npc.HypixelNPC; -import net.swofty.type.generic.user.HypixelPlayer; -import org.jetbrains.annotations.NotNull; - -public class VillagerSpokenToEvent implements PlayerInstanceEvent, CancellableEvent { - private final HypixelPlayer player; - @Getter - private final HypixelNPC villager; - private Boolean cancelled = false; - - public VillagerSpokenToEvent(HypixelPlayer player, HypixelNPC villager) { - this.player = player; - this.villager = villager; - } - - @Override - public @NotNull HypixelPlayer getPlayer() { - return player; - } - - @Override - public boolean isCancelled() { - return cancelled; - } - - @Override - public void setCancelled(boolean b) { - cancelled = b; - } -} diff --git a/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCGoldForger.java b/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCGoldForger.java index 3bff3c842..8b003eedd 100644 --- a/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCGoldForger.java +++ b/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCGoldForger.java @@ -8,6 +8,8 @@ import net.swofty.type.goldmine.gui.GUIShopGoldForger; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCGoldForger extends HypixelNPC { public NPCGoldForger() { diff --git a/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCIronForger.java b/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCIronForger.java index 2e9080364..38a18b40e 100644 --- a/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCIronForger.java +++ b/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCIronForger.java @@ -8,6 +8,8 @@ import net.swofty.type.goldmine.gui.GUIShopIronForger; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCIronForger extends HypixelNPC { public NPCIronForger() { diff --git a/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCLazyMiner.java b/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCLazyMiner.java index 0eb8742e6..7101bb817 100644 --- a/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCLazyMiner.java +++ b/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/NPCLazyMiner.java @@ -14,6 +14,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCLazyMiner extends HypixelNPC { public NPCLazyMiner() { diff --git a/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/villagers/VillagerBlacksmith.java b/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/villagers/VillagerBlacksmith.java index 6ae4afe37..d84ce18b4 100644 --- a/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/villagers/VillagerBlacksmith.java +++ b/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/villagers/VillagerBlacksmith.java @@ -2,15 +2,13 @@ import net.minestom.server.coordinate.Pos; import net.minestom.server.entity.VillagerProfession; -import net.swofty.type.generic.data.datapoints.DatapointToggles; import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.VillagerConfiguration; import net.swofty.type.generic.user.HypixelPlayer; import net.swofty.type.skyblockgeneric.gui.inventories.GUIReforge; -import net.swofty.type.skyblockgeneric.mission.missions.blacksmith.MissionTalkToBlacksmith; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; -import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; public class VillagerBlacksmith extends HypixelNPC { public VillagerBlacksmith() { @@ -40,25 +38,6 @@ public VillagerProfession profession() { @Override public void onClick(NPCInteractEvent e) { SkyBlockPlayer player = (SkyBlockPlayer) e.player(); - if (!player.getToggles().get(DatapointToggles.Toggles.ToggleType.HAS_SPOKEN_TO_GOLD_BLACKSMITH)) { - setDialogue(player, "initial-hello").thenRun(() -> { - player.getToggles().set(DatapointToggles.Toggles.ToggleType.HAS_SPOKEN_TO_GOLD_BLACKSMITH, true); - new GUIReforge().open(player); - }); - } else { - new GUIReforge().open(player); - } + new GUIReforge().open(player); } - - @Override - public DialogueSet[] dialogues(HypixelPlayer player) { - return Stream.of( - DialogueSet.builder() - .key("initial-hello").lines(new String[]{ - "I'm a friend of Blacksmith in the §bVillage", - "My name?", - "Blacksmith" - }).build() - ).toArray(DialogueSet[]::new); - } -} +} \ No newline at end of file diff --git a/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/villagers/VillagerRusty.java b/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/villagers/VillagerRusty.java index 228de63fa..621467e67 100644 --- a/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/villagers/VillagerRusty.java +++ b/type.goldmine/src/main/java/net/swofty/type/goldmine/npcs/villagers/VillagerRusty.java @@ -2,20 +2,20 @@ import net.minestom.server.coordinate.Pos; import net.minestom.server.entity.VillagerProfession; -import net.minestom.server.item.ItemStack; import net.swofty.type.generic.data.datapoints.DatapointToggles; import net.swofty.type.generic.entity.npc.HypixelNPC; +import net.swofty.type.generic.entity.npc.NPCAbiphoneTrait; import net.swofty.type.generic.entity.npc.configuration.VillagerConfiguration; import net.swofty.type.generic.user.HypixelPlayer; -import net.swofty.type.goldmine.gui.rusty.GUIRusty; -import net.swofty.type.skyblockgeneric.item.SkyBlockItem; -import net.swofty.type.skyblockgeneric.item.components.AbiphoneComponent; +import net.swofty.type.skyblockgeneric.gui.inventories.rusty.GUIRusty; import net.swofty.type.skyblockgeneric.mission.missions.lazyminer.MissionFindLazyMinerPickaxe; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; import java.util.stream.Stream; -public class VillagerRusty extends HypixelNPC { +import net.swofty.type.generic.event.custom.NPCInteractEvent; + +public class VillagerRusty extends HypixelNPC implements NPCAbiphoneTrait { public VillagerRusty() { super(new VillagerConfiguration() { @Override @@ -70,14 +70,6 @@ public void onClick(NPCInteractEvent event) { return; } - ItemStack itemStack = player.getItemInMainHand(); - SkyBlockItem item = new SkyBlockItem(itemStack); - if (item.hasComponent(AbiphoneComponent.class)) { - setDialogue(player, "abiphone").thenRun(() -> { - // add to the Abiphone - }); - } - new GUIRusty().open(player); } @@ -105,20 +97,12 @@ public DialogueSet[] dialogues(HypixelPlayer player) { "It drives me insane, but at least you'll unlock §aAuto-pickup §fat §3SkyBlock Level 6.", "It makes my job a lot easier, but despite that, I still find so many items on the ground.", "Maybe some of those items are yours? In which case I'll let you buy them back." - }).build(), - DialogueSet.builder() - .key("abiphone").lines(new String[]{ // when clicking with an Abiphone - "§fDid I find an Abiphone?", - "§fYes, sometimes I do find one lying around.", - "§fWhat?", - "§fYou?", - "§fYou want my contact?", - "§fMe?", - "§fThe janitor?", - "§fI...", - "§fI don't... don't know what to say...", - "§fYes of course you can have it!", - }).abiPhone(true).build() + }).build() ).toArray(DialogueSet[]::new); } -} + + @Override + public String getAbiphoneKey() { + return "rusty"; + } +} \ No newline at end of file diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAdventurer.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAdventurer.java index e1e844530..0798862cb 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAdventurer.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAdventurer.java @@ -7,6 +7,8 @@ import net.swofty.type.hub.gui.GUIShopAdventurer; import net.swofty.type.generic.data.datapoints.DatapointToggles; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCAdventurer extends HypixelNPC { public NPCAdventurer() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAlchemist.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAlchemist.java index 033e02df5..a53688159 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAlchemist.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAlchemist.java @@ -9,6 +9,8 @@ import net.swofty.type.hub.gui.GUIShopAlchemist; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCAlchemist extends HypixelNPC { public NPCAlchemist() { super(new AnimalConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAlda.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAlda.java new file mode 100644 index 000000000..d3ee28c6a --- /dev/null +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAlda.java @@ -0,0 +1,52 @@ +package net.swofty.type.hub.npcs; + +import net.minestom.server.coordinate.Pos; +import net.swofty.type.generic.entity.npc.HypixelNPC; +import net.swofty.type.generic.entity.npc.NPCAbiphoneTrait; +import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.entity.npc.configuration.NPCConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; +import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.skyblockgeneric.gui.inventories.shop.GUIShopAlda; + +public class NPCAlda extends HypixelNPC implements NPCAbiphoneTrait { + + public NPCAlda() { + super(new HumanConfiguration() { + @Override + public String[] holograms(HypixelPlayer player) { + return new String[]{"§6Alda", "§e§lCLICK"}; + } + + @Override + public String signature(HypixelPlayer player) { + return "Hnuo54LzyUBtfOeOoRCBnA4+od399IK7QccXSkbc7V3TSi/ayJV9QeaMlIhbjzYHA1qQDPxpeYQ03PwpZMM6DT/yk8Xu0fz4orHFcSMdTRxlP6c6fugA2Behus7AKL+IkMmZe7Gjm4mxLJLXqWCCe/t24LNfe6hna9r9pzuvHl7kBcS44z+9Ue5LlkuK7nDLGYOnwic8og0GZNSfv8/k1Gir3U5DEdixrANq9AKXS0LSxwLfTpbXrW3UplMmYKs939GFeGA1t960FyjrEG4xX5oFRBxjZaLhaxKsRAIUxR1sP7nsejAqrrojxlZYs+5WIn1NFamvd1fo38CiiOo+IkETsoilO84PF/Ka1qRcsaOjjQnXQ9IAUfP9W9egv4yDwjaXuW0A8FPqPCH/u6j6o9CuUzhN7+uQsOMqyBOr6/qt0cNIkQs0Y9WhAC34hXCMfYctANhsz7gHhcIEV/5bDYPPFHnew8z3PUqAyLJCNTb8bgEQrCavCjBrnoKsQl02ZC2bSeDA5g8ASRQyGlNZOJFpd6rMcANdmKY6ZwTkCiaJirqpftJVK5qDJY0A8N0GHGieIHQohHQ5ffCMU5E1Jxkct5wLX0zPJOuzngQD2YZKLL8DtUKekrwKbyD2gCxuNN9NaFE+thcHdEpYl7DJzgWh0IoCXUGMB44cDypteeo="; + } + + @Override + public String texture(HypixelPlayer player) { + return "ewogICJ0aW1lc3RhbXAiIDogMTc1NTcwNTI3ODc3MywKICAicHJvZmlsZUlkIiA6ICJhZTg3MzEyNjBmMzY0ZWE2YjU3YTRkYjI5Mjk1YTA1OCIsCiAgInByb2ZpbGVOYW1lIiA6ICJGdW50aW1lX0ZveHlfMTkiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGI1NjQ3ZjkzZmQ4ZTFkYTljZGIxNTFkZDliZGY0ZjQ4YmI1OWExZDExNzQ4ZjE5MThjMTM2Yzg2ODA0YjIiCiAgICB9CiAgfQp9"; + } + + @Override + public Pos position(HypixelPlayer player) { + return new Pos(66.000, 71.000, -59.000, 25, 0); + } + + @Override + public boolean looking() { + return true; + } + }); + } + + @Override + public void onClick(NPCInteractEvent event) { + new GUIShopAlda().open(event.player()); + } + + @Override + public String getAbiphoneKey() { + return "alda"; + } +} diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAmelia.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAmelia.java index 9ae31ede3..f5ebf1dbd 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAmelia.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAmelia.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCAmelia extends HypixelNPC { public NPCAmelia() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAnita.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAnita.java index d1014e5c0..f58123010 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAnita.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAnita.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCAnita extends HypixelNPC { public NPCAnita() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCArthur.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCArthur.java index 8bc8f94b8..28f60d110 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCArthur.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCArthur.java @@ -7,6 +7,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCArthur extends HypixelNPC { public NPCArthur() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent1.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent1.java index 2630e3223..778374e02 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent1.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent1.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.skyblockgeneric.gui.inventories.auction.GUIAuctionHouse; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCAuctionAgent1 extends HypixelNPC { public NPCAuctionAgent1() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent2.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent2.java index 25d14ffe6..e8828f126 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent2.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent2.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.skyblockgeneric.gui.inventories.auction.GUIAuctionHouse; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCAuctionAgent2 extends HypixelNPC { public NPCAuctionAgent2() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent3.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent3.java index dc819399b..b2c577c05 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent3.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent3.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.skyblockgeneric.gui.inventories.auction.GUIAuctionHouse; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCAuctionAgent3 extends HypixelNPC { public NPCAuctionAgent3() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent4.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent4.java index 7a4782cf0..e6272a04c 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent4.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionAgent4.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.skyblockgeneric.gui.inventories.auction.GUIAuctionHouse; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCAuctionAgent4 extends HypixelNPC { public NPCAuctionAgent4() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionMaster.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionMaster.java index 44957ad5c..4f4077a4f 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionMaster.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCAuctionMaster.java @@ -11,6 +11,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCAuctionMaster extends HypixelNPC { public NPCAuctionMaster() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBaker.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBaker.java index fff314859..431832d84 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBaker.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBaker.java @@ -16,6 +16,8 @@ import java.util.List; import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBaker extends HypixelNPC { public NPCBaker() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBanker.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBanker.java index f2a32004b..375a93bb6 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBanker.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBanker.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBanker extends HypixelNPC { public NPCBanker() { super(new HumanConfiguration() { @@ -41,7 +43,7 @@ public boolean looking() { } @Override - public void onClick(HypixelNPC.NPCInteractEvent e) { + public void onClick(NPCInteractEvent e) { if (isInDialogue(e.player())) return; MissionData missionData = ((SkyBlockPlayer) e.player()).getMissionData(); diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBartender.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBartender.java index f76a37540..03cb34513 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBartender.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBartender.java @@ -11,6 +11,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBartender extends HypixelNPC { public NPCBartender() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBazaar.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBazaar.java index 27d1f301f..23c99d680 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBazaar.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBazaar.java @@ -12,6 +12,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBazaar extends HypixelNPC { public NPCBazaar() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBazaarAgent.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBazaarAgent.java index 39126ab39..ee04f2086 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBazaarAgent.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBazaarAgent.java @@ -12,6 +12,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBazaarAgent extends HypixelNPC { public NPCBazaarAgent() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBea.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBea.java index 9f34e958f..b7e92f841 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBea.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBea.java @@ -9,6 +9,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBea extends HypixelNPC { public NPCBea() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBiblio.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBiblio.java index e6e4227a1..9c9a355ee 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBiblio.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBiblio.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.hub.gui.GUIBiblio; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBiblio extends HypixelNPC { public NPCBiblio() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBillyJoe.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBillyJoe.java index 69ea4ef41..b6beb2f0a 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBillyJoe.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBillyJoe.java @@ -7,6 +7,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBillyJoe extends HypixelNPC { public NPCBillyJoe() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBobbyJoe.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBobbyJoe.java index ea51df53b..305f7d6b1 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBobbyJoe.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBobbyJoe.java @@ -7,6 +7,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBobbyJoe extends HypixelNPC { public NPCBobbyJoe() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBuilder.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBuilder.java index a98fe6922..5ba9f811e 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBuilder.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCBuilder.java @@ -3,12 +3,15 @@ import net.minestom.server.coordinate.Pos; import net.swofty.type.generic.data.datapoints.DatapointToggles; import net.swofty.type.generic.entity.npc.HypixelNPC; +import net.swofty.type.generic.entity.npc.NPCAbiphoneTrait; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.generic.user.HypixelPlayer; -import net.swofty.type.hub.gui.builder.GUIBuilder; +import net.swofty.type.skyblockgeneric.gui.inventories.builder.GUIBuilder; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; -public class NPCBuilder extends HypixelNPC { +import net.swofty.type.generic.event.custom.NPCInteractEvent; + +public class NPCBuilder extends HypixelNPC implements NPCAbiphoneTrait { public NPCBuilder() { super(new HumanConfiguration() { @@ -66,4 +69,8 @@ public DialogueSet[] dialogues(HypixelPlayer player) { }; } + @Override + public String getAbiphoneKey() { + return "builder"; + } } diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCCarpenter.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCCarpenter.java index 246eecfbe..ad25d9004 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCCarpenter.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCCarpenter.java @@ -11,6 +11,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCCarpenter extends HypixelNPC { public NPCCarpenter() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCChristopher.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCChristopher.java index 08ca1a474..69d006629 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCChristopher.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCChristopher.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCChristopher extends HypixelNPC { public NPCChristopher() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCClerkSeraphine.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCClerkSeraphine.java index fb2c1ade6..98fd92ad5 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCClerkSeraphine.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCClerkSeraphine.java @@ -7,6 +7,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCClerkSeraphine extends HypixelNPC { public NPCClerkSeraphine() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCCurator.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCCurator.java index 0ae0bf34f..d6bee3c35 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCCurator.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCCurator.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCCurator extends HypixelNPC { public NPCCurator() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCDusk.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCDusk.java index ba1bcac66..5c07f6cef 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCDusk.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCDusk.java @@ -7,6 +7,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCDusk extends HypixelNPC { public NPCDusk() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCElizabeth.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCElizabeth.java index 2968e3ebd..35beb2f4b 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCElizabeth.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCElizabeth.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCElizabeth extends HypixelNPC { public NPCElizabeth() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCErihann.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCErihann.java index 029c7f934..75aedca2b 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCErihann.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCErihann.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCErihann extends HypixelNPC { public NPCErihann() { @@ -39,7 +41,7 @@ public boolean looking() { } @Override - public void onClick(HypixelNPC.NPCInteractEvent e) { + public void onClick(NPCInteractEvent e) { e.player().sendMessage(Component.text("§cThis Feature is not there yet. §aOpen a Pull request HERE to get it added quickly!") .clickEvent(ClickEvent.openUrl("https://github.com/Swofty-Developments/HypixelSkyBlock"))); } diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFann.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFann.java index 59d09bf43..fe80b231d 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFann.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFann.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCFann extends HypixelNPC { public NPCFann() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFarmMerchant.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFarmMerchant.java index e9da78b0f..221cff98f 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFarmMerchant.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFarmMerchant.java @@ -8,6 +8,8 @@ import net.swofty.type.hub.gui.GUIShopFarmMerchant; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCFarmMerchant extends HypixelNPC { public NPCFarmMerchant() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFarmer.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFarmer.java index 2baa47431..b0bb953c4 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFarmer.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFarmer.java @@ -12,6 +12,8 @@ import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCFarmer extends HypixelNPC { public NPCFarmer() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFishMerchant.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFishMerchant.java index 3870bbf86..577761b2d 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFishMerchant.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFishMerchant.java @@ -8,6 +8,8 @@ import net.swofty.type.hub.gui.GUIShopFishMerchant; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCFishMerchant extends HypixelNPC { public NPCFishMerchant() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFisherman.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFisherman.java index a0ae5d433..cc1f8bd28 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFisherman.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCFisherman.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCFisherman extends HypixelNPC { public NPCFisherman() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGeorge.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGeorge.java index e3440acf7..ea0cb9ac3 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGeorge.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGeorge.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.hub.gui.GUIGeorge; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCGeorge extends HypixelNPC { public NPCGeorge() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGladiator.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGladiator.java index 741980fd5..258b052aa 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGladiator.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGladiator.java @@ -7,6 +7,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCGladiator extends HypixelNPC { public NPCGladiator() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGuy.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGuy.java index 337334883..e2a73f2d5 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGuy.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCGuy.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCGuy extends HypixelNPC { public NPCGuy() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCHubSelector.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCHubSelector.java index 903b34d72..0368300fb 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCHubSelector.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCHubSelector.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.hub.gui.GUIHubSelector; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCHubSelector extends HypixelNPC { public NPCHubSelector() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJacob.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJacob.java index 58ed51039..b5426a4c6 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJacob.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJacob.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCJacob extends HypixelNPC { public NPCJacob() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJacobus.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJacobus.java index 10c820577..de3c5aa61 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJacobus.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJacobus.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCJacobus extends HypixelNPC { public NPCJacobus() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJax.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJax.java index e9e8cfc09..05a9715c5 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJax.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJax.java @@ -11,6 +11,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCJax extends HypixelNPC { public NPCJax() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJimBob.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJimBob.java index 9765ff744..fb76995cf 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJimBob.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCJimBob.java @@ -7,6 +7,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCJimBob extends HypixelNPC { public NPCJimBob() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCKat.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCKat.java index 579e9de84..a86d316bd 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCKat.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCKat.java @@ -11,6 +11,8 @@ import net.swofty.type.skyblockgeneric.item.components.KatComponent; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCKat extends HypixelNPC { public NPCKat() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLonelyPhilosopher.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLonelyPhilosopher.java index eac06b75f..2e8fb594c 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLonelyPhilosopher.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLonelyPhilosopher.java @@ -11,6 +11,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCLonelyPhilosopher extends HypixelNPC { public NPCLonelyPhilosopher() { @@ -43,7 +45,7 @@ public boolean looking() { } @Override - public void onClick(HypixelNPC.NPCInteractEvent e) { + public void onClick(NPCInteractEvent e) { if (isInDialogue(e.player())) return; Rank rank = e.player().getDataHandler().get(HypixelDataHandler.Data.RANK, DatapointRank.class).getValue(); diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLucius.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLucius.java index 6d68f8b64..2142b42ed 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLucius.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLucius.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCLucius extends HypixelNPC { public NPCLucius() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLumberJack.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLumberJack.java index 7e5bac9ff..0312c984b 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLumberJack.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLumberJack.java @@ -12,6 +12,8 @@ import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCLumberJack extends HypixelNPC { public NPCLumberJack() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLumberMerchant.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLumberMerchant.java index 22b262065..3fc882f61 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLumberMerchant.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCLumberMerchant.java @@ -8,6 +8,8 @@ import net.swofty.type.hub.gui.GUIShopLumberMerchant; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCLumberMerchant extends HypixelNPC { public NPCLumberMerchant() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMadRedstoneEngineer.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMadRedstoneEngineer.java index b1610a8e5..c8126dbcf 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMadRedstoneEngineer.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMadRedstoneEngineer.java @@ -8,6 +8,8 @@ import net.swofty.type.hub.gui.GUIShopMadRedstoneEngineer; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMadRedstoneEngineer extends HypixelNPC { public NPCMadRedstoneEngineer() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMadameEleanorQGoldsworthIII.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMadameEleanorQGoldsworthIII.java index 6e5af5336..48b70c1d8 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMadameEleanorQGoldsworthIII.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMadameEleanorQGoldsworthIII.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMadameEleanorQGoldsworthIII extends HypixelNPC { public NPCMadameEleanorQGoldsworthIII() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMaddoxTheSlayer.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMaddoxTheSlayer.java index 6fc1b86ae..b2ebdf70b 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMaddoxTheSlayer.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMaddoxTheSlayer.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMaddoxTheSlayer extends HypixelNPC { public NPCMaddoxTheSlayer() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMalik.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMalik.java index 6897ec96d..5061fff71 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMalik.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMalik.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMalik extends HypixelNPC { public NPCMalik() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMarco.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMarco.java index 19736c859..73aecff53 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMarco.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMarco.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMarco extends HypixelNPC { public NPCMarco() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMaxwell.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMaxwell.java index 6f6cb56d2..7332be500 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMaxwell.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMaxwell.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.hub.gui.GUIMaxwell; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMaxwell extends HypixelNPC { public NPCMaxwell() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMineMerchant.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMineMerchant.java index 713c7dea1..3abdc2ac4 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMineMerchant.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMineMerchant.java @@ -8,6 +8,8 @@ import net.swofty.type.hub.gui.GUIShopMineMerchant; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMineMerchant extends HypixelNPC { public NPCMineMerchant() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMinikloon.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMinikloon.java index d24d39491..ad2463073 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMinikloon.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMinikloon.java @@ -7,6 +7,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMinikloon extends HypixelNPC { public NPCMinikloon() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMort.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMort.java index a82a8a848..468c51232 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMort.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMort.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMort extends HypixelNPC { public NPCMort() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMuseumDisplay.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMuseumDisplay.java index ac8f3c9ea..e518a6b90 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMuseumDisplay.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCMuseumDisplay.java @@ -13,6 +13,8 @@ import java.util.UUID; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMuseumDisplay extends HypixelNPC { public NPCMuseumDisplay() { super(new MuseumHumanConfiguration()); diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCNicole.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCNicole.java index 3316766e2..d41e219ed 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCNicole.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCNicole.java @@ -9,6 +9,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCNicole extends HypixelNPC { public NPCNicole() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCOphelia.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCOphelia.java index 0e6a3b6e5..fb9359f9c 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCOphelia.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCOphelia.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCOphelia extends HypixelNPC{ public NPCOphelia() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCOzanne.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCOzanne.java index ed95cc8fd..13421b420 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCOzanne.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCOzanne.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCOzanne extends HypixelNPC { public NPCOzanne() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCPat.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCPat.java index 7317d8dee..1d3a2fa6c 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCPat.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCPat.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.hub.gui.GUIShopPat; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCPat extends HypixelNPC { public NPCPat() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCRosetta.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCRosetta.java index 9c38fdb80..bbebd9936 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCRosetta.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCRosetta.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; import net.swofty.type.hub.gui.rosetta.GUIRosetta; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCRosetta extends HypixelNPC { public NPCRosetta() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSalesman.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSalesman.java index d1ecaa44e..b4cc4ff5b 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSalesman.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSalesman.java @@ -7,6 +7,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCSalesman extends HypixelNPC { public NPCSalesman() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCScoop.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCScoop.java index def4472b7..aa9d9c68f 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCScoop.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCScoop.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCScoop extends HypixelNPC { public NPCScoop() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSecuritySloth.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSecuritySloth.java index 5ab783c52..64aa12255 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSecuritySloth.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSecuritySloth.java @@ -9,6 +9,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCSecuritySloth extends HypixelNPC { public NPCSecuritySloth() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSeymour.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSeymour.java index 238e0d57b..0d8c90687 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSeymour.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSeymour.java @@ -8,6 +8,8 @@ import net.swofty.type.hub.gui.GUISeymour; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCSeymour extends HypixelNPC { public NPCSeymour() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCShania.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCShania.java index 5d0697562..9eea80cee 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCShania.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCShania.java @@ -6,6 +6,8 @@ import net.swofty.type.generic.entity.npc.configuration.AnimalConfiguration; import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCShania extends HypixelNPC { public NPCShania() { super(new AnimalConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSirius.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSirius.java index 01faf9f50..6cbcf5a5f 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSirius.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSirius.java @@ -12,6 +12,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCSirius extends HypixelNPC { private static final long MINIMUM_COINS = 400_000; @@ -59,7 +61,7 @@ public boolean looking() { } @Override - public void onClick(HypixelNPC.NPCInteractEvent e) { + public void onClick(NPCInteractEvent e) { if (isInDialogue(e.player())) return; SkyBlockPlayer player = (SkyBlockPlayer) e.player(); diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSwofty.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSwofty.java index 6909fd95b..c7dabec7d 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSwofty.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCSwofty.java @@ -7,6 +7,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCSwofty extends HypixelNPC { public NPCSwofty() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTaylor.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTaylor.java index 98f7fa7fa..4d1654b47 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTaylor.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTaylor.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCTaylor extends HypixelNPC { public NPCTaylor() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTheHandler.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTheHandler.java index 556e55a7f..da40cf5ae 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTheHandler.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTheHandler.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCTheHandler extends HypixelNPC { public NPCTheHandler() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTiaTheFairy.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTiaTheFairy.java index 0eb3e96ab..03842a2b7 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTiaTheFairy.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCTiaTheFairy.java @@ -9,6 +9,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCTiaTheFairy extends HypixelNPC { public NPCTiaTheFairy() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCUdium.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCUdium.java index fa9244110..df8d4a88f 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCUdium.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCUdium.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCUdium extends HypixelNPC { public NPCUdium() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWeaponsmith.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWeaponsmith.java index 117b513d9..049360ede 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWeaponsmith.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWeaponsmith.java @@ -8,6 +8,8 @@ import net.swofty.type.hub.gui.GUIShopWeaponsmith; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCWeaponsmith extends HypixelNPC { public NPCWeaponsmith() { super(new HumanConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWizard.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWizard.java index ff78414ed..797ce1151 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWizard.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWizard.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCWizard extends HypixelNPC { public NPCWizard() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWoolWeaver.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWoolWeaver.java index 0ccca9c71..4a9245d19 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWoolWeaver.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCWoolWeaver.java @@ -8,6 +8,8 @@ import net.swofty.type.hub.gui.GUIShopWoolWeaverVibrant; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCWoolWeaver extends HypixelNPC { public NPCWoolWeaver() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCZog.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCZog.java index b5e60b67d..0661eb731 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCZog.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/NPCZog.java @@ -8,6 +8,8 @@ import net.swofty.type.generic.user.HypixelPlayer; import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCZog extends HypixelNPC { public NPCZog() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerAndrew.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerAndrew.java index b4f4085da..0184278ee 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerAndrew.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerAndrew.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerAndrew extends HypixelNPC { public VillagerAndrew() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerApprentice.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerApprentice.java index 731fa0997..c0c157d15 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerApprentice.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerApprentice.java @@ -9,6 +9,8 @@ import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerApprentice extends HypixelNPC { public VillagerApprentice() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerBlacksmith.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerBlacksmith.java index fbac913a3..1584320b2 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerBlacksmith.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerBlacksmith.java @@ -14,6 +14,8 @@ import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerBlacksmith extends HypixelNPC { public VillagerBlacksmith() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerDuke.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerDuke.java index fd0e8b6e3..0f6098fb4 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerDuke.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerDuke.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerDuke extends HypixelNPC { public VillagerDuke() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerFelix.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerFelix.java index 073f6cad0..b9041e053 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerFelix.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerFelix.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerFelix extends HypixelNPC { public VillagerFelix() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerJack.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerJack.java index 0afb783cc..303a51437 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerJack.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerJack.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerJack extends HypixelNPC { public VillagerJack() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerJamie.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerJamie.java index cd40293c7..4f6580b0b 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerJamie.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerJamie.java @@ -11,6 +11,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerJamie extends HypixelNPC { public VillagerJamie() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLeo.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLeo.java index 1a9e6558a..ccd18b782 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLeo.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLeo.java @@ -12,6 +12,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerLeo extends HypixelNPC { public VillagerLeo() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLiam.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLiam.java index ea37207a9..d0c63d82a 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLiam.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLiam.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerLiam extends HypixelNPC { public VillagerLiam() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLibrarian.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLibrarian.java index 36b882729..af4560d0c 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLibrarian.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLibrarian.java @@ -11,6 +11,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerLibrarian extends HypixelNPC { public VillagerLibrarian() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLynn.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLynn.java index 8df630c12..a3fa03020 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLynn.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerLynn.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerLynn extends HypixelNPC { public VillagerLynn() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerMathsEnjoyer.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerMathsEnjoyer.java index f0720ef5d..bf250f004 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerMathsEnjoyer.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerMathsEnjoyer.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerMathsEnjoyer extends HypixelNPC { public VillagerMathsEnjoyer() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerPlumberJoe.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerPlumberJoe.java index 68dd6e81e..b4214263b 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerPlumberJoe.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerPlumberJoe.java @@ -9,6 +9,8 @@ import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerPlumberJoe extends HypixelNPC { public VillagerPlumberJoe() { super(new VillagerConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerRyu.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerRyu.java index c80fcbd19..f785af5de 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerRyu.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerRyu.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerRyu extends HypixelNPC { public VillagerRyu() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerSmithmonger.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerSmithmonger.java index d326ac8b2..d4aeef180 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerSmithmonger.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerSmithmonger.java @@ -8,6 +8,8 @@ import net.swofty.type.generic.entity.npc.configuration.VillagerConfiguration; import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerSmithmonger extends HypixelNPC { public VillagerSmithmonger() { super(new VillagerConfiguration() { diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerStella.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerStella.java index bc4d7ebd9..63320b806 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerStella.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerStella.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerStella extends HypixelNPC { public VillagerStella() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerTom.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerTom.java index 8058c353e..7ca26569c 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerTom.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerTom.java @@ -12,6 +12,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerTom extends HypixelNPC { public VillagerTom() { super(new VillagerConfiguration(){ diff --git a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerVex.java b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerVex.java index 2d2048ed5..4003f2e63 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerVex.java +++ b/type.hub/src/main/java/net/swofty/type/hub/npcs/villagers/VillagerVex.java @@ -10,6 +10,8 @@ import java.util.stream.Stream; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerVex extends HypixelNPC { public VillagerVex() { super(new VillagerConfiguration(){ diff --git a/type.prototypelobby/src/main/java/net/swofty/type/prototypelobby/npcs/NPCBedWars.java b/type.prototypelobby/src/main/java/net/swofty/type/prototypelobby/npcs/NPCBedWars.java index c678827ed..83bb1953f 100644 --- a/type.prototypelobby/src/main/java/net/swofty/type/prototypelobby/npcs/NPCBedWars.java +++ b/type.prototypelobby/src/main/java/net/swofty/type/prototypelobby/npcs/NPCBedWars.java @@ -12,6 +12,8 @@ import java.util.ArrayList; import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBedWars extends HypixelNPC { private static List cacheServers = new ArrayList<>(); private static long lastCacheTime = 0; diff --git a/type.prototypelobby/src/main/java/net/swofty/type/prototypelobby/npcs/NPCSkyBlock.java b/type.prototypelobby/src/main/java/net/swofty/type/prototypelobby/npcs/NPCSkyBlock.java index 21dce3084..8c00d0955 100644 --- a/type.prototypelobby/src/main/java/net/swofty/type/prototypelobby/npcs/NPCSkyBlock.java +++ b/type.prototypelobby/src/main/java/net/swofty/type/prototypelobby/npcs/NPCSkyBlock.java @@ -12,6 +12,8 @@ import java.util.ArrayList; import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCSkyBlock extends HypixelNPC { private static List cacheServers = new ArrayList<>(); private static long lastCacheTime = 0; diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/SkyBlockGenericLoader.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/SkyBlockGenericLoader.java index 3ea8ea003..69e45e07a 100644 --- a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/SkyBlockGenericLoader.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/SkyBlockGenericLoader.java @@ -31,6 +31,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.packet.HypixelPacketClientListener; import net.swofty.type.generic.packet.HypixelPacketServerListener; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneNPC; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneRegistry; import net.swofty.type.skyblockgeneric.block.attribute.BlockAttribute; import net.swofty.type.skyblockgeneric.block.placement.BlockPlacementManager; import net.swofty.type.skyblockgeneric.calendar.SkyBlockCalendar; @@ -176,6 +178,9 @@ public void initialize(MinecraftServer server) { .forEach(HypixelNPC::register); } + loopThroughPackage("net.swofty.type.skyblockgeneric.abiphone.impl", AbiphoneNPC.class) + .forEach(AbiphoneRegistry::registerContact); + // Register entities loopThroughPackage("net.swofty.type.skyblockgeneric.entity.mob.mobs", SkyBlockMob.class) .forEach(mob -> MobRegistry.registerExtraMob(mob.getClass())); diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/AbiphoneDialogueController.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/AbiphoneDialogueController.java new file mode 100644 index 000000000..80ecaa36b --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/AbiphoneDialogueController.java @@ -0,0 +1,98 @@ +package net.swofty.type.skyblockgeneric.abiphone; + +import net.minestom.server.MinecraftServer; +import net.minestom.server.timer.Scheduler; +import net.minestom.server.timer.TaskSchedule; +import net.swofty.type.generic.user.HypixelPlayer; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +public class AbiphoneDialogueController { + private final HashMap>> activeDialogues = new HashMap<>(); + private final AbiphoneNPC npc; + + public AbiphoneDialogueController(AbiphoneNPC npc) { + this.npc = npc; + } + + /** + * Checks if the player is currently in a dialogue with this NPC. + * + * @param player The player to check. + * @return True if the player is in dialogue, false otherwise. + */ + public boolean isInDialogue(HypixelPlayer player) { + return activeDialogues.containsKey(player); + } + + /** + * Starts a dialogue with the player using the specified dialogue key. + * + * @param player The player to start the dialogue with. + * @param key The key of the dialogue set to play. + * @return A CompletableFuture that completes when the dialogue finishes, with the dialogue key. + */ + public CompletableFuture setDialogue(HypixelPlayer player, String key) { + CompletableFuture future = new CompletableFuture<>(); + + AbiphoneNPC.DialogueSet[] dialogueSets = npc.dialogues(player); + for (AbiphoneNPC.DialogueSet dialogueSet : dialogueSets) { + if (dialogueSet.key().equals(key)) { + activeDialogues.put(player, Map.entry(dialogueSet, future)); + handleLineSendingLoop(player, dialogueSet); + return future; + } + } + + future.completeExceptionally(new NullPointerException("Dialogue set with key '" + key + "' not found.")); + return future; + } + + /** + * Removes the player from the dialogue, completing the future with null. + * + * @param player The player to remove from dialogue. + */ + public void cancelDialogue(HypixelPlayer player) { + Map.Entry> entry = activeDialogues.get(player); + if (entry != null) { + entry.getValue().complete(null); + activeDialogues.remove(player); + } + } + + private void handleLineSendingLoop(HypixelPlayer player, AbiphoneNPC.DialogueSet dialogueSet) { + npc.sendNPCMessage(player, dialogueSet.lines()[0]); + + String[] newLines = new String[dialogueSet.lines().length - 1]; + System.arraycopy(dialogueSet.lines(), 1, newLines, 0, dialogueSet.lines().length - 1); + + if (newLines.length == 0) { + Map.Entry> entry = activeDialogues.get(player); + if (entry != null) { + entry.getValue().complete(dialogueSet.key()); + } + activeDialogues.remove(player); + return; + } + + Scheduler scheduler = MinecraftServer.getSchedulerManager(); + scheduler.buildTask(() -> { + // Check if the player is still in dialogue (might have been canceled) + if (activeDialogues.containsKey(player)) { + handleLineSendingLoop(player, AbiphoneNPC.DialogueSet.builder() + .key(dialogueSet.key()) + .lines(newLines) + .build()); + } + }).delay(TaskSchedule.seconds(2)).schedule(); + } + + public static void removeAllDialogues(HypixelPlayer player) { + for (AbiphoneNPC npc : AbiphoneRegistry.getRegisteredContactNPCs()) { + npc.dialogue().cancelDialogue(player); + } + } +} diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/AbiphoneNPC.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/AbiphoneNPC.java new file mode 100644 index 000000000..947d5d563 --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/AbiphoneNPC.java @@ -0,0 +1,49 @@ +package net.swofty.type.skyblockgeneric.abiphone; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import net.minestom.server.item.ItemStack; +import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.skyblockgeneric.item.components.AbiphoneComponent; +import net.swofty.type.skyblockgeneric.item.updater.PlayerItemOrigin; +import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; + +@Getter +@AllArgsConstructor +public abstract class AbiphoneNPC { + private final String id; + private final String name; + private final String description; + private final AbiphoneDialogueController dialogueController = new AbiphoneDialogueController(this); + + public abstract void onCall(HypixelPlayer player); + + public void onAdd(SkyBlockPlayer player, int slot) { + player.updateItemInSlot(slot, (i) -> { + if (!i.hasComponent(AbiphoneComponent.class)) return; + i.getAttributeHandler().addAbiphoneNPC(this); + player.sendMessage("§b✆ " + getName() + " §fhas been added to your Abiphone's contacts!"); + }); + } + + protected AbiphoneDialogueController dialogue() { + return dialogueController; + } + + public DialogueSet[] dialogues(HypixelPlayer player) { + return DialogueSet.EMPTY; + } + + public abstract ItemStack.Builder getIcon(); + + public void sendNPCMessage(HypixelPlayer player, String message) { + player.sendMessage("§e[NPC] " + getName() + "§f: §b✆ §f" + message); + } + + @Builder + public record DialogueSet(String key, String[] lines, boolean abiPhone) { + public static final DialogueSet[] EMPTY = new DialogueSet[0]; + } + +} diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/AbiphoneRegistry.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/AbiphoneRegistry.java new file mode 100644 index 000000000..a7d704ce3 --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/AbiphoneRegistry.java @@ -0,0 +1,26 @@ +package net.swofty.type.skyblockgeneric.abiphone; + +import lombok.Getter; + +import java.util.ArrayList; +import java.util.List; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneNPC; + +public class AbiphoneRegistry { + @Getter + private static final List registeredContactNPCs = new ArrayList<>(); + + public static void registerContact(AbiphoneNPC npc) { + registeredContactNPCs.add(npc); + } + + public static AbiphoneNPC getFromId(String id) { + for (AbiphoneNPC npc : registeredContactNPCs) { + if (npc.getId().equalsIgnoreCase(id)) { + return npc; + } + } + return null; + } + +} diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneAlda.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneAlda.java new file mode 100644 index 000000000..ed6263a12 --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneAlda.java @@ -0,0 +1,25 @@ +package net.swofty.type.skyblockgeneric.abiphone.impl; + +import net.minestom.server.item.ItemStack; +import net.swofty.type.generic.gui.inventory.ItemStackCreator; +import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneNPC; +import net.swofty.type.skyblockgeneric.gui.inventories.shop.GUIShopAlda; + +public class AbiphoneAlda extends AbiphoneNPC { + + public AbiphoneAlda() { + super("alda", "§6Alda", "Sells §aAbiphones §7for beginners."); + } + + @Override + public void onCall(HypixelPlayer player) { + new GUIShopAlda().open(player); + } + + @Override + public ItemStack.Builder getIcon() { + return ItemStackCreator.getStackHead("db5647f93fd8e1da9cdb151dd9bdf4f48bb59a1d11748f1918c136c86804b2"); + } +} + diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneBuilder.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneBuilder.java new file mode 100644 index 000000000..63556df93 --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneBuilder.java @@ -0,0 +1,86 @@ +package net.swofty.type.skyblockgeneric.abiphone.impl; + +import net.kyori.adventure.text.format.NamedTextColor; +import net.minestom.server.item.ItemStack; +import net.minestom.server.item.Material; +import net.swofty.commons.skyblock.item.ItemType; +import net.swofty.type.generic.data.datapoints.DatapointToggles; +import net.swofty.type.generic.entity.npc.NPCOption; +import net.swofty.type.generic.gui.inventory.ItemStackCreator; +import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneNPC; +import net.swofty.type.skyblockgeneric.gui.inventories.builder.GUIBuilder; +import net.swofty.type.skyblockgeneric.item.SkyBlockItem; +import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; + +import java.util.Collections; + +public class AbiphoneBuilder extends AbiphoneNPC { + + public AbiphoneBuilder() { + super("builder", "Builder", "Need to build? Call him."); + } + + @Override + public void onCall(HypixelPlayer player) { + new GUIBuilder().open(player); + } + + @Override + public void onAdd(SkyBlockPlayer player, int slot) { + if (!player.getToggles().get(DatapointToggles.Toggles.ToggleType.HAS_GIVEN_BUILDER_BUILDERS_WAND)) { + if (dialogue().isInDialogue(player)) return; + dialogue().setDialogue(player, "abiphone").thenRun(() -> { + NPCOption.sendOption(player, "builder", Collections.singletonList(new NPCOption.Option( + "pay", + NamedTextColor.GREEN, + "GIVE ITEM", + (p) -> { + SkyBlockPlayer sp = (SkyBlockPlayer) p; + for (int i = 0; i < sp.getInventory().getSize(); i++) { + ItemStack item = sp.getInventory().getItemStack(i); + if (new SkyBlockItem(item).getItemType() == ItemType.BUILDERS_WAND) { + sp.getInventory().setItemStack(i, ItemStack.of(Material.AIR)); + dialogue().setDialogue(player, "donate").thenRun(() -> { + player.getToggles().set(DatapointToggles.Toggles.ToggleType.HAS_GIVEN_BUILDER_BUILDERS_WAND, true); + super.onAdd(player, slot); + }); + return; + } + } + dialogue().setDialogue(player, "donate_no_requirements"); + + } + ))); + }); + return; + } + super.onAdd(player, slot); + } + + @Override + public DialogueSet[] dialogues(HypixelPlayer player) { + return new DialogueSet[]{ + DialogueSet.builder() + .key("abiphone").lines(new String[]{ + "Oh?", + "Yes... I could give you my contact... However, may I ask a favor in return?", + "For a builder to not have a §6Builder's Wand §fis quite uncommon.", + " If you give me one I'll gladly give you my contact!" + }).build(), + DialogueSet.builder() + .key("donate").lines(new String[]{ + "A §6Builder's Wand§f! This is a dream come true!" + }).build(), + DialogueSet.builder() + .key("donate_no_requirements").lines(new String[]{ + "You don't have what I need! Nice try!", + }).build() + }; + } + + @Override + public ItemStack.Builder getIcon() { + return ItemStackCreator.getStackHead("c8ccd4fdf58b30aa83017cfa5fed977196c024c8d1a276004e9068e8ecbb0b79"); + } +} diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneRusty.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneRusty.java new file mode 100644 index 000000000..5b7fffc5e --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneRusty.java @@ -0,0 +1,58 @@ +package net.swofty.type.skyblockgeneric.abiphone.impl; + +import net.minestom.server.item.ItemStack; +import net.minestom.server.item.Material; +import net.swofty.type.generic.data.datapoints.DatapointToggles; +import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneNPC; +import net.swofty.type.skyblockgeneric.gui.inventories.rusty.GUIRusty; +import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; + +public class AbiphoneRusty extends AbiphoneNPC { + + public AbiphoneRusty() { + super("rusty", "Rusty", "SkyBlock's Janitor"); + } + + @Override + public void onAdd(SkyBlockPlayer player, int slot) { + if (!player.getToggles().get(DatapointToggles.Toggles.ToggleType.HAS_SPOKEN_TO_RUSTY_ABOUT_ABIPHONE)) { + if (dialogue().isInDialogue(player)) return; + dialogue().setDialogue(player, "abiphone").thenRun(() -> { + player.getToggles().set(DatapointToggles.Toggles.ToggleType.HAS_SPOKEN_TO_RUSTY_ABOUT_ABIPHONE, true); + super.onAdd(player, slot); + }); + return; + } + super.onAdd(player, slot); + } + + @Override + public void onCall(HypixelPlayer player) { + new GUIRusty().open(player); + } + + @Override + public ItemStack.Builder getIcon() { + return ItemStack.builder(Material.VILLAGER_SPAWN_EGG); + } + + @Override + public DialogueSet[] dialogues(HypixelPlayer player) { + return new DialogueSet[]{ + DialogueSet.builder() + .key("abiphone").lines(new String[]{ + "§fDid I find an Abiphone?", + "§fYes, sometimes I do find one lying around.", + "§fWhat?", + "§fYou?", + "§fYou want my contact?", + "§fMe?", + "§fThe janitor?", + "§fI...", + "§fI don't... don't know what to say...", + "§fYes of course you can have it!", + }).build() + }; + } +} diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneWalter.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneWalter.java new file mode 100644 index 000000000..e9ecf2bad --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/abiphone/impl/AbiphoneWalter.java @@ -0,0 +1,73 @@ +package net.swofty.type.skyblockgeneric.abiphone.impl; + +import net.kyori.adventure.text.format.NamedTextColor; +import net.minestom.server.item.ItemStack; +import net.swofty.type.generic.data.datapoints.DatapointToggles; +import net.swofty.type.generic.entity.npc.NPCOption; +import net.swofty.type.generic.gui.inventory.ItemStackCreator; +import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneNPC; +import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; + +import java.util.Collections; + +public class AbiphoneWalter extends AbiphoneNPC { + + public AbiphoneWalter() { + super("walter", "Walter", "Sells Superboom TNT."); + } + + @Override + public void onCall(HypixelPlayer player) { + + } + + @Override + public void onAdd(SkyBlockPlayer player, int slot) { + if (!player.getToggles().get(DatapointToggles.Toggles.ToggleType.HAS_GIVEN_WALTER_CUBE)) { + if (dialogue().isInDialogue(player)) return; + dialogue().setDialogue(player, "abiphone").thenRun(() -> { + NPCOption.sendOption(player, "walter", Collections.singletonList(new NPCOption.Option( + "pay", // actual id from Hypixel + NamedTextColor.GREEN, + "DONATE CUBE", + (p) -> { + // TODO: check requirements + dialogue().setDialogue(player, "donate_cube_no_requirements"); + // player.getToggles().set(DatapointToggles.Toggles.ToggleType.HAS_GIVEN_WALTER_CUBE, true); + // super.onAdd(player, slot); + } + ))); + }); + return; + } + super.onAdd(player, slot); + } + + @Override + public DialogueSet[] dialogues(HypixelPlayer player) { + return new DialogueSet[]{ + DialogueSet.builder() + .key("abiphone").lines(new String[]{ // when clicking with an Abiphone + "My abiphone is for Platinum-level donors of the Walter cause only.", + "You know these superbooms don't craft themselves right?", + "You just need §3Sulphur Collection 7 §fand to then donate an Enchanted Sulphur Cube!", // then show "donate cube" option + }).build(), + DialogueSet.builder() + .key("donate_cube").lines(new String[]{ // when donating the cube with requirements met + "Welcome to the Platinum club, high roller!", + "Call me anytime!", + "And before you ask... yes, I do try to commercialize all of my friendships.", + }).build(), + DialogueSet.builder() + .key("donate_cube_no_requirements").lines(new String[]{ // when donating the cube without requirements met + "Mmh... you're missing something to become a Platinum-level donor...", + }).build() + }; + } + + @Override + public ItemStack.Builder getIcon() { + return ItemStackCreator.getStackHead("43ac21b653a27632dbc8373c6e6fba5b8c97b7ecbfef2d793630d149b116ba81"); + } +} diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/event/actions/npc/ActionPlayerInteractNPC.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/event/actions/npc/ActionPlayerInteractNPC.java new file mode 100644 index 000000000..9f07edc12 --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/event/actions/npc/ActionPlayerInteractNPC.java @@ -0,0 +1,44 @@ +package net.swofty.type.skyblockgeneric.event.actions.npc; + +import net.swofty.type.generic.entity.npc.HypixelNPC; +import net.swofty.type.generic.entity.npc.NPCAbiphoneTrait; +import net.swofty.type.generic.event.EventNodes; +import net.swofty.type.generic.event.HypixelEvent; +import net.swofty.type.generic.event.HypixelEventClass; +import net.swofty.type.generic.event.custom.NPCInteractEvent; +import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneNPC; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneRegistry; +import net.swofty.type.skyblockgeneric.item.SkyBlockItem; +import net.swofty.type.skyblockgeneric.item.components.AbiphoneComponent; +import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; +import org.tinylog.Logger; + +public class ActionPlayerInteractNPC implements HypixelEventClass { + + @HypixelEvent(node = EventNodes.CUSTOM, requireDataLoaded = false) + public void run(NPCInteractEvent event) { + final SkyBlockPlayer player = (SkyBlockPlayer) event.getPlayer(); + HypixelNPC npc = event.getNpc(); + SkyBlockItem item = new SkyBlockItem(player.getItemInMainHand()); + if (item.hasComponent(AbiphoneComponent.class)) { + if (!(npc instanceof NPCAbiphoneTrait trait)) { + player.sendMessage("§7[§b✆§7] §7This NPC doesn't own an Abiphone..."); + event.setCancelled(true); + return; + } + AbiphoneNPC abiphoneNPC = AbiphoneRegistry.getFromId(trait.getAbiphoneKey()); + if (abiphoneNPC != null) { + if (item.getAttributeHandler().hasAbiphoneNPC(abiphoneNPC)) { + player.sendMessage("§7[§b✆§7] §7This NPC is already in your contacts list!"); + return; + } + abiphoneNPC.onAdd(player, player.getHeldSlot()); + } else { + Logger.warn("NPC " + npc.getClass().getName() + " has an invalid Abiphone key: " + trait.getAbiphoneKey()); + } + event.setCancelled(true); + } + } + +} diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/abiphone/GUIAbiphone.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/abiphone/GUIAbiphone.java new file mode 100644 index 000000000..cbfee9997 --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/abiphone/GUIAbiphone.java @@ -0,0 +1,169 @@ +package net.swofty.type.skyblockgeneric.gui.inventories.abiphone; + +import lombok.Setter; +import net.kyori.adventure.text.Component; +import net.minestom.server.MinecraftServer; +import net.minestom.server.component.DataComponents; +import net.minestom.server.event.inventory.InventoryPreClickEvent; +import net.minestom.server.inventory.InventoryType; +import net.minestom.server.inventory.click.Click; +import net.minestom.server.item.ItemStack; +import net.minestom.server.item.Material; +import net.minestom.server.timer.TaskSchedule; +import net.swofty.type.generic.gui.inventory.HypixelPaginatedGUI; +import net.swofty.type.generic.gui.inventory.ItemStackCreator; +import net.swofty.type.generic.gui.inventory.item.GUIClickableItem; +import net.swofty.type.generic.gui.inventory.item.GUIItem; +import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.utility.PaginationList; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneNPC; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneRegistry; +import net.swofty.type.skyblockgeneric.item.SkyBlockItem; + +import java.util.List; + +public class GUIAbiphone extends HypixelPaginatedGUI { + @Setter + private SortType sortType = SortType.ALPHABETICAL; + private final SkyBlockItem abiphone; + + public GUIAbiphone(SkyBlockItem abiphone) { + super(InventoryType.CHEST_6_ROW); + this.abiphone = abiphone; + } + + @Override + protected int[] getPaginatedSlots() { + return new int[]{ + 10, 11, 12, 13, 14, 15, 16, + 19, 20, 21, 22, 23, 24, 25, + 28, 29, 30, 31, 32, 33, 34, + 37, 38, 39, 40, 41, 42, 43 + }; + } + + @Override + protected PaginationList fillPaged(HypixelPlayer player, PaginationList paged) { + paged.addAll(abiphone.getAttributeHandler().getAbiphoneNPCs()); + return paged; + } + + @Override + protected boolean shouldFilterFromSearch(String query, AbiphoneNPC item) { + return false; + } + + @Override + protected void performSearch(HypixelPlayer player, String query, int page, int maxPage) { + border(FILLER_ITEM); + List contacts = abiphone.getAttributeHandler().getAbiphoneNPCs(); + + set(GUIClickableItem.getCloseItem(49)); + set(new GUIItem(50) { + @Override + public ItemStack.Builder getItem(HypixelPlayer player) { + return ItemStackCreator.getStack( + "§aSort §bTO-DO", + Material.HOPPER, + 1, + "", + "§7 First Added", + "§7 Alphabetical", + "§7 Last Called", + "§7 Most Called", + "§7 Do Not Disturb First", + "", + "§bRight-click to go backwards!", + "§eClick to switch!" + ); + } + }); + set(new GUIItem(51) { + @Override + public ItemStack.Builder getItem(HypixelPlayer player) { + return ItemStackCreator.getStack( + "§aContacts Directory §bTO-DO", + Material.BOOK, + 1, + "§7Browse through all NPCs in SkyBlock", + "§7which both own an Abiphone AND are", + "§7willing to add you as a contact.", + "", + "§7Your contacts: §a" + contacts.size() + "§b/" + AbiphoneRegistry.getRegisteredContactNPCs().size(), + "", + "§eClick to view contacts!" + ); + } + }); + + if (page > 1) { + set(createNavigationButton(this, 45, query, page, false)); + } + if (page < maxPage) { + set(createNavigationButton(this, 53, query, page, true)); + } + } + + @Override + protected String getTitle(HypixelPlayer player, String query, int page, PaginationList paged) { + return abiphone.getCleanName(); + } + + @Override + protected GUIClickableItem createItemFor(AbiphoneNPC npc, int slot, HypixelPlayer player) { + return new GUIClickableItem(slot) { + @Override + public void run(InventoryPreClickEvent e, HypixelPlayer player) { + Click click = e.getClick(); + if (click instanceof Click.Left) { + player.closeInventory(); + player.sendMessage(Component.text("§e✆ RING...")); + MinecraftServer.getSchedulerManager().buildTask(() -> { + player.sendMessage(Component.text("§e✆ RING... RING...")); + MinecraftServer.getSchedulerManager().buildTask(() -> { + player.sendMessage(Component.text("§e✆ RING... RING... RING...")); + MinecraftServer.getSchedulerManager().buildTask(() -> { + npc.onCall(player); + }).delay(TaskSchedule.seconds(1)).schedule(); + }).delay(TaskSchedule.seconds(1)).schedule(); + }).delay(TaskSchedule.seconds(1)).schedule(); + } else if (click instanceof Click.Right) { + new GUIContactManagement(abiphone, npc).open(player); + } + } + + @Override + public ItemStack.Builder getItem(HypixelPlayer player) { + return ItemStackCreator.updateLore( + npc.getIcon().set(DataComponents.CUSTOM_NAME, Component.text("§f" + npc.getName())), + List.of( + "§7" + npc.getDescription(), + "", + "§8Right-click to manage!", + "§eLeft-click to call!" + ) + ); + } + + }; + } + + @Override + public boolean allowHotkeying() { + return false; + } + + @Override + public void onBottomClick(InventoryPreClickEvent e) { + e.setCancelled(true); + } + + public enum SortType { + FIRST_ADDED, + ALPHABETICAL, + LAST_CALLED, + MOST_CALLED, + DO_NOT_DISTURB_FIRST + } +} + diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/abiphone/GUIConfirmAbiphone.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/abiphone/GUIConfirmAbiphone.java new file mode 100644 index 000000000..b7d4d3223 --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/abiphone/GUIConfirmAbiphone.java @@ -0,0 +1,60 @@ +package net.swofty.type.skyblockgeneric.gui.inventories.abiphone; + +import net.minestom.server.event.inventory.InventoryPreClickEvent; +import net.minestom.server.inventory.InventoryType; +import net.minestom.server.item.ItemStack; +import net.minestom.server.item.Material; +import net.swofty.type.generic.gui.inventory.HypixelInventoryGUI; +import net.swofty.type.generic.gui.inventory.ItemStackCreator; +import net.swofty.type.generic.gui.inventory.item.GUIClickableItem; +import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneNPC; + +public class GUIConfirmAbiphone extends HypixelInventoryGUI { + + private final AbiphoneNPC npc; + private final Runnable onAccept; + + public GUIConfirmAbiphone(AbiphoneNPC npc, Runnable onAccept) { + super("Confirm", InventoryType.CHEST_3_ROW); + this.npc = npc; + this.onAccept = onAccept; + } + + @Override + public void onOpen(InventoryGUIOpenEvent e) { + set(new GUIClickableItem(11) { + @Override + public void run(InventoryPreClickEvent e, HypixelPlayer player) { + onAccept.run(); + } + + @Override + public ItemStack.Builder getItem(HypixelPlayer player) { + return ItemStackCreator.getStack("§aConfirm", Material.GREEN_TERRACOTTA, 1, "§eClick to remove " + npc.getName(), "§efrom your", "contacts!"); + } + }); + set(new GUIClickableItem(15) { + @Override + public void run(InventoryPreClickEvent e, HypixelPlayer player) { + player.closeInventory(); + } + + @Override + public ItemStack.Builder getItem(HypixelPlayer player) { + return ItemStackCreator.createNamedItemStack(Material.RED_TERRACOTTA, "§cCancel"); + } + }); + updateItemStacks(getInventory(), getPlayer()); + } + + @Override + public boolean allowHotkeying() { + return false; + } + + @Override + public void onBottomClick(InventoryPreClickEvent e) { + + } +} diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/abiphone/GUIContactManagement.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/abiphone/GUIContactManagement.java new file mode 100644 index 000000000..1e9f8d0c2 --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/abiphone/GUIContactManagement.java @@ -0,0 +1,77 @@ +package net.swofty.type.skyblockgeneric.gui.inventories.abiphone; + +import net.kyori.adventure.text.Component; +import net.minestom.server.component.DataComponents; +import net.minestom.server.event.inventory.InventoryPreClickEvent; +import net.minestom.server.inventory.InventoryType; +import net.minestom.server.inventory.click.Click; +import net.minestom.server.item.ItemStack; +import net.minestom.server.item.Material; +import net.swofty.type.generic.gui.inventory.HypixelInventoryGUI; +import net.swofty.type.generic.gui.inventory.ItemStackCreator; +import net.swofty.type.generic.gui.inventory.item.GUIClickableItem; +import net.swofty.type.generic.gui.inventory.item.GUIItem; +import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneNPC; +import net.swofty.type.skyblockgeneric.item.SkyBlockItem; + +import java.util.List; + +public class GUIContactManagement extends HypixelInventoryGUI { + + private final SkyBlockItem abiphone; + private final AbiphoneNPC npc; + + public GUIContactManagement(SkyBlockItem abiphone, AbiphoneNPC npc) { + super("Contact Management", InventoryType.CHEST_6_ROW); + this.abiphone = abiphone; + this.npc = npc; + } + + @Override + public void onOpen(InventoryGUIOpenEvent e) { + fill(FILLER_ITEM); + + set(new GUIItem(4) { + @Override + public ItemStack.Builder getItem(HypixelPlayer player) { + return ItemStackCreator.updateLore( + npc.getIcon().set(DataComponents.CUSTOM_NAME, Component.text("§f" + npc.getName())), + List.of("§7" + npc.getDescription()) + ); + } + }); + + set(new GUIClickableItem(31) { + @Override + public void run(InventoryPreClickEvent e, HypixelPlayer player) { + new GUIConfirmAbiphone(npc, () -> { + abiphone.getAttributeHandler().removeAbiphoneNPC(npc); + player.closeInventory(); + new GUIAbiphone(abiphone).open(player); + player.sendMessage("§c✆ Removed " + npc.getName() + " §cfrom your contacts!"); + }).open(player); + } + + @Override + public ItemStack.Builder getItem(HypixelPlayer player) { + return ItemStackCreator.getStack("§cRemove Contact", Material.FEATHER, 1, List.of("§7In case you're no longer friends, or", "§7whatever other reason.", " ", "§eClick to remove!")); + } + }); + + GUIClickableItem.getGoBackItem(48, new GUIAbiphone(abiphone)); + GUIClickableItem.getCloseItem(49); + updateItemStacks(getInventory(), getPlayer()); + } + + @Override + public boolean allowHotkeying() { + return false; + } + + @Override + public void onBottomClick(InventoryPreClickEvent e) { + + } +} + diff --git a/type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIBuilder.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIBuilder.java similarity index 86% rename from type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIBuilder.java rename to type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIBuilder.java index 3938c3393..85c7773f4 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIBuilder.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIBuilder.java @@ -1,4 +1,4 @@ -package net.swofty.type.hub.gui.builder; +package net.swofty.type.skyblockgeneric.gui.inventories.builder; import net.minestom.server.event.inventory.InventoryCloseEvent; import net.minestom.server.event.inventory.InventoryPreClickEvent; @@ -22,26 +22,26 @@ public void onOpen(InventoryGUIOpenEvent e) { set(new GUIClickableItem(10) { @Override public void run(InventoryPreClickEvent e, HypixelPlayer p) { - SkyBlockPlayer player = (SkyBlockPlayer) p; + SkyBlockPlayer player = (SkyBlockPlayer) p; new GUIShopBuilderWoodworking().open(player); } @Override public ItemStack.Builder getItem(HypixelPlayer p) { - SkyBlockPlayer player = (SkyBlockPlayer) p; + SkyBlockPlayer player = (SkyBlockPlayer) p; return ItemStackCreator.getStack("§aWoodworking", Material.OAK_PLANKS, 1, "§7Wood-related blocks!"); } }); set(new GUIClickableItem(12) { @Override public void run(InventoryPreClickEvent e, HypixelPlayer p) { - SkyBlockPlayer player = (SkyBlockPlayer) p; + SkyBlockPlayer player = (SkyBlockPlayer) p; new GUIShopBuilderRocksBricks().open(player); } @Override public ItemStack.Builder getItem(HypixelPlayer p) { - SkyBlockPlayer player = (SkyBlockPlayer) p; + SkyBlockPlayer player = (SkyBlockPlayer) p; return ItemStackCreator.getStack("§aRocks & Bricks", Material.STONE, 1, "§7Rocks, stones, sands and brick", "§7blocks."); @@ -50,13 +50,13 @@ public ItemStack.Builder getItem(HypixelPlayer p) { set(new GUIClickableItem(14) { @Override public void run(InventoryPreClickEvent e, HypixelPlayer p) { - SkyBlockPlayer player = (SkyBlockPlayer) p; + SkyBlockPlayer player = (SkyBlockPlayer) p; new GUIShopBuilderGreenThumb().open(player); } @Override public ItemStack.Builder getItem(HypixelPlayer p) { - SkyBlockPlayer player = (SkyBlockPlayer) p; + SkyBlockPlayer player = (SkyBlockPlayer) p; return ItemStackCreator.getStack("§aGreen Thumb", Material.ROSE_BUSH, 1, "§7Everything you need to grow a", "§7nice garden."); @@ -65,13 +65,13 @@ public ItemStack.Builder getItem(HypixelPlayer p) { set(new GUIClickableItem(16) { @Override public void run(InventoryPreClickEvent e, HypixelPlayer p) { - SkyBlockPlayer player = (SkyBlockPlayer) p; + SkyBlockPlayer player = (SkyBlockPlayer) p; new GUIShopBuilderVariety().open(player); } @Override public ItemStack.Builder getItem(HypixelPlayer p) { - SkyBlockPlayer player = (SkyBlockPlayer) p; + SkyBlockPlayer player = (SkyBlockPlayer) p; return ItemStackCreator.getStackHead("§aVariety", "3c2d8e8ec2737b599a48fc07ea58b806969e6021802019992dda32a653794df6", 1, "§7Weird blocks and an assortment", "§7of decorative fruits."); diff --git a/type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderGreenThumb.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderGreenThumb.java similarity index 98% rename from type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderGreenThumb.java rename to type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderGreenThumb.java index e67f0f92f..f7e5e2e87 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderGreenThumb.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderGreenThumb.java @@ -1,4 +1,4 @@ -package net.swofty.type.hub.gui.builder; +package net.swofty.type.skyblockgeneric.gui.inventories.builder; import net.swofty.commons.skyblock.item.ItemType; import net.swofty.type.skyblockgeneric.gui.SkyBlockShopGUI; diff --git a/type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderRocksBricks.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderRocksBricks.java similarity index 98% rename from type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderRocksBricks.java rename to type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderRocksBricks.java index 74d22c8c3..59c3f4e50 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderRocksBricks.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderRocksBricks.java @@ -1,4 +1,4 @@ -package net.swofty.type.hub.gui.builder; +package net.swofty.type.skyblockgeneric.gui.inventories.builder; import net.swofty.commons.skyblock.item.ItemType; import net.swofty.type.skyblockgeneric.gui.SkyBlockShopGUI; diff --git a/type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderVariety.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderVariety.java similarity index 98% rename from type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderVariety.java rename to type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderVariety.java index 1ff1d8bdf..6343e8f91 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderVariety.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderVariety.java @@ -1,4 +1,4 @@ -package net.swofty.type.hub.gui.builder; +package net.swofty.type.skyblockgeneric.gui.inventories.builder; import net.swofty.commons.skyblock.item.ItemType; import net.swofty.type.skyblockgeneric.gui.SkyBlockShopGUI; diff --git a/type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderWoodworking.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderWoodworking.java similarity index 98% rename from type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderWoodworking.java rename to type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderWoodworking.java index 54e0b5f1f..b87f4fb53 100644 --- a/type.hub/src/main/java/net/swofty/type/hub/gui/builder/GUIShopBuilderWoodworking.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/builder/GUIShopBuilderWoodworking.java @@ -1,4 +1,4 @@ -package net.swofty.type.hub.gui.builder; +package net.swofty.type.skyblockgeneric.gui.inventories.builder; import net.swofty.commons.skyblock.item.ItemType; import net.swofty.type.skyblockgeneric.gui.SkyBlockShopGUI; diff --git a/type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRusty.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRusty.java similarity index 98% rename from type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRusty.java rename to type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRusty.java index 2a6a7f2a9..6eb3a097b 100644 --- a/type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRusty.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRusty.java @@ -1,4 +1,4 @@ -package net.swofty.type.goldmine.gui.rusty; +package net.swofty.type.skyblockgeneric.gui.inventories.rusty; import net.minestom.server.event.inventory.InventoryPreClickEvent; import net.minestom.server.inventory.InventoryType; diff --git a/type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyAccessories.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyAccessories.java similarity index 99% rename from type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyAccessories.java rename to type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyAccessories.java index 8304b46ac..98502f5fc 100644 --- a/type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyAccessories.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyAccessories.java @@ -1,4 +1,4 @@ -package net.swofty.type.goldmine.gui.rusty; +package net.swofty.type.skyblockgeneric.gui.inventories.rusty; import net.minestom.server.component.DataComponents; import net.minestom.server.event.inventory.InventoryPreClickEvent; diff --git a/type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyMiscellaneous.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyMiscellaneous.java similarity index 99% rename from type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyMiscellaneous.java rename to type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyMiscellaneous.java index a486bf13c..5aa16fa94 100644 --- a/type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyMiscellaneous.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyMiscellaneous.java @@ -1,4 +1,4 @@ -package net.swofty.type.goldmine.gui.rusty; +package net.swofty.type.skyblockgeneric.gui.inventories.rusty; import net.minestom.server.component.DataComponents; import net.minestom.server.event.inventory.InventoryPreClickEvent; diff --git a/type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyPetsAndPetItems.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyPetsAndPetItems.java similarity index 99% rename from type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyPetsAndPetItems.java rename to type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyPetsAndPetItems.java index 66e3e7196..c938c7d6e 100644 --- a/type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyPetsAndPetItems.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyPetsAndPetItems.java @@ -1,4 +1,4 @@ -package net.swofty.type.goldmine.gui.rusty; +package net.swofty.type.skyblockgeneric.gui.inventories.rusty; import net.minestom.server.component.DataComponents; import net.minestom.server.event.inventory.InventoryPreClickEvent; diff --git a/type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyWeaponsAndGear.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyWeaponsAndGear.java similarity index 99% rename from type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyWeaponsAndGear.java rename to type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyWeaponsAndGear.java index 4d7303928..9acbd0e82 100644 --- a/type.goldmine/src/main/java/net/swofty/type/goldmine/gui/rusty/GUIRustyWeaponsAndGear.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/rusty/GUIRustyWeaponsAndGear.java @@ -1,4 +1,4 @@ -package net.swofty.type.goldmine.gui.rusty; +package net.swofty.type.skyblockgeneric.gui.inventories.rusty; import net.minestom.server.component.DataComponents; import net.minestom.server.event.inventory.InventoryPreClickEvent; diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/shop/GUIShopAlda.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/shop/GUIShopAlda.java new file mode 100644 index 000000000..e0255ba7f --- /dev/null +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/shop/GUIShopAlda.java @@ -0,0 +1,17 @@ +package net.swofty.type.skyblockgeneric.gui.inventories.shop; + +import net.swofty.commons.skyblock.item.ItemType; +import net.swofty.type.skyblockgeneric.gui.SkyBlockShopGUI; +import net.swofty.type.skyblockgeneric.item.SkyBlockItem; +import net.swofty.type.skyblockgeneric.shop.type.CoinShopPrice; + +public class GUIShopAlda extends SkyBlockShopGUI { + public GUIShopAlda() { + super("Alda", 1, SINGLE_SLOT); + } + + @Override + public void initializeShopItems() { + attachItem(ShopItem.Single(new SkyBlockItem(ItemType.ABIPHONE_BASIC), 1, new CoinShopPrice(100000))); + } +} diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/ItemAttributeHandler.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/ItemAttributeHandler.java index 979e46e65..1b1eccbb7 100644 --- a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/ItemAttributeHandler.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/ItemAttributeHandler.java @@ -11,6 +11,8 @@ import net.swofty.commons.protocol.objects.itemtracker.TrackedItemUpdateProtocolObject; import net.swofty.commons.skyblock.statistics.ItemStatistics; import net.swofty.proxyapi.ProxyService; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneNPC; +import net.swofty.type.skyblockgeneric.abiphone.AbiphoneRegistry; import net.swofty.type.skyblockgeneric.enchantment.EnchantmentType; import net.swofty.type.skyblockgeneric.enchantment.SkyBlockEnchantment; import net.swofty.type.skyblockgeneric.item.components.*; @@ -18,6 +20,9 @@ import net.swofty.type.skyblockgeneric.user.SkyBlockPlayer; import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; import java.util.UUID; import java.util.concurrent.CompletableFuture; import java.util.stream.Stream; @@ -379,6 +384,44 @@ public void setDarkAuctionPrice(long price) { ((ItemAttributeDarkAuctionPrice) item.getAttribute("dark_auction_price")).setValue(price); } + public List getAbiphoneNPCs() { + return ((ItemAttributeAbiphoneContacts) item.getAttribute("abiphone_contacts")).getValue().stream() + .map(AbiphoneRegistry::getFromId) + .filter(Objects::nonNull) + .toList(); + } + + public void setAbiphoneNPCs(List npcs) { + List ids = npcs.stream() + .map(AbiphoneNPC::getId) + .toList(); + ((ItemAttributeAbiphoneContacts) item.getAttribute("abiphone_contacts")).setValue(ids); + } + + public void addAbiphoneNPC(AbiphoneNPC npc) { + ItemAttributeAbiphoneContacts attribute = (ItemAttributeAbiphoneContacts) item.getAttribute("abiphone_contacts"); + List ids = new ArrayList<>(attribute.getValue()); + if (!ids.contains(npc.getId())) { + ids.add(npc.getId()); + attribute.setValue(ids); + } + } + + public void removeAbiphoneNPC(AbiphoneNPC npc) { + ItemAttributeAbiphoneContacts attribute = (ItemAttributeAbiphoneContacts) item.getAttribute("abiphone_contacts"); + List ids = new ArrayList<>(attribute.getValue()); + if (ids.contains(npc.getId())) { + ids.remove(npc.getId()); + attribute.setValue(ids); + } + } + + public boolean hasAbiphoneNPC(AbiphoneNPC npc) { + ItemAttributeAbiphoneContacts attribute = (ItemAttributeAbiphoneContacts) item.getAttribute("abiphone_contacts"); + List ids = attribute.getValue(); + return ids.contains(npc.getId()); + } + public SkyBlockItem asSkyBlockItem() { return item; } diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/SkyBlockItem.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/SkyBlockItem.java index 4e4156d27..a823d800d 100644 --- a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/SkyBlockItem.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/SkyBlockItem.java @@ -344,6 +344,11 @@ public String getDisplayName() { return StringUtility.getTextFromComponent(new NonPlayerItemUpdater(this).getUpdatedItem().build().get(DataComponents.CUSTOM_NAME)); } + public String getCleanName() { + String displayName = getDisplayName(); + return displayName.replaceAll("§[0-9a-fk-or]", ""); + } + public List getLore() { return new NonPlayerItemUpdater(this).getUpdatedItem().build().get(DataComponents.LORE).stream().map( StringUtility::getTextFromComponent diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/components/AbiphoneComponent.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/components/AbiphoneComponent.java index 8121c7122..49d610751 100644 --- a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/components/AbiphoneComponent.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/item/components/AbiphoneComponent.java @@ -3,6 +3,7 @@ import net.kyori.adventure.text.Component; import net.kyori.adventure.text.event.ClickEvent; import net.swofty.commons.StringUtility; +import net.swofty.type.skyblockgeneric.gui.inventories.abiphone.GUIAbiphone; import net.swofty.type.skyblockgeneric.item.SkyBlockItemComponent; import java.util.ArrayList; @@ -36,8 +37,7 @@ public AbiphoneComponent(int maxContacts, int maxDiscs, List fe addInheritedComponent(new LoreUpdateComponent(lore, false)); addInheritedComponent(new InteractableComponent( (player, item) -> { - player.sendMessage(Component.text("§cThis Feature is not there yet. §aOpen a Pull request HERE to get it added quickly!") - .clickEvent(ClickEvent.openUrl("https://github.com/Swofty-Developments/HypixelSkyBlock"))); + new GUIAbiphone(item).open(player); }, null, null diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/mission/missions/MissionTalkToVillagers.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/mission/missions/MissionTalkToVillagers.java index c1fc58ed8..a3aa7d73a 100644 --- a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/mission/missions/MissionTalkToVillagers.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/mission/missions/MissionTalkToVillagers.java @@ -13,7 +13,7 @@ import net.swofty.type.generic.entity.npc.configuration.VillagerConfiguration; import net.swofty.type.generic.event.EventNodes; import net.swofty.type.generic.event.HypixelEvent; -import net.swofty.type.generic.event.custom.VillagerSpokenToEvent; +import net.swofty.type.generic.event.custom.NPCInteractEvent; import net.swofty.type.skyblockgeneric.mission.MissionData; import net.swofty.type.skyblockgeneric.mission.MissionRepeater; import net.swofty.type.skyblockgeneric.mission.SkyBlockProgressMission; @@ -39,7 +39,7 @@ public class MissionTalkToVillagers extends SkyBlockProgressMission implements M ); @HypixelEvent(node = EventNodes.CUSTOM, requireDataLoaded = false) - public void onVillagerSpokenTo(VillagerSpokenToEvent event) { + public void onVillagerSpokenTo(NPCInteractEvent event) { SkyBlockPlayer player = (SkyBlockPlayer) event.getPlayer(); MissionData data = player.getMissionData(); @@ -56,15 +56,15 @@ public void onVillagerSpokenTo(VillagerSpokenToEvent event) { Map customData = mission.getCustomData(); - if (customData.values().stream().anyMatch(value -> value.toString().contains(event.getVillager().getClass().getSimpleName()))) + if (customData.values().stream().anyMatch(value -> value.toString().contains(event.getNpc().getClass().getSimpleName()))) return; // Check if villager is a part of the mission if (villagers.stream().noneMatch(villager -> - event.getVillager().getClass().getSimpleName().contains(villager) + event.getNpc().getClass().getSimpleName().contains(villager) )) return; - customData.put("villager_" + mission.getMissionProgress(), event.getVillager().getClass().getSimpleName()); + customData.put("villager_" + mission.getMissionProgress(), event.getNpc().getClass().getSimpleName()); customData.put("last_updated", System.currentTimeMillis()); mission.setMissionProgress(mission.getMissionProgress() + 1); diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/mission/missions/sheperd/MissionTalkToShepherd.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/mission/missions/sheperd/MissionTalkToShepherd.java index 911c45c67..bd2f3623f 100644 --- a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/mission/missions/sheperd/MissionTalkToShepherd.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/mission/missions/sheperd/MissionTalkToShepherd.java @@ -2,7 +2,7 @@ import net.swofty.type.generic.event.EventNodes; import net.swofty.type.generic.event.HypixelEvent; -import net.swofty.type.generic.event.custom.VillagerSpokenToEvent; +import net.swofty.type.generic.event.custom.NPCInteractEvent; import net.swofty.type.skyblockgeneric.mission.MissionData; import net.swofty.type.skyblockgeneric.mission.SkyBlockMission; import net.swofty.type.skyblockgeneric.region.RegionType; @@ -14,11 +14,11 @@ public class MissionTalkToShepherd extends SkyBlockMission { @HypixelEvent(node = EventNodes.CUSTOM, requireDataLoaded = false) - public void onVillagerSpokenTo(VillagerSpokenToEvent event) { + public void onVillagerSpokenTo(NPCInteractEvent event) { MissionData data = ((SkyBlockPlayer) event.getPlayer()).getMissionData(); // Check if this is the Shepherd NPC - if (!event.getVillager().getClass().getSimpleName().contains("Shepherd")) { + if (!event.getNpc().getClass().getSimpleName().contains("Shepherd")) { return; } diff --git a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/user/SkyBlockPlayer.java b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/user/SkyBlockPlayer.java index d430351c1..288511090 100644 --- a/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/user/SkyBlockPlayer.java +++ b/type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/user/SkyBlockPlayer.java @@ -378,6 +378,17 @@ public SkyBlockItem updateItem(PlayerItemOrigin origin, Consumer u return item; } + public SkyBlockItem updateItemInSlot(int slot, Consumer update) { + ItemStack toUpdate = getInventory().getItemStack(slot); + if (toUpdate == null) return null; + + SkyBlockItem item = new SkyBlockItem(toUpdate); + update.accept(item); + + getInventory().setItemStack(slot, PlayerItemUpdater.playerUpdate(this, item.getItemStack()).build()); + return item; + } + public @Nullable SkyBlockRegion getRegion() { if (isOnIsland()) return SkyBlockRegion.getIslandRegion(); return SkyBlockRegion.getRegionOfPosition(this.getPosition()); diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCBeth.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCBeth.java index 8af0f8c0d..84ba363f3 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCBeth.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCBeth.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCBeth extends HypixelNPC { public NPCBeth() { super(new HumanConfiguration() { diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCFarmerJon.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCFarmerJon.java index be459005f..4a2508cf2 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCFarmerJon.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCFarmerJon.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCFarmerJon extends HypixelNPC { public NPCFarmerJon() { super(new HumanConfiguration() { @@ -38,7 +40,7 @@ public boolean looking() { } @Override - public void onClick(HypixelNPC.NPCInteractEvent e) { + public void onClick(NPCInteractEvent e) { e.player().sendMessage(Component.text("§cThis Feature is not there yet. §aOpen a Pull request HERE to get it added quickly!") .clickEvent(ClickEvent.openUrl("https://github.com/Swofty-Developments/HypixelSkyBlock"))); } diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCFriendlyHiker.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCFriendlyHiker.java index 6a586a4de..9a852401a 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCFriendlyHiker.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCFriendlyHiker.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCFriendlyHiker extends HypixelNPC { public NPCFriendlyHiker() { super(new HumanConfiguration() { diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCHungryHiker.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCHungryHiker.java index d85991fbf..aca5444d7 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCHungryHiker.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCHungryHiker.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCHungryHiker extends HypixelNPC { public NPCHungryHiker() { super(new HumanConfiguration() { @@ -38,7 +40,7 @@ public boolean looking() { } @Override - public void onClick(HypixelNPC.NPCInteractEvent e) { + public void onClick(NPCInteractEvent e) { e.player().sendMessage(Component.text("§cThis Feature is not there yet. §aOpen a Pull request HERE to get it added quickly!") .clickEvent(ClickEvent.openUrl("https://github.com/Swofty-Developments/HypixelSkyBlock"))); } diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCHunterAva.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCHunterAva.java index bb4d7a352..02e963016 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCHunterAva.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCHunterAva.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCHunterAva extends HypixelNPC { public NPCHunterAva() { super(new HumanConfiguration() { @@ -38,7 +40,7 @@ public boolean looking() { } @Override - public void onClick(HypixelNPC.NPCInteractEvent e) { + public void onClick(NPCInteractEvent e) { e.player().sendMessage(Component.text("§cThis Feature is not there yet. §aOpen a Pull request HERE to get it added quickly!") .clickEvent(ClickEvent.openUrl("https://github.com/Swofty-Developments/HypixelSkyBlock"))); } diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCJake.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCJake.java index e06eaab94..1ea85164a 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCJake.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCJake.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCJake extends HypixelNPC { public NPCJake() { super(new HumanConfiguration() { diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCMason.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCMason.java index 2ac8d4d40..7329d4412 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCMason.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCMason.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMason extends HypixelNPC { public NPCMason() { super(new HumanConfiguration() { diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCMoby.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCMoby.java index 01ab92949..a779e05fd 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCMoby.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCMoby.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCMoby extends HypixelNPC { public NPCMoby() { super(new HumanConfiguration() { diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCShepherd.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCShepherd.java index 4d83e2dc8..c09440975 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCShepherd.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCShepherd.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCShepherd extends HypixelNPC { public NPCShepherd() { super(new HumanConfiguration() { diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTalbot.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTalbot.java index de5d21da8..a2b3b6983 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTalbot.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTalbot.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCTalbot extends HypixelNPC { //only there if Finnegan is mayor public NPCTalbot() { super(new HumanConfiguration() { diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTammy.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTammy.java index 8ddb7c388..f82ec50b4 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTammy.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTammy.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCTammy extends HypixelNPC { public NPCTammy() { super(new HumanConfiguration() { diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTony.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTony.java index cb33d17b3..cc9d35193 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTony.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTony.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCTony extends HypixelNPC { public NPCTony() { super(new HumanConfiguration() { diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTreasureHunter.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTreasureHunter.java index e725eac9b..1dd41e06a 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTreasureHunter.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTreasureHunter.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCTreasureHunter extends HypixelNPC { public NPCTreasureHunter() { super(new HumanConfiguration() { diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTrevorTheTrapper.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTrevorTheTrapper.java index e3e3a0cb3..38166a97e 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTrevorTheTrapper.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/NPCTrevorTheTrapper.java @@ -7,6 +7,8 @@ import net.swofty.type.generic.entity.npc.HypixelNPC; import net.swofty.type.generic.entity.npc.configuration.HumanConfiguration; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class NPCTrevorTheTrapper extends HypixelNPC { public NPCTrevorTheTrapper() { super(new HumanConfiguration() { diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/villagers/VillagerFarmHand.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/villagers/VillagerFarmHand.java index 3e78a5604..ab3b0b18e 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/villagers/VillagerFarmHand.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/villagers/VillagerFarmHand.java @@ -13,6 +13,8 @@ import java.util.List; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerFarmHand extends HypixelNPC { public VillagerFarmHand() { super(new VillagerConfiguration(){ diff --git a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/villagers/VillagerWindmillOperator.java b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/villagers/VillagerWindmillOperator.java index fa1020643..7d4e84d40 100644 --- a/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/villagers/VillagerWindmillOperator.java +++ b/type.thefarmingislands/src/main/java/net/swofty/type/thefarmingislands/npcs/villagers/VillagerWindmillOperator.java @@ -9,6 +9,8 @@ import net.swofty.type.generic.user.HypixelPlayer; +import net.swofty.type.generic.event.custom.NPCInteractEvent; + public class VillagerWindmillOperator extends HypixelNPC { public VillagerWindmillOperator() { super(new VillagerConfiguration(){