Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added many internal providers to the API for public use (#807)
- Loading branch information
1 parent
44f18fc
commit e2d8659
Showing
18 changed files
with
159 additions
and
79 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
17 changes: 17 additions & 0 deletions
17
API/src/main/java/com/bgsoftware/superiorskyblock/api/hooks/PermissionsProvider.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,17 @@ | ||
package com.bgsoftware.superiorskyblock.api.hooks; | ||
|
||
import org.bukkit.entity.Player; | ||
|
||
public interface PermissionsProvider { | ||
|
||
/** | ||
* Check whether a player has permission. | ||
* | ||
* @param player The player to check permissions for. | ||
* @param permission The permission to check. | ||
* @return whether the player has permission excluding his operator status. | ||
* This means that the permission must be given explicitly to the player for the method to return true. | ||
*/ | ||
boolean hasPermission(Player player, String permission); | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
API/src/main/java/com/bgsoftware/superiorskyblock/api/hooks/PricesProvider.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,28 @@ | ||
package com.bgsoftware.superiorskyblock.api.hooks; | ||
|
||
import com.bgsoftware.superiorskyblock.api.key.Key; | ||
|
||
import javax.annotation.Nullable; | ||
import java.math.BigDecimal; | ||
|
||
public interface PricesProvider { | ||
|
||
/** | ||
* Get price of a block/item. | ||
* | ||
* @param key The key of the block or the item. | ||
* @return The price of that block/item. | ||
*/ | ||
BigDecimal getPrice(Key key); | ||
|
||
/** | ||
* Get the correct block-key for a price. | ||
* Mostly used for legacy-versions where data values of blocks can be ignored. | ||
* | ||
* @param blockKey The original block-key. | ||
* @return The correct-block key for a price. | ||
*/ | ||
@Nullable | ||
Key getBlockKey(Key blockKey); | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
API/src/main/java/com/bgsoftware/superiorskyblock/api/hooks/VanishProvider.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,14 @@ | ||
package com.bgsoftware.superiorskyblock.api.hooks; | ||
|
||
import org.bukkit.entity.Player; | ||
|
||
public interface VanishProvider { | ||
|
||
/** | ||
* Check whether a player is vanished from online players. | ||
* | ||
* @param player The player to check | ||
*/ | ||
boolean isVanished(Player player); | ||
|
||
} |
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
1 change: 1 addition & 0 deletions
1
...c/main/java/com/bgsoftware/superiorskyblock/hooks/provider/VanishProvider_Essentials.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
1 change: 1 addition & 0 deletions
1
...in/java/com/bgsoftware/superiorskyblock/hooks/provider/PermissionsProvider_LuckPerms.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
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
1 change: 1 addition & 0 deletions
1
.../main/java/com/bgsoftware/superiorskyblock/hooks/provider/VanishProvider_SuperVanish.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
1 change: 1 addition & 0 deletions
1
...in/java/com/bgsoftware/superiorskyblock/hooks/provider/VanishProvider_VanishNoPacket.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
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
9 changes: 0 additions & 9 deletions
9
src/main/java/com/bgsoftware/superiorskyblock/hooks/provider/PermissionsProvider.java
This file was deleted.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...main/java/com/bgsoftware/superiorskyblock/hooks/provider/PermissionsProvider_Default.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
19 changes: 0 additions & 19 deletions
19
src/main/java/com/bgsoftware/superiorskyblock/hooks/provider/PricesProvider.java
This file was deleted.
Oops, something went wrong.
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.