Skip to content

Commit

Permalink
Cleaning up
Browse files Browse the repository at this point in the history
-Add registry handler and revamp how recipes are registered
-Add creative tab
-Implement crimson fabric and crimson plates
-Lots of recipe changes
  • Loading branch information
IcarussOne committed May 16, 2024
1 parent ce99933 commit a9b2219
Show file tree
Hide file tree
Showing 10 changed files with 349 additions and 221 deletions.
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
package com.mobiusflip.crimsonrevelations;

import net.minecraft.util.ResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import org.apache.logging.log4j.Logger;

import com.mobiusflip.crimsonrevelations.recipes.CrimsonRecipes;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchCategories;
import com.mobiusflip.crimsonrevelations.init.CRCreativeTabs;
import com.mobiusflip.crimsonrevelations.init.ResearchHandler;

@Mod(modid = CrimsonRevelations.MODID, name = CrimsonRevelations.NAME, version = CrimsonRevelations.VERSION, dependencies = CrimsonRevelations.DEPENDENCIES)
public class CrimsonRevelations {
public static final String MODID = "crimsonrevelations";
public static final String NAME = "New Crimson Revelations";
public static final String VERSION = "1.0";
public static final String DEPENDENCIES = "required-after:thaumcraft@[1.12.2-6.1.BETA26,);after:thaumicaugmentation";

private static Logger logger;
public static final CreativeTabs tabCR = new CRCreativeTabs(CreativeTabs.CREATIVE_TAB_ARRAY.length, "CrimsonRevelationsTab");

@EventHandler
public void preInit(FMLPreInitializationEvent event) {
logger = event.getModLog();
event.getModLog();
}

@EventHandler
public void init(FMLInitializationEvent event) {
CrimsonRecipes.initRecipes();
ResearchCategories.registerCategory("REVELATIONS", "CrimsonRites", new AspectList(), new ResourceLocation("thaumcraft", "textures/items/crimson_rites.png"), new ResourceLocation("crimsonrevelations", "textures/gui/research_background.jpg"), new ResourceLocation("thaumcraft", "textures/gui/gui_research_back_over.png"));
ThaumcraftApi.registerResearchLocation(new ResourceLocation("crimsonrevelations", "research/revelations"));
ResearchHandler.init();
}

@EventHandler
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.mobiusflip.crimsonrevelations.init;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import thaumcraft.api.items.ItemsTC;

public class CRCreativeTabs extends CreativeTabs {
public CRCreativeTabs(int length, String name) {
super(length, name);
}

@Override
@SideOnly(Side.CLIENT)
public ItemStack createIcon() {
return new ItemStack(ItemsTC.curio, 1, 6);
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package com.mobiusflip.crimsonrevelations.init;

import javax.annotation.Nonnull;

import com.google.common.base.Preconditions;
import com.mobiusflip.crimsonrevelations.CrimsonRevelations;

import net.minecraft.block.Block;
import net.minecraft.block.BlockDoor;
import net.minecraft.block.BlockSlab;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
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;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.registries.IForgeRegistry;
import net.minecraftforge.registries.IForgeRegistryEntry;

@SuppressWarnings("deprecation")
@EventBusSubscriber(modid = CrimsonRevelations.MODID)
@GameRegistry.ObjectHolder(CrimsonRevelations.MODID)
public class RegistryHandler {
@GameRegistry.ObjectHolder("crimson_fabric")
public static Item crimsonFabric;
@GameRegistry.ObjectHolder("crimson_plate")
public static Item crimsonPlate;

@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
event.getRegistry().registerAll(
setup(new Item(), "crimson_fabric"),
setup(new Item(), "crimson_plate")
);
}

@SubscribeEvent
public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
RecipeHandler.initArcaneCrafting();
RecipeHandler.initCrucible();
RecipeHandler.initInfusion();
}

@SubscribeEvent
public static void registerItemBlocks(RegistryEvent.Register<Item> event) {
final IForgeRegistry<Item> registry = event.getRegistry();
ForgeRegistries.BLOCKS.getValues().stream()
.filter(block -> block.getRegistryName().getNamespace().equals(CrimsonRevelations.MODID))
.filter(block -> !(block instanceof BlockDoor)) // Doors should not have an item block registered
.filter(block -> !(block instanceof BlockSlab)) // Slabs should not have an item block registered
.forEach(block -> registry.register(setup(new ItemBlock(block), block.getRegistryName())));
}

@SideOnly(Side.CLIENT)
@SubscribeEvent
public static void registerModels(ModelRegistryEvent event) {
for (Item item : ForgeRegistries.ITEMS.getValues()) {
if (item.getRegistryName().getNamespace().equals(CrimsonRevelations.MODID)) {
ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "normal"));
}
}
}

@Nonnull
public static <T extends IForgeRegistryEntry<T>> T setup(T entry, String name) {
return setup(entry, new ResourceLocation(CrimsonRevelations.MODID, name));
}

