Skip to content

Commit

Permalink
feat: added basic MythicMetals and Adabranium mod support #8
Browse files Browse the repository at this point in the history
  • Loading branch information
JR1811 committed Jun 28, 2023
1 parent e6e024e commit 07c75eb
Show file tree
Hide file tree
Showing 60 changed files with 431 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.19.4 2023-06-23T22:45:33.492314037 Throwing Knives/Language (en_us)
d11e28310f615a0f4274f63ee84206fe6a59ab48 assets/throwing-knives/lang/en_us.json
// 1.19.4 2023-06-28T02:47:52.0631596 Throwing Knives/Language (en_us)
400a04d3b8e29ccf5d9b0efb2a904871c2e60c9f assets\throwing-knives\lang\en_us.json
35 changes: 30 additions & 5 deletions src/main/generated/.cache/78d49ba0af7eafbee43b07d4078739427f798f53
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
// 1.19.4 2023-06-23T22:45:33.492091928 Throwing Knives/Model Definitions
a6d2ea9376fcbaba396c109f76f3155a9d46d45a assets/throwing-knives/models/item/netherite_throwing_knife.json
a7b7b50d927d2ee7d0391f3ea10dcf1e78bc06b3 assets/throwing-knives/models/item/gold_throwing_knife.json
cee1f6ab7a3d70414495070899ca27862e95ddb4 assets/throwing-knives/models/item/iron_throwing_knife.json
e02d935385738e3b304caa36d419bc00d3a10243 assets/throwing-knives/models/item/diamond_throwing_knife.json
// 1.19.4 2023-06-28T02:47:52.0611645 Throwing Knives/Model Definitions
e02d935385738e3b304caa36d419bc00d3a10243 assets\throwing-knives\models\item\diamond_throwing_knife.json
ab1a4ba9aae358e6588eee337b88613b62c20d4e assets\throwing-knives\models\item\mythicmetals\quadrillum_throwing_knife.json
2f2cdb9bb1b4759748438428d1835736710b3a91 assets\throwing-knives\models\item\adabraniummod\adamantium_throwing_knife.json
279ffe0db056911153d7a6bceaf7e394171f89d9 assets\throwing-knives\models\item\mythicmetals\orichalcum_throwing_knife.json
c039d412f97c44c4e424a75214a0e2a7925e4688 assets\throwing-knives\models\item\mythicmetals\palladium_throwing_knife.json
6d44fe7c7c8fe9b4dc1e30ba1a015d51953b322d assets\throwing-knives\models\item\mythicmetals\metallurgium_throwing_knife.json
eda6d79b46ce10d8697170618b80df1ad930822b assets\throwing-knives\models\item\mythicmetals\hallowed_throwing_knife.json
81426476b1f284709ae870288db5669fbf16217c assets\throwing-knives\models\item\mythicmetals\osmium_throwing_knife.json
94e7bcf19f9c3a28bf1c8d158f334fb508910812 assets\throwing-knives\models\item\mythicmetals\mythril_throwing_knife.json
52e54fc28c4651cf46c0254e3bb1680d5798fbc2 assets\throwing-knives\models\item\mythicmetals\stormyx_throwing_knife.json
d5f72b50fd7031ff3b41b26d39fc2cf2349572ea assets\throwing-knives\models\item\adabraniummod\nether_throwing_knife.json
89538b9bcde00007494cb5ec55a5ea9391211a25 assets\throwing-knives\models\item\mythicmetals\prometheum_throwing_knife.json
aac224357177eeed59fd1360735d8e4846422f4d assets\throwing-knives\models\item\mythicmetals\kyber_throwing_knife.json
6aefb86e93f42500e2ba35d455f59dc85306ef5c assets\throwing-knives\models\item\mythicmetals\durasteel_throwing_knife.json
27fb8a7c350de8d81bb171ae0f92258ef77fd4b2 assets\throwing-knives\models\item\mythicmetals\bronze_throwing_knife.json
a765f0297e5babaf2bef98c8d982bb252502d6a2 assets\throwing-knives\models\item\mythicmetals\copper_throwing_knife.json
8862648b3916fa8b00e5c7df473cf3af205a399b assets\throwing-knives\models\item\mythicmetals\midas_gold_throwing_knife.json
1465f67f262640eff74a39fb62c8961eff8b82e6 assets\throwing-knives\models\item\mythicmetals\star_platinum_throwing_knife.json
06a303848f264fdb29eec06907f771b1921c69db assets\throwing-knives\models\item\mythicmetals\carmot_throwing_knife.json
f03a72866a01e55fca8d763731519c4b96e3e1f9 assets\throwing-knives\models\item\mythicmetals\celestium_throwing_knife.json
a6d2ea9376fcbaba396c109f76f3155a9d46d45a assets\throwing-knives\models\item\netherite_throwing_knife.json
49459f46f4c23ffa5ed739df5f7d20928df16d07 assets\throwing-knives\models\item\mythicmetals\aquarium_throwing_knife.json
cee1f6ab7a3d70414495070899ca27862e95ddb4 assets\throwing-knives\models\item\iron_throwing_knife.json
89c70c6509c78c51ae7b1c5c8ed957d2887806d0 assets\throwing-knives\models\item\mythicmetals\runite_throwing_knife.json
18fc67b2c5631c1ac594d9515d10c8f35f567c90 assets\throwing-knives\models\item\adabraniummod\vibranium_throwing_knife.json
6ee27c58ca3d589d6647dccd918230d1dc065491 assets\throwing-knives\models\item\mythicmetals\steel_throwing_knife.json
a7b7b50d927d2ee7d0391f3ea10dcf1e78bc06b3 assets\throwing-knives\models\item\gold_throwing_knife.json
94b387e224b80043c963d348f2a2cf072cf79e40 assets\throwing-knives\models\item\mythicmetals\banglum_throwing_knife.json
97e1fc983bd872866c2b452621d78f5f9b5e1e9f assets\throwing-knives\models\item\mythicmetals\adamantite_throwing_knife.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.19.4 2023-06-23T22:45:33.49158096 Throwing Knives/Tags for minecraft:block
064306c68b58a57993aa50d377d78df040ced9d3 data/throwing-knives/tags/blocks/soft_blocks.json
// 1.19.4 2023-06-28T02:47:52.0601675 Throwing Knives/Tags for minecraft:block
064306c68b58a57993aa50d377d78df040ced9d3 data\throwing-knives\tags\blocks\soft_blocks.json
25 changes: 25 additions & 0 deletions src/main/generated/assets/throwing-knives/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
{
"entity.throwing-knives.thrown_knife": "Thrown Knife",
"item.throwing-knives.adabraniummod.adamantium_throwing_knife": "Adamantium Throwing Knife",
"item.throwing-knives.adabraniummod.nether_throwing_knife": "Nether Throwing Knife",
"item.throwing-knives.adabraniummod.vibranium_throwing_knife": "Vibranium Throwing Knife",
"item.throwing-knives.diamond_throwing_knife": "Diamond Throwing Knife",
"item.throwing-knives.gold_throwing_knife": "Gold Throwing Knife",
"item.throwing-knives.iron_throwing_knife": "Iron Throwing Knife",
"item.throwing-knives.mythicmetals.adamantite_throwing_knife": "Adamantite Throwing Knife",
"item.throwing-knives.mythicmetals.aquarium_throwing_knife": "Aquarium Throwing Knife",
"item.throwing-knives.mythicmetals.banglum_throwing_knife": "Banglum Throwing Knife",
"item.throwing-knives.mythicmetals.bronze_throwing_knife": "Bronze Throwing Knife",
"item.throwing-knives.mythicmetals.carmot_throwing_knife": "Carmot Throwing Knife",
"item.throwing-knives.mythicmetals.celestium_throwing_knife": "Celestium Throwing Knife",
"item.throwing-knives.mythicmetals.copper_throwing_knife": "Copper Throwing Knife",
"item.throwing-knives.mythicmetals.durasteel_throwing_knife": "Durasteel Throwing Knife",
"item.throwing-knives.mythicmetals.hallowed_throwing_knife": "Hallowed Throwing Knife",
"item.throwing-knives.mythicmetals.kyber_throwing_knife": "Kyber Throwing Knife",
"item.throwing-knives.mythicmetals.metallurgium_throwing_knife": "Metallurgium Throwing Knife",
"item.throwing-knives.mythicmetals.midas_gold_throwing_knife": "Midas Gold Throwing Knife",
"item.throwing-knives.mythicmetals.mythril_throwing_knife": "Mythril Throwing Knife",
"item.throwing-knives.mythicmetals.orichalcum_throwing_knife": "Orichalcum Throwing Knife",
"item.throwing-knives.mythicmetals.osmium_throwing_knife": "Osmium Throwing Knife",
"item.throwing-knives.mythicmetals.palladium_throwing_knife": "Palladium Throwing Knife",
"item.throwing-knives.mythicmetals.prometheum_throwing_knife": "Prometheum Throwing Knife",
"item.throwing-knives.mythicmetals.quadrillum_throwing_knife": "Quadrillum Throwing Knife",
"item.throwing-knives.mythicmetals.runite_throwing_knife": "Runite Throwing Knife",
"item.throwing-knives.mythicmetals.star_platinum_throwing_knife": "Star Platinum Throwing Knife",
"item.throwing-knives.mythicmetals.steel_throwing_knife": "Steel Throwing Knife",
"item.throwing-knives.mythicmetals.stormyx_throwing_knife": "Stormyx Throwing Knife",
"item.throwing-knives.netherite_throwing_knife": "Netherite Throwing Knife",
"sound.throwing-knives.knife_hit": "Hit hard surface"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/adabraniummod/adamantium_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/adabraniummod/nether_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/adabraniummod/vibranium_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/adamantite_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/aquarium_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/banglum_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/bronze_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/carmot_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/celestium_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/copper_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/durasteel_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/hallowed_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/kyber_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/metallurgium_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/midas_gold_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/mythril_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/orichalcum_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/osmium_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/palladium_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/prometheum_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/quadrillum_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/runite_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/star_platinum_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/steel_throwing_knife"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "throwing-knives:item/mythicmetals/stormyx_throwing_knife"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ package io.github.joemama.throwing.knives

import io.github.joemama.throwing.knives.entity.ThrownKnifeEntity
import io.github.joemama.throwing.knives.item.ThrowingKnifeItem
import io.github.joemama.throwing.knives.support.AdabraniumSupport
import io.github.joemama.throwing.knives.support.MythicMetalsSupport
import net.fabricmc.api.ModInitializer
import net.fabricmc.fabric.api.event.player.UseEntityCallback
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents
import net.fabricmc.fabric.api.`object`.builder.v1.entity.FabricEntityTypeBuilder
import net.fabricmc.loader.api.FabricLoader
import net.minecraft.block.Block
import net.minecraft.entity.EntityDimensions
import net.minecraft.entity.EntityType
Expand Down Expand Up @@ -51,10 +54,21 @@ object ThrowingKnives : ModInitializer {
val SOFT_BLOCKS: TagKey<Block> = TagKey.of(RegistryKeys.BLOCK, mkId("soft_blocks"))

override fun onInitialize() {
Registry.register(Registries.ITEM, mkId("diamond_throwing_knife"), DIAMOND_THROWING_KNIFE)
Registry.register(Registries.ITEM, mkId("iron_throwing_knife"), IRON_THROWING_KNIFE)
Registry.register(Registries.ITEM, mkId("gold_throwing_knife"), GOLD_THROWING_KNIFE)
Registry.register(Registries.ITEM, mkId("diamond_throwing_knife"), DIAMOND_THROWING_KNIFE)
Registry.register(Registries.ITEM, mkId("netherite_throwing_knife"), NETHERITE_THROWING_KNIFE)

// comment out "if statements" when using datagen task
if (FabricLoader.getInstance().isModLoaded(MythicMetalsSupport.MODID)) {
MythicMetalsSupport.register()
loggedModSupport(MythicMetalsSupport.MODID)
}
if (FabricLoader.getInstance().isModLoaded(AdabraniumSupport.MODID)) {
AdabraniumSupport.register()
loggedModSupport(AdabraniumSupport.MODID)
}

Registry.register(Registries.ENTITY_TYPE, mkId("thrown_knife"), THROWN_KNIFE)
Registry.register(Registries.SOUND_EVENT, mkId("knife_hit_hard"), KNIFE_HIT_HARD)
ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register {
Expand All @@ -80,6 +94,10 @@ object ThrowingKnives : ModInitializer {

this.logger.info("Fully initialized Throwing Knives")
}

private fun loggedModSupport(externalModId: String) {
logger.info("Recognized $externalModId mod for Throwing Knives")
}
}

fun mkId(path: String): Identifier = Identifier(ThrowingKnives.MODID, path)
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io.github.joemama.throwing.knives.data

import io.github.joemama.throwing.knives.ThrowingKnives
import io.github.joemama.throwing.knives.support.AdabraniumDatagen
import io.github.joemama.throwing.knives.support.MythicMetalsDatagen
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput
Expand Down Expand Up @@ -45,6 +47,9 @@ object ThrowingKnivesDatagen : DataGeneratorEntrypoint {
items.register(ThrowingKnives.IRON_THROWING_KNIFE, Models.GENERATED)
items.register(ThrowingKnives.GOLD_THROWING_KNIFE, Models.GENERATED)
items.register(ThrowingKnives.NETHERITE_THROWING_KNIFE, Models.GENERATED)
MythicMetalsDatagen.generateItemModels(items)
AdabraniumDatagen.generateItemModels(items)

}
}

Expand All @@ -56,6 +61,8 @@ object ThrowingKnivesDatagen : DataGeneratorEntrypoint {
builder.add(ThrowingKnives.NETHERITE_THROWING_KNIFE, "Netherite Throwing Knife")
builder.add(ThrowingKnives.THROWN_KNIFE, "Thrown Knife")
builder.add("sound.throwing-knives.knife_hit", "Hit hard surface")
MythicMetalsDatagen.generateTranslations(builder)
AdabraniumDatagen.generateTranslations(builder)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package io.github.joemama.throwing.knives.support

import net.fabricmc.fabric.api.datagen.v1.provider.FabricLanguageProvider
import net.minecraft.data.client.ItemModelGenerator
import net.minecraft.data.client.Models

object AdabraniumDatagen {
fun generateItemModels(items: ItemModelGenerator) {
items.register(AdabraniumSupport.ADAMANTIUM_THROWING_KNIFE, Models.GENERATED)
items.register(AdabraniumSupport.NETHER_THROWING_KNIFE, Models.GENERATED)
items.register(AdabraniumSupport.VIBRANIUM_THROWING_KNIFE, Models.GENERATED)
}

fun generateTranslations(builder: FabricLanguageProvider.TranslationBuilder) {
val itemSuffix = "Throwing Knife"

builder.add(AdabraniumSupport.ADAMANTIUM_THROWING_KNIFE, "Adamantium $itemSuffix")
builder.add(AdabraniumSupport.NETHER_THROWING_KNIFE, "Nether $itemSuffix")
builder.add(AdabraniumSupport.VIBRANIUM_THROWING_KNIFE, "Vibranium $itemSuffix")
}
}
Loading

0 comments on commit 07c75eb

Please sign in to comment.