-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
be3d2c8
commit f7fa8de
Showing
32 changed files
with
209 additions
and
66 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
8 changes: 8 additions & 0 deletions
8
src/main/java/xyz/nifeather/morph/api/v0/disguise/DisguiseValidateResult.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package xyz.nifeather.morph.api.v0.disguise; | ||
|
||
public class DisguiseValidateResult | ||
{ | ||
public static final int VALIDATE_NO_ISSUE = 0; | ||
public static final int VALIDATE_NO_PROVIDER = 1; | ||
public static final int VALIDATE_PROVIDER_FAIL = 2; | ||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/xyz/nifeather/morph/api/v0/disguise/IDisguiseState.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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package xyz.nifeather.morph.api.v0.disguise; | ||
|
||
import net.kyori.adventure.text.Component; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import xiamomc.pluginbase.Exceptions.NullDependencyException; | ||
|
||
public interface IDisguiseState | ||
{ | ||
@Nullable | ||
Player tryGetPlayer(); | ||
|
||
/** | ||
* | ||
* @apiNote For a nullable method, use {@link IDisguiseState#tryGetPlayer()} | ||
* @throws NullDependencyException If the player doesn't exist. | ||
*/ | ||
@NotNull | ||
Player getPlayer() throws NullDependencyException; | ||
|
||
boolean isSelfViewing(); | ||
|
||
/** | ||
* @return The display component used for the player | ||
*/ | ||
Component getPlayerDisplay(); | ||
void setPlayerDisplay(@NotNull Component newName); | ||
|
||
/** | ||
* @return The display component used for others, like Bossbar, ChatOverride, and PAPI integration | ||
*/ | ||
Component getServerDisplay(); | ||
void setServerDisplay(@NotNull Component newName); | ||
|
||
/** | ||
* Sets both the player and the server display to the given component | ||
*/ | ||
void setCustomDisplayName(Component newName); | ||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/xyz/nifeather/morph/api/v0/disguise/IMorphManager.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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package xyz.nifeather.morph.api.v0.disguise; | ||
|
||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import xyz.nifeather.morph.providers.disguise.DisguiseProvider; | ||
|
||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
public interface IMorphManager | ||
{ | ||
boolean canMorph(UUID playerUUID); | ||
|
||
void updateLastPlayerMorphOperationTime(UUID uuid); | ||
|
||
List<String> getBannedDisguisesCopy(); | ||
|
||
boolean disguiseDisabled(String identifier); | ||
|
||
@NotNull | ||
DisguiseProvider getDisguiseProvider(String namespaceIdentifier); | ||
boolean registerDisguiseProvider(DisguiseProvider provider); | ||
|
||
boolean tryQuickDisguise(Player player); | ||
|
||
boolean morph(MorphParameters parameters); | ||
|
||
void unMorph(Player player); | ||
void unMorph(Player player, boolean ignorePermissions); | ||
void unMorph(@Nullable CommandSender source, Player player, boolean bypassPermission, boolean forceUnmorph); | ||
|
||
/** | ||
* @return See {@link DisguiseValidateResult} | ||
*/ | ||
int validateDisguise(String identifier); | ||
|
||
boolean clientViewAvailable(Player player); | ||
|
||
void setSelfDisguiseVisible(Player player, boolean value, boolean saveToConfig, boolean dontSetServerSide, boolean noClientCommand); | ||
void setSelfDisguiseVisible(Player player, boolean value, boolean saveToConfig); | ||
|
||
IDisguiseState getDisguiseStateFor(Player player); | ||
|
||
boolean grantMorphToPlayer(Player player, String disguiseIdentifier); | ||
|
||
boolean revokeMorphFromPlayer(Player player, String disguiseIdentifier); | ||
} |
2 changes: 1 addition & 1 deletion
2
...nifeather/morph/misc/MorphParameters.java → ...orph/api/v0/disguise/MorphParameters.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
5 changes: 5 additions & 0 deletions
5
src/main/java/xyz/nifeather/morph/api/v0/disguise/backends/IDisguiseBackend.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package xyz.nifeather.morph.api.v0.disguise.backends; | ||
|
||
public interface IDisguiseBackend<TInstance, TWrapper extends IDisguiseWrapper<TInstance>> | ||
{ | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/xyz/nifeather/morph/api/v0/disguise/backends/IDisguiseWrapper.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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package xyz.nifeather.morph.api.v0.disguise.backends; | ||
|
||
public interface IDisguiseWrapper<TInstance> | ||
{ | ||
/** | ||
* @return The underlying disguise instance | ||
*/ | ||
TInstance getInstance(); | ||
|
||
IDisguiseBackend<TInstance, ? extends IDisguiseWrapper<TInstance>> getBackend(); | ||
} |
2 changes: 1 addition & 1 deletion
2
...PlayerDisguisedFromOfflineStateEvent.java → ...PlayerDisguisedFromOfflineStateEvent.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
2 changes: 1 addition & 1 deletion
2
...api/gameplay/PlayerExecuteSkillEvent.java → ...nts/gameplay/PlayerExecuteSkillEvent.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
2 changes: 1 addition & 1 deletion
2
...meplay/PlayerJoinedWithDisguiseEvent.java → ...meplay/PlayerJoinedWithDisguiseEvent.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
2 changes: 1 addition & 1 deletion
2
...s/api/gameplay/PlayerMorphEarlyEvent.java → ...vents/gameplay/PlayerMorphEarlyEvent.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
2 changes: 1 addition & 1 deletion
2
...events/api/gameplay/PlayerMorphEvent.java → .../v0/events/gameplay/PlayerMorphEvent.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
Oops, something went wrong.