-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Merge pull request #336 from SkytAsul/develop
release/1.0.4
- Loading branch information
Showing
56 changed files
with
1,162 additions
and
607 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 15 additions & 6 deletions
21
api/src/main/java/fr/skytasul/quests/api/stages/types/Dialogable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
package fr.skytasul.quests.api.stages.types; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
import fr.skytasul.quests.api.npcs.BqNpc; | ||
import fr.skytasul.quests.api.npcs.dialogs.Dialog; | ||
import fr.skytasul.quests.api.npcs.dialogs.DialogRunner; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public interface Dialogable { | ||
|
||
@Nullable | ||
Dialog getDialog(); | ||
|
||
@Nullable | ||
DialogRunner getDialogRunner(); | ||
|
||
@Nullable | ||
BqNpc getNPC(); | ||
|
||
default boolean hasDialog() { | ||
return getNPC() != null && getDialog() != null && !getDialog().getMessages().isEmpty(); | ||
} | ||
|
||
|
||
default @NotNull String getNpcName() { | ||
if (getNPC() == null) | ||
return "§c§lunknown NPC"; | ||
if (getDialog() != null && getDialog().getNpcName() != null) | ||
return getDialog().getNpcName(); | ||
return getNPC().getNpc().getName(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.