Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxlego08/ztranslator
Allows you to translate item names into a language
https://github.com/maxlego08/ztranslator
Last synced: about 1 month ago
JSON representation
Allows you to translate item names into a language
- Host: GitHub
- URL: https://github.com/maxlego08/ztranslator
- Owner: Maxlego08
- License: gpl-3.0
- Created: 2022-02-13T11:03:06.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-16T13:12:56.000Z (over 2 years ago)
- Last Synced: 2023-03-04T11:41:50.665Z (over 1 year ago)
- Language: Java
- Size: 520 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zTranslator
The plugin will allow you to translate the names of minecraft items with your language. You just have to add the lang file of minecraft in the ``zTranslator/langs`` folder and reload the plugin. The file ``bind.json`` will make the link between the item and the translation. Don't hesitate to create an exit if an item is not translated.
## Maven
```xml
jitpack.io
https://jitpack.io
com.github.Maxlego08
zTranslator
1.0.0.0```
## Gradle
```gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.Maxlego08:zTranslator:1.0.0.0'
}
```## How to translate an ItemStack
You need to get the Translator class using the spigot service provider.
Here is an example:```java
public void example(){
Translator translator = this.getProvider(Translator.class);
translator.translate(new ItemStack(Material.STONE));
}public T getProvider(Class classz) {
RegisteredServiceProvider provider = getServer().getServicesManager().getRegistration(classz);
if (provider == null) {
this.getLogger().warning("Unable to retrieve the provider " + classz.toString());
return null;
}
return provider.getProvider() != null ? (T) provider.getProvider() : null;
}
```