Skip to content

Commit

Permalink
fix Model Missing
Browse files Browse the repository at this point in the history
  • Loading branch information
H2Sxxa committed Jul 22, 2023
1 parent 7d627a4 commit 16c39ab
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/main/java/io/github/teamgensouspark/kekkai/Kekkai.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import io.github.teamgensouspark.kekkai.example.MySpellCards;
import io.github.teamgensouspark.kekkai.proxy.CommonProxy;
import io.github.teamgensouspark.kekkai.spellcard.SpellCardModelHelper;

@Mod(
modid = Consts.MODID,
Expand All @@ -25,6 +26,7 @@ public class Kekkai {
public static void PreInit(FMLPreInitializationEvent event)
{
logger=event.getModLog();
SpellCardModelHelper.initSpellCardBake();
MySpellCards.initSpellCard();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.teamgensouspark.kekkai.example;


import io.github.teamgensouspark.kekkai.Kekkai;
import io.github.teamgensouspark.kekkai.danmaku.DanmakuHelper;
import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.EntitySpellcard;
import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.Spellcard;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@

import io.github.teamgensouspark.kekkai.Consts;
import io.github.teamgensouspark.kekkai.character.TouhouExCharacter;
import io.github.teamgensouspark.kekkai.spellcard.SpellCardBase;
import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.Spellcard;
import net.katsstuff.teamnightclipse.danmakucore.item.ItemSpellcard;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
Expand All @@ -29,4 +25,5 @@ public static void initSpellCard() {
public static void onSpellCardRegister(RegistryEvent.Register<Spellcard> event) {
event.getRegistry().registerAll(SPELL_CARDS.toArray(new Spellcard[0]));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public SpellCardBase (String name,Class<T> spellcard,TouhouCharacter character){
this.name=name;
this.character=character;
this.spellcard=spellcard;
SpellCardModelHelper.BAKE_SPELLCARDS.add(this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package io.github.teamgensouspark.kekkai.spellcard;

import java.util.ArrayList;
import java.util.List;

import io.github.teamgensouspark.kekkai.Consts;
import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.Spellcard;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

@EventBusSubscriber(modid = Consts.MODID)
public class SpellCardModelHelper {
public static void initSpellCardBake() {
};

public static final List<Spellcard> BAKE_SPELLCARDS = new ArrayList<>();
public static final Item SPELLCARD_HELPER = new Item().setTranslationKey("spellcard_helper")
.setRegistryName(Consts.MODID, "spellcard_helper").setCreativeTab(null);

@SubscribeEvent
public static void onItemRegister(RegistryEvent.Register<Item> event) {
event.getRegistry().registerAll(
SPELLCARD_HELPER);
}

@SubscribeEvent
public static void onModelRegister(ModelRegistryEvent event) {
for (Spellcard sp : BAKE_SPELLCARDS) {
ModelLoader.setCustomModelResourceLocation(SPELLCARD_HELPER, 0, sp.itemModel());
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "kekkai:items/spellcard/example_card"
}
}
{
"parent": "danmakucore:item/danmaku/spellcard/spellcard_base",
"textures": {
"1": "kekkai:items/spellcard/example_card"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 16c39ab

Please sign in to comment.