Skip to content

Commit

Permalink
Fix: Compile / Chore: Add more integration configs
Browse files Browse the repository at this point in the history
  • Loading branch information
Skullians committed Dec 26, 2024
1 parent 2e98295 commit 0ad1d0b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public enum Settings {
VAULT_INTEGRATION("integration.vault"),
PLACEHOLDERAPI_INTEGRATION("integration.placeholderapi"),
JUKEBOX_INTEGRATION("integration.jukebox"),
NOTEBLOCKAPI_INTEGRATION("integration.noteblockapi"),
MYTHICMOBS_INTEGRATION("integration.mythicmobs"),

HUB_WORLD_NAME("hub.world-name"),
HUB_LOCATION("hub.hub-location"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void onClick(SkyClickType clickType, SkyUser player) {
if (defence == null) return;
defence.disable();

defence.remove().whenComplete((ignored, ex) -> {
defence.remove(player).whenComplete((ignored, ex) -> {
if (ex != null) {
ErrorUtil.handleError(player, "remove a defence", "DEFENCE_PROCESSING_EXCEPTION", ex);
return;
Expand Down
3 changes: 3 additions & 0 deletions common/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ integration:
vault: true # Used in the NPC integration (for actions).
placeholderapi: true # Hook into PlaceholderAPI and parse placeholders.
jukebox: true # Hook into the Jukebox plugin, to stop playing music when a raid begins.
noteblockapi: true # Hook into the NoteBlockAPI plugin, used to play music when a raid begins.
mythicmobs: true # Hook into mythicmobs, used in defences. See https://docs.terrabytedev.com/skyfactions/mechanics/defences/integrations.html#mythicmobs for more info.

# SkyFactions Hub Config
hub:
Expand Down Expand Up @@ -279,6 +281,7 @@ raiding:
spawn-height: 250

# List of .nbs song names that are played when raiding (IN ORDER).
# Requires NoteBlockAPI to be installed and enabled in the integrations section.
music-file-names:
- The_Grounds_Color_Is_Yellow.nbs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ public boolean shouldBlockNPCs(List<String> entities) {

// acts as a boolean too
public List<String> getBlockedMythicMobs(List<String> entities) {
if (DependencyHandler.enabledDeps.contains("MythicMobs")) {
return entities.stream()
.filter(s -> s.startsWith("mythicmobs:"))
.collect(Collectors.toList());
}
List<String> blockedMythicMobs = entities.stream()
.filter(s -> s.startsWith("mythicmobs:"))
.toList();
if (DependencyHandler.isEnabled("MythicMobs")) return blockedMythicMobs;
else if (!blockedMythicMobs.isEmpty()) SLogger.warn("Found {} blocked Mythic Mob IDs in defence [{}], but MythicMobs is not present / enabled in the integrations config!\nPlease see https://docs.terrabytedev.com/skyfactions/mechanics/defences/integrations.html#mythicmobs for more information.", getStruct().getIDENTIFIER());

return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ public static void init() {
enabledDeps.add("JukeBox");
} else alert("JukeBox");

if (isPluginEnabled("NoteBlockAPI")) {
if (isPluginEnabled("NoteBlockAPI") && Settings.NOTEBLOCKAPI_INTEGRATION.getBoolean()) {
SLogger.setup("Found {} installed on the server.", false, "<#05eb2f>NoteBlockAPI<#4294ed>");
enabledDeps.add("NoteBlockAPI");
} else alert("NoteBlockAPI");

if (isPluginEnabled("MythicMobs")) {
if (isPluginEnabled("MythicMobs") && Settings.MYTHICMOBS_INTEGRATION.getBoolean()) {
SLogger.setup("Found {} installed on the server.", false, "<#05eb2f>MythicMobs<#4294ed>");
enabledDeps.add("MythicMobs");
} else alert("MythicMobs");
Expand Down

0 comments on commit 0ad1d0b

Please sign in to comment.