@Nonnull
public static <T extends IForgeRegistryEntry<T>> T setup(T entry, ResourceLocation registryName) {
Preconditions.checkNotNull(entry, "Entry to setup must not be null!");
Preconditions.checkNotNull(registryName, "Registry name to assign must not be null!");
entry.setRegistryName(registryName);
if (entry instanceof Block) {
((Block) entry).setTranslationKey(registryName.getNamespace() + "." + registryName.getPath()).setCreativeTab(CrimsonRevelations.tabCR);
}
if (entry instanceof Item) {
((Item) entry).setTranslationKey(registryName.getNamespace() + "." + registryName.getPath()).setCreativeTab(CrimsonRevelations.tabCR);
}
return entry;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package com.mobiusflip.crimsonrevelations.init;

import com.mobiusflip.crimsonrevelations.CrimsonRevelations;

import net.minecraft.util.ResourceLocation;
import thaumcraft.Thaumcraft;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchCategories;

public class ResearchHandler {
public static void init() {
ResearchCategories.registerCategory("REVELATIONS", "CrimsonRites", new AspectList(), new ResourceLocation(Thaumcraft.MODID, "textures/items/crimson_rites.png"), new ResourceLocation(CrimsonRevelations.MODID, "textures/gui/research_background.jpg"), new ResourceLocation(Thaumcraft.MODID, "textures/gui/gui_research_back_over.png"));
ThaumcraftApi.registerResearchLocation(new ResourceLocation(CrimsonRevelations.MODID, "research/revelations"));
}
}
9 changes: 7 additions & 2 deletions src/main/resources/assets/crimsonrevelations/lang/en_us.lang
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
itemGroup.CrimsonRevelationsTab=New Crimson Revelations

item.crimsonrevelations.crimson_fabric.name=Crimson Fabric
item.crimsonrevelations.crimson_plate.name=Crimson Plate

tc.research_category.REVELATIONS=Revelations

crimsonrevelations.research.CRIMSON_REVELATIONS.title=Crimson Revelations
crimsonrevelations.research.CRIMSON_REVELATIONS.text.stage.1=While most of the Cultists' book is written in an unintelligible script, there are patterns in the symbols which suggest I might be able to translate a bit more than I first thought. That's not to say it will be an easy task, but I may know where to start.<BR>On close inspection, the markings on the cult's banners bear a strong resemblance to certain thaumaturgical sigils. Maybe their meanings will become clear as I expand my thaumaturgical knowledge?<BR>In the meantime, I've spent so long studying the banners that it would be easy to make a few of my own with the same fabric material used for the Cultists' armor. The crimson plates in particular are already fairly similar to the symbols on the banner, so I just need to repurpose one and use vis to work it into the fabric.

crimsonrevelations.research.ANCIENT_STONE.title=Ancient Stone
crimsonrevelations.research.ANCIENT_STONE.text.stage.1=Upon translating more of the Crimson Rites, "Apertis Oculis" seems to be the creation of a portal to another dimension. The Cultists describe it as an eldritch labyrinth made of strange, ancient stonework and inhabited by monstrous guardians.<BR>My studies into thaumaturgy lead me to believe that this dimension, if it ever existed, can no longer be accessed. However, the labyrinth's stonework is said to have interesting properties which may be worth replicating.
crimsonrevelations.research.ANCIENT_STONE.text.stage.2=By allowing Arcane Stone to mix with raw Terra and Alienis in a crucible, I've created something very close to the ancient stone described in the Crimson Rites. The newly-created Ancient Stone can also be made into larger tiles or inscribed with arcane runes, just for aesthetic purposes.
crimsonrevelations.research.ANCIENT_STONE.text.stage.2=By allowing Arcane Stone to mix with raw Alienis in a crucible, I've created something very close to the ancient stone described in the Crimson Rites. The newly-created Ancient Stone can also be made into tiles or inscribed with arcane runes, just for aesthetic purposes.

crimsonrevelations.research.CRIMSON_ARMOR.title=Crimson Cult Apparel
crimsonrevelations.research.CRIMSON_ARMOR.text.stage.1=Whatever else can be said about the Crimson Cult, they sure know how to dress. Now that I can craft their banner, why not try duplicating a set of armor or robes?<BR>I'm not quite sure how the process goes, but making a set in a similar way as I did for my Thaumaturge's Robes would be a good idea to start with.
crimsonrevelations.research.CRIMSON_ARMOR.text.stage.2=Success! The key was the major use of crimson plates, and the incorporation of a Crimson Cult banner directly into the apparel. Crimson Cult armor is similar to iron in terms of protection, but with slightly more durability and vastly more style. The robes are significantly more protective than my Thaumaturge's Robes, but barely better than mundane armor when it comes to channeling vis.<BR>They also seem made for some magic much darker than thaumaturgy. Wearing them for a long period of time feels unsettling...
crimsonrevelations.research.CRIMSON_ARMOR.text.stage.2=Success! The key was the major use of crimson plates, and the incorporation of a Crimson Cult banner directly into the apparel. Crimson Cult armor is similar to iron in terms of protection, but with slightly more durability and vastly more style. The robes are significantly more protective than my Thaumaturge's Robes, but barely better than mundane armor when it comes to channeling vis.<BR>They also seem to be made with some sort of magic much darker than thaumaturgy and do not require as much vis to craft for this reason. Wearing them for a long period of time feels unsettling...

crimsonrevelations.research.CRIMSON_BLADE.title=Crimson Blade
crimsonrevelations.research.CRIMSON_BLADE.text.stage.1=The Crimson Rites tell of a sword forged from the void which saps strength and sustenance from its wielder's foes. Supposedly it lies in the center of an eldritch labyrinth, accessible only through the Opening of the Eye.<BR>I may not be well-versed enough in thaumaturgy to find this weapon, but my knowledge should be sufficient to create a copy.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "crimsonrevelations:items/crimson_fabric"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "crimsonrevelations:items/crimson_plate"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"type": "forge:ore_shapeless",
"ingredients": [
{
"item": "thaumcraft:stone_ancient"
}
],
"result": {
"item": "thaumcraft:stone_ancient_tile"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"text": "crimsonrevelations.research.ANCIENT_STONE.text.stage.2",
"recipes": [
"crimsonrevelations:ancientstone",
"crimsonrevelations:ancientstonetile",
"crimsonrevelations:ancient_stone_tile",
"crimsonrevelations:glyphstone"
]
}
Expand Down

0 comments on commit a9b2219

Please sign in to comment.