-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customizable name and style for nova items and blocks
- Loading branch information
1 parent
5e1f6bb
commit 116a8b1
Showing
27 changed files
with
398 additions
and
170 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
10 changes: 4 additions & 6 deletions
10
nova/src/main/kotlin/xyz/xenondevs/nova/api/ApiBlockWrapper.kt
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 |
---|---|---|
@@ -1,20 +1,18 @@ | ||
package xyz.xenondevs.nova.api | ||
|
||
import net.kyori.adventure.text.Component | ||
import xyz.xenondevs.nova.api.data.NamespacedId | ||
import xyz.xenondevs.nova.api.item.NovaItem | ||
import xyz.xenondevs.nova.i18n.LocaleManager | ||
import xyz.xenondevs.nova.util.component.adventure.toPlainText | ||
import xyz.xenondevs.nova.util.namespacedId | ||
import xyz.xenondevs.nova.world.block.NovaBlock | ||
import xyz.xenondevs.nova.api.block.NovaBlock as INovaBlock | ||
|
||
internal class ApiBlockWrapper(val block: NovaBlock): INovaBlock { | ||
|
||
override fun getId(): NamespacedId = block.id.namespacedId | ||
|
||
override fun getItem(): NovaItem? = block.item?.let(::ApiItemWrapper) | ||
|
||
override fun getLocalizedName(locale: String): String { | ||
return LocaleManager.getTranslation(locale, block.localizedName) | ||
} | ||
override fun getName(): Component = block.name | ||
override fun getPlaintextName(locale: String): String = block.name.toPlainText(locale) | ||
|
||
} |
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.