-
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.
Added TranslatableItem Added static "by" methods to TagSet, TranslatableItem, BlobMessage and BlobSound to allow retrieving assets just by their key Added "localize" methods to TranslatableItem and BlobMessage to allow caching these assets and later getting their translation just in time
- Loading branch information
1 parent
414272f
commit e736f06
Showing
59 changed files
with
1,468 additions
and
330 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package us.mytheria.bloblib.api; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
import us.mytheria.bloblib.BlobLib; | ||
import us.mytheria.bloblib.entities.tag.TagSet; | ||
import us.mytheria.bloblib.managers.DataAssetManager; | ||
|
||
public class BlobLibTagAPI { | ||
private static BlobLibTagAPI instance; | ||
private final BlobLib plugin; | ||
|
||
private BlobLibTagAPI(BlobLib plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
public static BlobLibTagAPI getInstance(BlobLib plugin) { | ||
if (instance == null) { | ||
if (plugin == null) | ||
throw new NullPointerException("injected dependency is null"); | ||
BlobLibTagAPI.instance = new BlobLibTagAPI(plugin); | ||
} | ||
return instance; | ||
} | ||
|
||
public static BlobLibTagAPI getInstance() { | ||
return getInstance(null); | ||
} | ||
|
||
/** | ||
* @return The TagSet manager | ||
*/ | ||
public DataAssetManager<TagSet> getTagSetManager() { | ||
return plugin.getTagSetManager(); | ||
} | ||
|
||
/** | ||
* @param key The key of the TagSet | ||
* @return The TagSet. Null if not found. | ||
*/ | ||
@Nullable | ||
public TagSet getTagSet(String key) { | ||
return getTagSetManager().getAsset(key); | ||
} | ||
} |
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.