Skip to content

Commit

Permalink
Added translations and recipes for dynamites
Browse files Browse the repository at this point in the history
Fixed missing texture for Plastic Plate
Added model for Enchantment Bookshelf
  • Loading branch information
Hiiragi283 committed Nov 18, 2024
1 parent 3619a7b commit ffff6e4
Show file tree
Hide file tree
Showing 27 changed files with 249 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/client/kotlin/hiiragi283/ragium/client/RagiumClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ object RagiumClient : ClientModInitializer {
ItemTooltipCallback.EVENT.register(
RagiumAPI.id("description"),
) { stack: ItemStack, _: Item.TooltipContext, _: TooltipType, tooltips: MutableList<Text> ->
stack.get(RagiumComponentTypes.DESCRIPTION)?.let(tooltips::add)
stack.get(RagiumComponentTypes.DESCRIPTION)?.forEach(tooltips::add)
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "ragium:block/enchantment_bookshelf"
}
}
}
3 changes: 3 additions & 0 deletions src/main/generated/assets/ragium/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"block.ragium.basic_hull": "Basic Hull",
"block.ragium.copper_pipe": "Copper Pipe",
"block.ragium.creative_source": "Creative Power Source",
"block.ragium.enchantment_bookshelf": "Enchantment Bookshelf",
"block.ragium.iron_pipe": "Iron Pipe",
"block.ragium.item_display": "Item Display",
"block.ragium.large_processor": "Large Processor",
Expand Down Expand Up @@ -89,6 +90,7 @@
"fluid.ragium.warped_sap": "Warped Sap",
"item.ragium.advanced_circuit": "Advanced Circuit",
"item.ragium.advanced_circuit_board": "Advanced Circuit Board",
"item.ragium.anvil_dynamite": "Anvil Dynamite",
"item.ragium.backpack": "Backpack",
"item.ragium.basalt_mesh": "Basalt Mesh",
"item.ragium.basic_circuit": "Basic Circuit",
Expand All @@ -110,6 +112,7 @@
"item.ragium.engine": "V8 Engine",
"item.ragium.engineering_plastic_plate": "Engineering Plastic Plate",
"item.ragium.filled_fluid_cube": "Fluid Cube (%s)",
"item.ragium.flattening_dynamite": "Flattening Dynamite",
"item.ragium.flour": "Flour",
"item.ragium.fluid_filter": "Fluid Filter",
"item.ragium.forge_hammer": "Forge Hammer",
Expand Down
3 changes: 3 additions & 0 deletions src/main/generated/assets/ragium/lang/ja_jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"block.ragium.basic_hull": "基本筐体",
"block.ragium.copper_pipe": "銅パイプ",
"block.ragium.creative_source": "クリエイティブ用エネルギー源",
"block.ragium.enchantment_bookshelf": "エンチャント本棚",
"block.ragium.iron_pipe": "鉄パイプ",
"block.ragium.item_display": "アイテムティスプレイ",
"block.ragium.large_processor": "大型処理装置",
Expand Down Expand Up @@ -89,6 +90,7 @@
"fluid.ragium.warped_sap": "歪んだ樹液",
"item.ragium.advanced_circuit": "発展回路",
"item.ragium.advanced_circuit_board": "発展回路基板",
"item.ragium.anvil_dynamite": "金床ダイナマイト",
"item.ragium.backpack": "バックパック",
"item.ragium.basalt_mesh": "玄武岩メッシュ",
"item.ragium.basic_circuit": "基本回路",
Expand All @@ -110,6 +112,7 @@
"item.ragium.engine": "V8エンジン",
"item.ragium.engineering_plastic_plate": "エンジニアリングプラスチック板",
"item.ragium.filled_fluid_cube": "液体キューブ(%s)",
"item.ragium.flattening_dynamite": "整地用ダイナマイト",
"item.ragium.flour": "小麦粉",
"item.ragium.fluid_filter": "液体フィルタ",
"item.ragium.forge_hammer": "鍛造ハンマー",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"parent": "minecraft:block/cube_column",
"textures": {
"end": "minecraft:block/chiseled_bookshelf_top",
"side": "ragium:block/enchantment_bookshelf"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "ragium:block/enchantment_bookshelf"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "ragium:item/plastic_plate"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_the_item": {
"conditions": {
"items": [
{
"items": "ragium:dynamite"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "ragium:shaped/bedrock_dynamite"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_the_item"
]
],
"rewards": {
"recipes": [
"ragium:shaped/bedrock_dynamite"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_the_item": {
"conditions": {
"items": [
{
"items": "ragium:dynamite"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "ragium:shaped/flattening_dynamite"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_the_item"
]
],
"rewards": {
"recipes": [
"ragium:shaped/flattening_dynamite"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_the_item": {
"conditions": {
"items": [
{
"items": "ragium:dynamite"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "ragium:shapeless/anvil_dynamite"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_the_item"
]
],
"rewards": {
"recipes": [
"ragium:shapeless/anvil_dynamite"
]
}
}
21 changes: 21 additions & 0 deletions src/main/generated/data/ragium/recipe/shaped/bedrock_dynamite.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"A": {
"item": "ragium:dynamite"
},
"B": {
"item": "minecraft:diamond_pickaxe"
}
},
"pattern": [
"AAA",
"ABA",
"AAA"
],
"result": {
"count": 8,
"id": "ragium:bedrock_dynamite"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"A": {
"item": "ragium:dynamite"
},
"B": {
"item": "minecraft:nether_star"
}
},
"pattern": [
"AAA",
"ABA",
"AAA"
],
"result": {
"count": 8,
"id": "ragium:flattening_dynamite"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "minecraft:crafting_shapeless",
"category": "misc",
"ingredients": [
{
"item": "ragium:dynamite"
},
{
"tag": "minecraft:anvil"
}
],
"result": {
"count": 1,
"id": "ragium:anvil_dynamite"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ import net.minecraft.util.BlockRotation
import net.minecraft.util.math.BlockPos
import net.minecraft.util.math.Direction

class HTExporterBlock(private val tier: HTMachineTier) :
HTBlockWithEntity(blockSettings().solid().nonOpaque().strength(2f, 6f)) {
class HTExporterBlock(private val tier: HTMachineTier) : HTBlockWithEntity(blockSettings().solid().nonOpaque().strength(2f, 6f)) {
init {
defaultState = stateManager.defaultState.with(Properties.FACING, Direction.NORTH)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package hiiragi283.ragium.common.block

import net.minecraft.block.Block
import net.minecraft.block.BlockState
import net.minecraft.block.PillarBlock
import net.minecraft.block.ShapeContext
Expand All @@ -12,13 +11,13 @@ import net.minecraft.world.BlockView
class HTThinPillarBlock(settings: Settings) : PillarBlock(settings) {
companion object {
@JvmField
val Y_SHAPE: VoxelShape = Block.createCuboidShape(4.0, 0.0, 4.0, 12.0, 16.0, 12.0)
val Y_SHAPE: VoxelShape = createCuboidShape(4.0, 0.0, 4.0, 12.0, 16.0, 12.0)

@JvmField
val Z_SHAPE: VoxelShape = Block.createCuboidShape(4.0, 4.0, 0.0, 12.0, 12.0, 16.0)
val Z_SHAPE: VoxelShape = createCuboidShape(4.0, 4.0, 0.0, 12.0, 12.0, 16.0)

@JvmField
val X_SHAPE: VoxelShape = Block.createCuboidShape(0.0, 4.0, 4.0, 16.0, 12.0, 12.0)
val X_SHAPE: VoxelShape = createCuboidShape(0.0, 4.0, 4.0, 16.0, 12.0, 12.0)
}

override fun getOutlineShape(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.mojang.serialization.codecs.RecordCodecBuilder
import hiiragi283.ragium.api.RagiumAPI
import hiiragi283.ragium.api.extension.fluidStorageOf
import hiiragi283.ragium.api.extension.longRangeCodec
import hiiragi283.ragium.api.extension.toList
import hiiragi283.ragium.api.machine.HTMachineKey
import hiiragi283.ragium.api.machine.HTMachineTier
import hiiragi283.ragium.api.material.HTMaterialKey
Expand Down Expand Up @@ -96,7 +97,8 @@ object RagiumComponentTypes {
registerUnit("damage_instead_of_decrease")

@JvmField
val DESCRIPTION: ComponentType<Text> = register("description", TextCodecs.CODEC, TextCodecs.PACKET_CODEC)
val DESCRIPTION: ComponentType<List<Text>> =
register("description", TextCodecs.CODEC.listOf(), TextCodecs.PACKET_CODEC.toList())

@JvmField
val FLUID: ComponentType<Fluid> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ object RagiumEventHandlers {
addDescription(
context,
RagiumBlocks.MANUAL_GRINDER,
Text.literal("Input ingredients by Hopper\nRight-click to process"),
Text.literal("Input ingredients by Hopper"),
Text.literal("Right-click to process"),
)
addDescription(
context,
Expand All @@ -162,17 +163,22 @@ object RagiumEventHandlers {
addDescription(
context,
RagiumItems.FLUID_FILTER,
Text.literal("Right-click Exporter to apply\nId format - modid:path\nTag format - #modid:path"),
Text.literal("Right-click Exporter to apply"),
Text.literal("Id format - modid:path"),
Text.literal("Tag format - #modid:path"),
)
addDescription(
context,
RagiumItems.ITEM_FILTER,
Text.literal("Right-click Exporter to apply\nId format - modid:path\nTag format - #modid:path"),
Text.literal("Right-click Exporter to apply"),
Text.literal("Id format - modid:path"),
Text.literal("Tag format - #modid:path"),
)
addDescription(
context,
RagiumItems.WARPED_CRYSTAL,
Text.literal("Click on Teleport Anchor to link\nTeleport on the Anchor by right-clicking"),
Text.literal("Click on Teleport Anchor to link"),
Text.literal("Teleport on the Anchor by right-clicking"),
)
}

Expand Down Expand Up @@ -243,7 +249,9 @@ object RagiumEventHandlers {
true -> {
if (Properties.FACING in state) {
state.with(Properties.FACING, result.side)
} else state
} else {
state
}
}

false -> state.rotate(BlockRotation.COUNTERCLOCKWISE_90)
Expand All @@ -260,9 +268,9 @@ object RagiumEventHandlers {
}

@JvmStatic
private fun addDescription(context: DefaultItemComponentEvents.ModifyContext, item: ItemConvertible, text: MutableText) {
private fun addDescription(context: DefaultItemComponentEvents.ModifyContext, item: ItemConvertible, vararg texts: MutableText) {
context.modify(item.asItem()) {
it.add(RagiumComponentTypes.DESCRIPTION, text.formatted(Formatting.AQUA))
it.add(RagiumComponentTypes.DESCRIPTION, texts.map { it.formatted(Formatting.AQUA) })
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ object RagiumItems {
FLATTENING_DYNAMITE,
HEART_OF_THE_NETHER,
LASER_EMITTER,
PLASTIC_PLATE,
POLYMER_RESIN,
PROCESSOR_SOCKET,
RAGI_ALLOY_COMPOUND,
Expand Down
Loading

0 comments on commit ffff6e4

Please sign in to comment.