MCPcopy Index your code
hub / github.com/MascusJeoraly/LanguageUtils

github.com/MascusJeoraly/LanguageUtils @1.9

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.9 ↗ · + Follow
91 symbols 257 edges 16 files 61 documented · 67%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Language Utils

Gitter Build Status

A Bukkit/Spigot API offering the ability to get the name of vanilla items, entities, enchantments, and enchantment levels.

The major version of this API supports 1.12. If you are using 1.7.10, 1.8.9, 1.9.4, 1.10.2, or 1.11.2, please download 1.4.0 version for 1.7.10(with suffix -1.7.10) or 1.4.0 for 1.8.9(no suffix), 1.5.x for 1.9.4, or 1.6.x for 1.10.2, 1.8.x for 1.11.2 accordingly.

Loading language files may cost 100-300 ms, but it should be fine to wait, and you can even disable the loading of any language.

Also, if you want to know how to add customized language entries, just read the README.txt inside lang/ folder.

You can get the latest build here.

You CAN install this plugin on Cauldron/KCauldron servers if you are using 1.2.0.1-1.7.10+ version of this plugin. Again, the API only supports vanilla language entries. It will just return the auto-generated material name of an item in mods.

Configuration

# When a name in the language requested does not exist, the name will be retrieved in this language. The default fall back language is English.
FallbackLanguage=en_US
# If you want to enable the loading of a language, add it to the following list
LoadLanguage= [en_US, zh_CN, zh_TW]
# Or
LoadLanguage:
- en_US
- zh_CN
- zh_TW
# If you want to load all the languages, add "all" to the list:
LoadLanguage:
- all

Use Language Utils

You can also see this Example for detailed usage.

Plugin dependency

First, you need to add LangUtils as a dependency in your plugin.yml file:

depend: [LangUtils]

If you have multiple dependencies, add , between each of them:

depend: [LangUtils, Vault]

Instead of adding LangUtils as a dependency, you can just add it as a soft dependency:

softdepend: [LangUtils]

Build Path

Just add this library to your build path.

Maven/Gradle dependency

This plugin is hosting on Github cause I don't have a server.

If you are using Gradle, add the following to you build.gradle:

repositories {
    maven {
        url 'https://raw.github.com/MascusJeoraly/LanguageUtils/mvn-repo/'
    }
}
dependencies {
    compile group: 'com.meowj', name: 'LangUtils', version: '1.8' // Please check the latest version
}

If you are using Maven, add the following to your pom.xml:

<repositories>
  <repository>
    <id>lang-utils-repo</id>
    <url>https://raw.github.com/MascusJeoraly/LanguageUtils/mvn-repo/</url>
  </repository>
</repository>

<dependencies>
  <dependency>
    <groupId>com.meowj</groupId>
    <artifactId>LangUtils</artifactId>

    <version>1.8</version>
  </dependency>
</dependencies>

Usage

For further information, see the Example plugin or LanguageHelper and LocaleHelper.


Contribute to this Project

If you don't have Gradle installed, you can download one or use gradlew(Windows) / ./gradlew(Linux) instead of gradle in the commands.

If you don't have permission when using ./gradlew, run chmod +x gradlew and run the command again.

Setup Dev Environment

If you are using IntelliJ IDEA(recommended), just import the build.gradle file. IntelliJ should automatically handle the dependencies.

If you just want to create a Module instead of a Project, run gradle ideaModule instead, or just directly import build.gradle file to IntelliJ.

If you are using Eclipse(not tested)

[Navigate to the project directory]
$ gradle eclipse

Pull Request

If you find any problems or want to improve the efficiency, please send me PR or issues.

Core symbols most depended-on inside this repo

getType
called by 29
src/main/java/com/meowj/langutils/lang/convert/EnumEntity.java
translateToLocal
called by 17
src/main/java/com/meowj/langutils/lang/LanguageHelper.java
hashCode
called by 10
src/main/java/com/meowj/langutils/lang/convert/ItemEntry.java
getLocale
called by 9
src/main/java/com/meowj/langutils/lang/convert/EnumLang.java
getPlayerLanguage
called by 8
src/main/java/com/meowj/langutils/locale/LocaleHelper.java
getItemDisplayName
called by 6
src/main/java/com/meowj/langutils/lang/LanguageHelper.java
info
called by 5
src/main/java/com/meowj/langutils/LangUtils.java
getMap
called by 5
src/main/java/com/meowj/langutils/lang/convert/EnumLang.java

Shape

Method 77
Class 8
Enum 6

Languages

Java100%

Modules by API surface

src/test/java/com/meowj/langutils/lang/LanguageHelperTest.java14 symbols
src/main/java/com/meowj/langutils/lang/LanguageHelper.java13 symbols
src/main/java/com/meowj/langutils/lang/convert/EnumPotionEffect.java9 symbols
src/main/java/com/meowj/langutils/lang/convert/EnumLang.java9 symbols
src/main/java/com/meowj/langutils/lang/convert/ItemEntry.java7 symbols
src/main/java/com/meowj/langutils/lang/convert/EnumItem.java7 symbols
src/main/java/com/meowj/langutils/lang/convert/EnumEntity.java7 symbols
src/main/java/com/meowj/langutils/LangUtils.java6 symbols
src/main/java/com/meowj/langutils/lang/convert/EnumEnchantmentLevel.java5 symbols
src/main/java/com/meowj/langutils/lang/convert/EnumEnchantment.java5 symbols
src/test/java/com/meowj/langutils/lang/LanguageRegistryTest.java3 symbols
src/test/java/com/meowj/langutils/lang/convert/ItemEntryTest.java2 symbols

For agents

$ claude mcp add LanguageUtils \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact