-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Showing
14 changed files
with
184 additions
and
57 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
39 changes: 39 additions & 0 deletions
39
api/src/main/java/org/screamingsandals/bedwars/api/game/ItemSpawnerTypeHolder.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,39 @@ | ||
package org.screamingsandals.bedwars.api.game; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.screamingsandals.bedwars.api.variants.Variant; | ||
|
||
/** | ||
* @since 0.3.0 | ||
*/ | ||
public interface ItemSpawnerTypeHolder { | ||
/** | ||
* @since 0.3.0 | ||
*/ | ||
@NotNull String configKey(); | ||
|
||
/** | ||
* @since 0.3.0 | ||
*/ | ||
@Nullable ItemSpawnerType toSpawnerType(@NotNull LocalGame variant); | ||
|
||
/** | ||
* @since 0.3.0 | ||
*/ | ||
@Nullable ItemSpawnerType toSpawnerType(@Nullable Variant variant); | ||
|
||
/** | ||
* @since 0.3.0 | ||
*/ | ||
default boolean isValid(@NotNull LocalGame game) { | ||
return toSpawnerType(game) != null; | ||
} | ||
|
||
/** | ||
* @since 0.3.0 | ||
*/ | ||
default boolean isValid(@Nullable Variant variant) { | ||
return toSpawnerType(variant) != null; | ||
} | ||
} |
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
Oops, something went wrong.