Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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<List<String>> {
@Override
public String getKey() {
return "abiphone_contacts";
}

@Override
public List<String> getDefaultValue(@Nullable ItemStatistics defaultStatistics) {
return List.of();
}

@Override
public List<String> loadFromString(String string) {
try {
return List.of(string.split(","));
} catch (NumberFormatException e) {
return List.of();
}
}

@Override
public String saveIntoString() {
return String.join(",", getValue());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<UnderstandableProxyServer> cacheServers = new ArrayList<>();
private static long lastCacheTime = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<UnderstandableProxyServer> cacheServers = new ArrayList<>();
private static long lastCacheTime = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<UnderstandableProxyServer> cacheServers = new ArrayList<>();
private static long lastCacheTime = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import java.util.stream.Stream;

import net.swofty.type.generic.event.custom.NPCInteractEvent;

public class NPCSlumberTourGuide extends HypixelNPC {

public NPCSlumberTourGuide() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<UnderstandableProxyServer> cacheServers = new ArrayList<>();
private static long lastCacheTime = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<UnderstandableProxyServer> cacheServers = new ArrayList<>();
private static long lastCacheTime = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<UnderstandableProxyServer> cacheServers = new ArrayList<>();
private static long lastCacheTime = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

import java.util.stream.Stream;

import net.swofty.type.generic.event.custom.NPCInteractEvent;

public class NPCLiftOperator extends HypixelNPC {

public NPCLiftOperator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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() {
Expand Down Expand Up @@ -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);
});
Expand All @@ -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";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<HypixelPlayer, String> signature, Function<HypixelPlayer, String> texture, Function<HypixelPlayer, Pos> position) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import java.util.stream.Stream;

import net.swofty.type.generic.event.custom.NPCInteractEvent;

public class NPCCastleGuardEight extends HypixelNPC {

public NPCCastleGuardEight() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import java.util.stream.Stream;

import net.swofty.type.generic.event.custom.NPCInteractEvent;

public class NPCCastleGuardFive extends HypixelNPC {

public NPCCastleGuardFive() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import java.util.stream.Stream;

import net.swofty.type.generic.event.custom.NPCInteractEvent;

public class NPCCastleGuardFour extends HypixelNPC {

public NPCCastleGuardFour() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import java.util.stream.Stream;

import net.swofty.type.generic.event.custom.NPCInteractEvent;

public class NPCCastleGuardOne extends HypixelNPC {

public NPCCastleGuardOne() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import java.util.stream.Stream;

import net.swofty.type.generic.event.custom.NPCInteractEvent;

public class NPCCastleGuardSeven extends HypixelNPC {

public NPCCastleGuardSeven() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import java.util.stream.Stream;

import net.swofty.type.generic.event.custom.NPCInteractEvent;

public class NPCCastleGuardSix extends HypixelNPC {

public NPCCastleGuardSix() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import java.util.stream.Stream;

import net.swofty.type.generic.event.custom.NPCInteractEvent;

public class NPCCastleGuardThree extends HypixelNPC {

public NPCCastleGuardThree() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import java.util.stream.Stream;

import net.swofty.type.generic.event.custom.NPCInteractEvent;

public class NPCCastleGuardTwo extends HypixelNPC {

public NPCCastleGuardTwo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading