Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions src/generated/resources/assets/thavma/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"item.thavma.basic_amulet": "Basic Amulet",
"item.thavma.basic_belt": "Basic Belt",
"item.thavma.basic_ring": "Basic Ring",
"item.thavma.book": "Elements of Thavma",
"item.thavma.book": "Elements",
"item.thavma.charm_of_the_dawn": "Charm of the Dawn",
"item.thavma.eye_of_warden": "Eye of Warden",
"item.thavma.fabric": "Infused Fabric",
Expand Down Expand Up @@ -157,7 +157,7 @@
"recipe_viewer.thavma.description.greatwood": "Greatwoods are very tall, ancient trees. They are somewhat rare, but they can spawn in all overworld biomes.",
"recipe_viewer.thavma.description.infused_stones": "A piece of stone, infused with a primal element. Found in the overworld, at any height.",
"recipe_viewer.thavma.description.pillar": "Formed by right clicking the Infusion Matrix, after completing the Infusion Multiblock.",
"recipe_viewer.thavma.description.research_scroll": "Obtained by clicking any unknown entry in the \"Elements of Thavma\"",
"recipe_viewer.thavma.description.research_scroll": "Obtained by clicking any unknown entry in the \"Elements\"",
"recipe_viewer.thavma.description.research_table": "Can be formed by placing 2 tables next to each other, and right clicking one with a wand.",
"recipe_viewer.thavma.description.rotten_brain": "Sometimes dropped by angry zombies.",
"recipe_viewer.thavma.description.silverwood": "Silverwoods are magical trees, with uniquely blue leaves. They are very rare, but they can spawn in all overworld biomes.",
Expand All @@ -169,15 +169,16 @@
"research/category.thavma.thavma": "Thavma",
"research/entry.thavma.alchemy.alchemy": "Alchemy",
"research/entry.thavma.story.story1": "A Courtesy Call",
"research/entry.thavma.story.story1.page0.paragraph0": "Lorem ipsum %s 1 sit amet,",
"research/entry.thavma.story.story1.page0.paragraph1": "this story a great meaning haveth.",
"research/entry.thavma.story.story1.page0.title": "A Courtesy Call 1",
"research/entry.thavma.story.story1.page1.paragraph0": "Lorem dolor 2 sit amet,",
"research/entry.thavma.story.story1.page1.paragraph1": "this story a great meaning haveth.",
"research/entry.thavma.story.story1.page1.title": "A Courtesy Call 2",
"research/entry.thavma.story.story1.page2.paragraph0": "Lorem lotrumatum dolor 3 sit amet,",
"research/entry.thavma.story.story1.page2.paragraph1": "this story a great meaning haveth.",
"research/entry.thavma.story.story1.page2.title": "A Courtesy Call 3",
"research/entry.thavma.story.story1.figure_feature0": "A short caption for the figure just to show the custom style ",
"research/entry.thavma.story.story1.paragraph_feature0": "This is a short paragraph just to showcase that the feature exists.",
"research/entry.thavma.story.story1.paragraph_feature1": "This is a longer paragraph to highlight the importance of splicing longer pieces of text over multiple pages. If you do not splice the paragraph to go over multiple pages, the text will spill out of the bottom of the screen and we don't want that to happen, hence DynamicRenderingHelper.kt. I will continue with some lorem ipsum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque dapibus mattis lectus, quis aliquet ex. In hac habitasse platea dictumst. Praesent dignissim urna at feugiat pulvinar. Suspendisse laoreet lorem ut velit venenatis gravida. Donec posuere diam est, ac malesuada libero fermentum sed. Phasellus ac cursus nibh, eget pharetra leo. Maecenas scelerisque velit massa, sit amet tincidunt nulla dictum non. Sed egestas congue bibendum. Aenean facilisis nunc vitae purus tincidunt, sit amet dignissim libero gravida. Mauris vel tortor elit. Curabitur sit amet nisi sagittis, ullamcorper diam sed, condimentum est. Etiam blandit ac magna sit amet luctus. Duis nec mi tincidunt nunc.",
"research/entry.thavma.story.story1.paragraph_feature2": "This paragraph should start a new page always.",
"research/entry.thavma.story.story1.paragraph_feature3": "Just another random little paragraph :D",
"research/entry.thavma.story.story1.paragraph_feature4": "This paragraph has a pre-set page index of 2",
"research/entry.thavma.story.story1.title_feature0": "This title starts the page",
"research/entry.thavma.story.story1.title_feature1": "This might appear in the middle",
"research/entry.thavma.story.story1.title_feature2": "(start of page)",
"research/entry.thavma.story.story1.title_feature3": "This is page number 1!",
"research/entry.thavma.thavma.alchemy": "Alchemy",
"research/entry.thavma.thavma.arcane_lens": "The Arcane Lens",
"research/entry.thavma.thavma.arcane_lens.page0.paragraph0": "The part of the book I can read describes an arcane tool that \"allows the user to see\", whatever that might mean. I have a feeling that crafting it could assist my work in unsealing the other pages.",
Expand All @@ -191,7 +192,7 @@
"research/entry.thavma.thavma.technology": "Technology",
"research/entry.thavma.thavma.thavma": "Thavma",
"research/entry.thavma.thavma.thavma.page0.paragraph0": "I was merely toying with that wand -if it can even be called that- when this tome flew into my hands! I can sense great power within it.",
"research/entry.thavma.thavma.thavma.page0.paragraph1": "The cover reads \"Elements of Thavma\", but a lot of its pages appear blank, sealed by some magic.",
"research/entry.thavma.thavma.thavma.page0.paragraph1": "The cover reads \"Elements\", but a lot of its pages appear blank, sealed by some magic.",
"research/entry.thavma.thavma.thavma.page0.paragraph2": "To read them, I will first need to break that seal. It won't be easy... but I have a feeling it will be worth my efforts.",
"research/entry.thavma.thavma.thavma.page0.title": "Thavma",
"research/entry.thavma.thavma.thavma.page1.paragraph0": "I will document all my findings inside the book, so that I can recall them later.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"count": 1,
"id": "thavma:crucible"
},
"pages": [],
"pageFeatures": [],
"position": [
0,
0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,50 +7,93 @@
"count": 1,
"id": "minecraft:turtle_helmet"
},
"pages": [
"pageFeatures": [
{
"type": "thavma:text",
"paragraphs": [
{
"translate": "research/entry.thavma.story.story1.page0.paragraph0"
},
{
"translate": "research/entry.thavma.story.story1.page0.paragraph1"
}
],
"title": {
"type": "thavma:title",
"text": {
"bold": true,
"translate": "research/entry.thavma.story.story1.page0.title"
"translate": "research/entry.thavma.story.story1.title_feature0"
}
},
{
"type": "thavma:text",
"paragraphs": [
{
"translate": "research/entry.thavma.story.story1.page1.paragraph0"
},
{
"translate": "research/entry.thavma.story.story1.page1.paragraph1"
}
],
"title": {
"type": "thavma:paragraph",
"text": {
"translate": "research/entry.thavma.story.story1.paragraph_feature0"
}
},
{
"type": "thavma:paragraph",
"text": {
"translate": "research/entry.thavma.story.story1.paragraph_feature1"
}
},
{
"type": "thavma:figure",
"caption": {
"color": "dark_aqua",
"italic": true,
"translate": "research/entry.thavma.story.story1.figure_feature0"
},
"force_index": 1,
"image": {
"canvas_height": 101,
"canvas_width": 180,
"height": 101,
"location": "thavma:textures/gui/images/haybales.png",
"width": 180
}
},
{
"type": "thavma:title",
"text": {
"bold": true,
"translate": "research/entry.thavma.story.story1.page1.title"
"translate": "research/entry.thavma.story.story1.title_feature1"
}
},
{
"type": "thavma:paragraph",
"starts_page": true,
"text": {
"translate": "research/entry.thavma.story.story1.paragraph_feature2"
}
},
{
"type": "thavma:text",
"paragraphs": [
{
"translate": "research/entry.thavma.story.story1.page2.paragraph0"
},
{
"translate": "research/entry.thavma.story.story1.page2.paragraph1"
}
],
"title": {
"type": "thavma:title",
"text": {
"bold": true,
"translate": "research/entry.thavma.story.story1.page2.title"
"translate": "research/entry.thavma.story.story1.title_feature2"
}
},
{
"type": "thavma:title",
"force_index": 0,
"text": {
"bold": true,
"translate": "research/entry.thavma.story.story1.title_feature3"
}
},
{
"type": "thavma:paragraph",
"text": {
"translate": "research/entry.thavma.story.story1.paragraph_feature3"
}
},
{
"type": "thavma:figure",
"force_index": 2,
"image": {
"canvas_height": 77,
"canvas_width": 87,
"height": 77,
"location": "thavma:textures/gui/images/smileyface.png",
"width": 87
}
},
{
"type": "thavma:paragraph",
"force_index": 2,
"text": {
"translate": "research/entry.thavma.story.story1.paragraph_feature4"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"count": 1,
"id": "thavma:crucible"
},
"pages": [],
"pageFeatures": [],
"position": [
-2,
2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,26 +36,7 @@
"count": 1,
"id": "thavma:arcane_lens"
},
"pages": [
{
"type": "thavma:text",
"paragraphs": [
{
"translate": "research/entry.thavma.thavma.arcane_lens.page0.paragraph0"
},
{
"translate": "research/entry.thavma.thavma.arcane_lens.page0.paragraph1"
},
{
"translate": "research/entry.thavma.thavma.arcane_lens.page0.paragraph2"
}
],
"title": {
"bold": true,
"translate": "research/entry.thavma.thavma.arcane_lens.page0.title"
}
}
],
"pageFeatures": [],
"position": [
2,
-2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"count": 1,
"id": "thavma:infusion_matrix"
},
"pages": [],
"pageFeatures": [],
"position": [
2,
2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"count": 1,
"id": "thavma:aqua_shard"
},
"pages": [],
"pageFeatures": [],
"position": [
2,
-4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"count": 1,
"id": "thavma:research_table"
},
"pages": [],
"pageFeatures": [],
"position": [
-1,
-1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@
"count": 1,
"id": "thavma:research_table"
},
"pages": [
{
"type": "thavma:crafting",
"recipeRL": "minecraft:chest"
}
],
"pageFeatures": [],
"position": [
0,
0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"count": 1,
"id": "thavma:goggles"
},
"pages": [],
"pageFeatures": [],
"position": [
2,
4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,7 @@
"count": 1,
"id": "thavma:book"
},
"pages": [
{
"type": "thavma:text",
"paragraphs": [
{
"translate": "research/entry.thavma.thavma.thavma.page0.paragraph0"
},
{
"translate": "research/entry.thavma.thavma.thavma.page0.paragraph1"
},
{
"translate": "research/entry.thavma.thavma.thavma.page0.paragraph2"
}
],
"title": {
"bold": true,
"translate": "research/entry.thavma.thavma.thavma.page0.title"
}
},
{
"type": "thavma:text",
"paragraphs": [
{
"translate": "research/entry.thavma.thavma.thavma.page1.paragraph0"
}
]
}
],
"pageFeatures": [],
"position": [
0,
-6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"count": 1,
"id": "thavma:greatwood_log"
},
"pages": [],
"pageFeatures": [],
"position": [
0,
-3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"count": 1,
"id": "thavma:thavmite_silverwood_wand"
},
"pages": [],
"pageFeatures": [],
"position": [
-2,
4
Expand Down
1 change: 1 addition & 0 deletions src/main/java/me/alegian/thavma/impl/Thavma.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ object Thavma {
T7Attributes.REGISTRAR.register(KFF_MOD_BUS)
T7GlobalLootModifierSerializers.REGISTRAR.register(KFF_MOD_BUS)
PageTypes.REGISTRAR.register(KFF_MOD_BUS)
PageFeatureTypes.REGISTRAR.register(KFF_MOD_BUS)
T7Features.REGISTRAR.register(KFF_MOD_BUS)

registerCommonModEvents()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package me.alegian.thavma.impl.client.event

import me.alegian.thavma.impl.client.gui.book.PAGE_FEATURE_RENDERERS
import me.alegian.thavma.impl.client.gui.book.PageFeatureRenderer
import me.alegian.thavma.impl.common.book.PageFeature
import me.alegian.thavma.impl.common.book.PageFeatureType
import net.neoforged.bus.api.Event
import net.neoforged.fml.event.IModBusEvent

class RegisterPageFeatureRenderersEvent : Event(), IModBusEvent {
fun <T : PageFeature> register(pageFeatureType: PageFeatureType<T>, pageFeatureRenderer: PageFeatureRenderer<T>) {
PAGE_FEATURE_RENDERERS[pageFeatureType] = pageFeatureRenderer
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import me.alegian.thavma.impl.client.extension.ArcaneLensItemExtensions
import me.alegian.thavma.impl.client.extension.BEWLRItemExtensionFactory
import me.alegian.thavma.impl.client.extension.WandItemExtensions
import me.alegian.thavma.impl.client.gui.WorkbenchScreen
import me.alegian.thavma.impl.client.gui.book.CraftingPageRenderer
import me.alegian.thavma.impl.client.gui.book.TextPageRenderer
import me.alegian.thavma.impl.client.gui.book.*
import me.alegian.thavma.impl.client.gui.layer.ArcaneLensLayer
import me.alegian.thavma.impl.client.gui.layer.WandLayer
import me.alegian.thavma.impl.client.gui.research_table.ResearchScreen
Expand Down Expand Up @@ -42,6 +41,7 @@ import thedarkcolour.kotlinforforge.neoforge.forge.MOD_BUS as KFF_MOD_BUS

private fun clientSetup(event: FMLClientSetupEvent) {
ModLoader.postEvent(RegisterPageRenderersEvent())
ModLoader.postEvent(RegisterPageFeatureRenderersEvent())
ItemProperties.register(T7Items.RESEARCH_SCROLL.get(), T7ItemProperties.COMPLETED) { stack, level, entity, seed ->
val completed = stack.get(T7DataComponents.RESEARCH_STATE)?.completed ?: false
if (completed) 1f else 0f
Expand Down Expand Up @@ -226,6 +226,13 @@ private fun registerPageRenderers(event: RegisterPageRenderersEvent) {
event.register(PageTypes.CRAFTING.get(), CraftingPageRenderer)
}

private fun registerPageFeatureRenderers(event: RegisterPageFeatureRenderersEvent) {
event.register(PageFeatureTypes.PARAGRAPH.get(), ParagraphFeatureRenderer)
event.register(PageFeatureTypes.TITLE.get(), TitleFeatureRenderer)
event.register(PageFeatureTypes.FIGURE.get(), FigureFeatureRenderer)
event.register(PageFeatureTypes.RECIPE.get(), RecipeFeatureRenderer)
}

private fun registerKeyMappings(event: RegisterKeyMappingsEvent) {
event.register(T7KeyMappings.FOCI)
}
Expand All @@ -251,6 +258,7 @@ fun registerClientModEvents() {
KFF_MOD_BUS.addListener(::registerClientTooltipComponentFactories)
KFF_MOD_BUS.addListener(::registerScreens)
KFF_MOD_BUS.addListener(::registerPageRenderers)
KFF_MOD_BUS.addListener(::registerPageFeatureRenderers)
KFF_MOD_BUS.addListener(::registerKeyMappings)
KFF_MOD_BUS.addListener(::registerRenderBuffers)
}
Loading