generated from TeamGensouSpark/LunarCapitalFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
165 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"java.compile.nullAnalysis.mode": "automatic" | ||
} |
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
5 changes: 5 additions & 0 deletions
5
src/main/java/io/github/teamgensouspark/kekkai/interfaces/IHasModel.java
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package io.github.teamgensouspark.kekkai.interfaces; | ||
|
||
public interface IHasModel { | ||
public void registerModels(); | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/io/github/teamgensouspark/kekkai/item/ItemBase.java
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.github.teamgensouspark.kekkai.item; | ||
|
||
import io.github.teamgensouspark.kekkai.Kekkai; | ||
import io.github.teamgensouspark.kekkai.interfaces.IHasModel; | ||
import io.github.teamgensouspark.kekkai.register.RegisterInit; | ||
import net.minecraft.creativetab.CreativeTabs; | ||
import net.minecraft.item.Item; | ||
|
||
public class ItemBase extends Item implements IHasModel { | ||
|
||
public ItemBase(String name,CreativeTabs tab){ | ||
setTranslationKey(name); | ||
setRegistryName(name); | ||
setCreativeTab(tab); | ||
|
||
RegisterInit.ITEMS.add(this); | ||
} | ||
@Override | ||
public void registerModels() { | ||
Kekkai.proxy.registerItemRenderer(this, 0, "inventory"); | ||
} | ||
|
||
} |
7 changes: 3 additions & 4 deletions
7
src/main/java/io/github/teamgensouspark/kekkai/proxy/Const.java
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,9 +1,8 @@ | ||
package io.github.teamgensouspark.kekkai.proxy; | ||
|
||
public class Const { | ||
public static String MODID = "kekkai"; | ||
public static String VERSION = "1.0.0"; | ||
public static String NAME = "Kekkai"; | ||
|
||
public static final String MODID = "kekkai"; | ||
public static final String VERSION = "1.0.0"; | ||
public static final String NAME = "Kekkai"; | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/io/github/teamgensouspark/kekkai/register/RegisterHandle.java
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.github.teamgensouspark.kekkai.register; | ||
|
||
import io.github.teamgensouspark.kekkai.interfaces.IHasModel; | ||
import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.Spellcard; | ||
import net.minecraft.item.Item; | ||
import net.minecraftforge.client.event.ModelRegistryEvent; | ||
import net.minecraftforge.event.RegistryEvent; | ||
import net.minecraftforge.fml.common.Mod.EventBusSubscriber; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
|
||
@EventBusSubscriber | ||
public class RegisterHandle { | ||
|
||
public static void preInitRegistries(){ | ||
} | ||
|
||
@SubscribeEvent | ||
public static void onItemRegister(RegistryEvent.Register<Item> event) { | ||
event.getRegistry().registerAll(RegisterInit.ITEMS.toArray(new Item[0])); | ||
} | ||
@SubscribeEvent | ||
public static void onSpellCardRegister(RegistryEvent.Register<Spellcard> event){ | ||
event.getRegistry().registerAll(RegisterInit.SPELL_CARDS.toArray(new Spellcard[0])); | ||
} | ||
|
||
@SubscribeEvent | ||
public static void onModelRegister(ModelRegistryEvent event) { | ||
for(Item item : RegisterInit.ITEMS){ | ||
if(item instanceof IHasModel) { | ||
((IHasModel)item).registerModels(); | ||
} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/io/github/teamgensouspark/kekkai/register/RegisterInit.java
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.github.teamgensouspark.kekkai.register; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.Spellcard; | ||
import net.minecraft.item.Item; | ||
|
||
public class RegisterInit { | ||
public static final List<Spellcard> SPELL_CARDS = new ArrayList<>(); | ||
public static final List<Item> ITEMS = new ArrayList<>(); | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/io/github/teamgensouspark/kekkai/spellcard/Generator.java
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package io.github.teamgensouspark.kekkai.spellcard; | ||
|
||
public class Generator { | ||
|
||
} |
78 changes: 78 additions & 0 deletions
78
src/main/java/io/github/teamgensouspark/kekkai/spellcard/SpellCardBase.java
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
package io.github.teamgensouspark.kekkai.spellcard; | ||
|
||
import java.lang.reflect.Constructor; | ||
|
||
import io.github.teamgensouspark.kekkai.Kekkai; | ||
import net.katsstuff.teamnightclipse.danmakucore.entity.living.TouhouCharacter; | ||
import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.EntitySpellcard; | ||
import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.Spellcard; | ||
import net.katsstuff.teamnightclipse.danmakucore.entity.spellcard.SpellcardEntity; | ||
import net.minecraft.entity.EntityLivingBase; | ||
import scala.Option; | ||
|
||
public class SpellCardBase<T extends SpellcardEntity> extends Spellcard { | ||
int level = 1; | ||
int removeTime = 50; | ||
int endTime = 50; | ||
String name; | ||
TouhouCharacter character; | ||
Class<T> spellcard; | ||
public SpellCardBase (String name,Class<T> spellcard,TouhouCharacter character){ | ||
super(name); | ||
this.name=name; | ||
this.character=character; | ||
this.spellcard=spellcard; | ||
|
||
//ModSpellCard.SPELL_CARDS.add(this); | ||
} | ||
|
||
@Override | ||
public SpellcardEntity instantiate(EntitySpellcard entitySpellcard, Option<EntityLivingBase> target) { | ||
try { | ||
Constructor<T> constructor = this.spellcard.getDeclaredConstructor(Spellcard.class,EntitySpellcard.class,Option.class); | ||
constructor.setAccessible(true); | ||
return constructor.newInstance(this,entitySpellcard,target); | ||
} catch (Exception e) { | ||
Kekkai.logger.error("Reflect Failed"); | ||
return new SpellcardEntity(this,entitySpellcard,target) { | ||
@Override | ||
public void onSpellcardUpdate() {} | ||
}; | ||
} | ||
} | ||
|
||
@Override | ||
public int level() { | ||
return this.level; | ||
} | ||
|
||
public Spellcard setlevel(int level){ | ||
this.level=level; | ||
return this; | ||
} | ||
|
||
@Override | ||
public int removeTime() { | ||
return this.removeTime; | ||
} | ||
|
||
public Spellcard setremoveTime(int removeTime){ | ||
this.removeTime=removeTime; | ||
return this; | ||
} | ||
|
||
@Override | ||
public int endTime() { | ||
return this.endTime; | ||
} | ||
|
||
public Spellcard setendTime(int endTime){ | ||
this.endTime=endTime; | ||
return this; | ||
} | ||
|
||
@Override | ||
public TouhouCharacter touhouUser() { | ||
return this.character; | ||
} | ||
} |
File renamed without changes.