created raw gladius for all material types and abstracted recipe creator, need wither dust in PC

This commit is contained in:
Mohammad-Ali Minaie
2018-10-17 22:08:04 -04:00
parent 0efd2b73fd
commit dbc591fc59
7 changed files with 118 additions and 83 deletions

View File

@@ -82,16 +82,8 @@ public class CommonEvents implements WeaponNBT {
setFortuneLevel(outputStack, getFortuneLevel(inputStack) + 1); setFortuneLevel(outputStack, getFortuneLevel(inputStack) + 1);
setModifiers(outputStack, getModifiers(inputStack) + 1); setModifiers(outputStack, getModifiers(inputStack) + 1);
} }
if (RecipeHelper.isOreName(modStack, "boneWithered")) { if (RecipeHelper.isOreName(modStack, "boneWithered", "dustWitheredBone", "skullWithered")) {
setFortuneLevel(outputStack, getFortuneLevel(inputStack) + 1); setLeechLevel(outputStack, getLeechLevel(inputStack) + 1);
setModifiers(outputStack, getModifiers(inputStack) + 1);
}
if (RecipeHelper.isOreName(modStack, "dustWitheredBone")) {
setFortuneLevel(outputStack, getFortuneLevel(inputStack) + 1);
setModifiers(outputStack, getModifiers(inputStack) + 1);
}
if (RecipeHelper.isOreName(modStack, "skullWithered")) {
setFortuneLevel(outputStack, getFortuneLevel(inputStack) + 1);
setModifiers(outputStack, getModifiers(inputStack) + 1); setModifiers(outputStack, getModifiers(inputStack) + 1);
} }
} }

View File

@@ -52,10 +52,10 @@ public class ForgeCraft
ModBlocks.register(); ModBlocks.register();
ModItems.init(); ModItems.init();
ModItems.register(); ModItems.register();
ModDictionary.registerDictionaryNames();
ModTiles.registerTileEntities(); ModTiles.registerTileEntities();
ModSounds.registerSounds(); ModSounds.registerSounds();
ModEvents.registerCommonEvents();
//ModEvents.registerClientEvents(); //ModEvents.registerClientEvents();
// ModItems.registerRenders(); // ModItems.registerRenders();
proxy.preInit(); proxy.preInit();
@@ -67,7 +67,7 @@ public class ForgeCraft
{ {
//this.proxy.init(event); //this.proxy.init(event);
proxy.init(); proxy.init();
ModDictionary.registerDictionaryNames();
ModCrafting.register(); ModCrafting.register();
//proxy.registerModelBakeryVariants(); //proxy.registerModelBakeryVariants();
@@ -76,7 +76,7 @@ public class ForgeCraft
@EventHandler @EventHandler
public void postInit(FMLPostInitializationEvent event) public void postInit(FMLPostInitializationEvent event)
{ {
//this.proxy.postInit(event); ModEvents.registerCommonEvents();
} }
@EventHandler @EventHandler

View File

@@ -1,6 +1,7 @@
package nmd.primal.forgecraft.init; package nmd.primal.forgecraft.init;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
import net.minecraft.init.Items;
import static nmd.primal.forgecraft.init.ModConfig.Compatibility.COMPAT_DICTIONARY_WROUGHT_IRON; import static nmd.primal.forgecraft.init.ModConfig.Compatibility.COMPAT_DICTIONARY_WROUGHT_IRON;
@@ -32,5 +33,6 @@ public class ModDictionary {/***************************************************
OreDictionary.registerOre("ingotWootz", ModItems.wootzingotball); OreDictionary.registerOre("ingotWootz", ModItems.wootzingotball);
OreDictionary.registerOre("nuggetWootz", ModItems.wootzchunk); OreDictionary.registerOre("nuggetWootz", ModItems.wootzchunk);
//} //}
OreDictionary.registerOre("dustBlaze", Items.BLAZE_POWDER);
} }
} }

View File

@@ -36,7 +36,7 @@ public class ModItems {
//public static Item stonetongs; //public static Item stonetongs;
public static Item castingmud; public static Item castingmud;
public static Item rawbronzegladius;
public static Item bronzeingotball; public static Item bronzeingotball;
public static Item bronzechunk; public static Item bronzechunk;
@@ -118,6 +118,13 @@ public class ModItems {
public static Item wootzshovel; public static Item wootzshovel;
public static Item wootzhoe; public static Item wootzhoe;
public static Item rawbronzegladius;
public static Item rawcoppergladius;
public static Item rawwroughtirongladius;
public static Item rawcleanirongladius;
public static Item rawsteelgladius;
public static Item rawwootzgladius;
public static Item bronzegladius; public static Item bronzegladius;
public static Item wroughtirongladius; public static Item wroughtirongladius;
public static Item cleanirongladius; public static Item cleanirongladius;
@@ -252,6 +259,11 @@ public class ModItems {
WEAPONS WEAPONS
**********/ **********/
rawbronzegladius = new WeaponPart("rawbronzegladius", PrimalAPI.ToolMaterials.TOOL_BRONZE); rawbronzegladius = new WeaponPart("rawbronzegladius", PrimalAPI.ToolMaterials.TOOL_BRONZE);
rawcoppergladius= new WeaponPart("rawcoppergladius", PrimalAPI.ToolMaterials.TOOL_COPPER);
rawwroughtirongladius= new WeaponPart("rawwroughtirongladius", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON);
rawcleanirongladius= new WeaponPart("rawcleanirongladius", PrimalAPI.ToolMaterials.TOOL_CLEAN_IRON);
rawsteelgladius= new WeaponPart("rawsteelgladius", PrimalAPI.ToolMaterials.TOOL_BASIC_STEEL);
rawwootzgladius= new WeaponPart("rawwootzgladius", PrimalAPI.ToolMaterials.TOOL_WOOTZ_STEEL);
bronzegladius = new CustomSword("bronzegladius", PrimalAPI.ToolMaterials.TOOL_BRONZE, 5.5D, 2D); bronzegladius = new CustomSword("bronzegladius", PrimalAPI.ToolMaterials.TOOL_BRONZE, 5.5D, 2D);
wroughtirongladius = new CustomSword("wroughtirongladius", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, 4.5D, -1.85D); wroughtirongladius = new CustomSword("wroughtirongladius", PrimalAPI.ToolMaterials.TOOL_WROUGHT_IRON, 4.5D, -1.85D);
@@ -305,6 +317,8 @@ public class ModItems {
} }
public static void register() { public static void register() {
//ForgeRegistries.ITEMS.register();
ForgeRegistries.ITEMS.register(itemnbtcrucible); ForgeRegistries.ITEMS.register(itemnbtcrucible);
ForgeRegistries.ITEMS.register(slottedtongs); ForgeRegistries.ITEMS.register(slottedtongs);
//ForgeRegistries.ITEMS.register(itemcrucible); //ForgeRegistries.ITEMS.register(itemcrucible);
@@ -404,6 +418,11 @@ public class ModItems {
WEAPONS WEAPONS
**********/ **********/
ForgeRegistries.ITEMS.register(rawbronzegladius); ForgeRegistries.ITEMS.register(rawbronzegladius);
ForgeRegistries.ITEMS.register(rawcoppergladius);
ForgeRegistries.ITEMS.register(rawwroughtirongladius);
ForgeRegistries.ITEMS.register(rawcleanirongladius);
ForgeRegistries.ITEMS.register(rawsteelgladius);
ForgeRegistries.ITEMS.register(rawwootzgladius);
ForgeRegistries.ITEMS.register(wroughtirongladius); ForgeRegistries.ITEMS.register(wroughtirongladius);
ForgeRegistries.ITEMS.register(bronzegladius); ForgeRegistries.ITEMS.register(bronzegladius);
@@ -544,6 +563,11 @@ public class ModItems {
//registerRender(wroughtironshield); //registerRender(wroughtironshield);
registerRender(rawbronzegladius); registerRender(rawbronzegladius);
registerRender(rawcoppergladius);
registerRender(rawwroughtirongladius);
registerRender(rawcleanirongladius);
registerRender(rawsteelgladius);
registerRender(rawwootzgladius);
registerRender(bronzegladius); registerRender(bronzegladius);
registerRender(wroughtirongladius); registerRender(wroughtirongladius);

View File

@@ -17,6 +17,8 @@ import nmd.primal.forgecraft.ModInfo;
import nmd.primal.forgecraft.init.ModItems; import nmd.primal.forgecraft.init.ModItems;
import nmd.primal.forgecraft.util.WeaponNBT; import nmd.primal.forgecraft.util.WeaponNBT;
import java.util.List;
@GameRegistry.ObjectHolder(ModInfo.MOD_ID) @GameRegistry.ObjectHolder(ModInfo.MOD_ID)
@Mod.EventBusSubscriber @Mod.EventBusSubscriber
public class CauldronRecipes public class CauldronRecipes
@@ -27,89 +29,106 @@ public class CauldronRecipes
final IForgeRegistry<CauldronRecipe> recipes = event.getRegistry(); final IForgeRegistry<CauldronRecipe> recipes = event.getRegistry();
ItemStack defaultBronzeGladius = new ItemStack(ModItems.rawbronzegladius, 1); ItemStack defaultBronzeGladius = new ItemStack(ModItems.rawbronzegladius, 1);
ItemStack defaultCopperGladius = new ItemStack(ModItems.rawcoppergladius, 1);
ItemStack defaultWroughtIronGladius = new ItemStack(ModItems.rawwroughtirongladius, 1);
ItemStack defaultCleanIronGladius = new ItemStack(ModItems.rawcleanirongladius, 1);
ItemStack defaultSteelGladius = new ItemStack(ModItems.rawsteelgladius, 1);
ItemStack defaultWootzGladius = new ItemStack(ModItems.rawwootzgladius, 1);
defaultBronzeGladius.getOrCreateSubCompound("tags"); setDefaultNBT(defaultBronzeGladius);
defaultBronzeGladius.getSubCompound("tags").setInteger("smite", 0); setDefaultNBT(defaultCopperGladius);
defaultBronzeGladius.getSubCompound("tags").setInteger("bane", 0); setDefaultNBT(defaultWroughtIronGladius);
defaultBronzeGladius.getSubCompound("tags").setInteger("fire", 0); setDefaultNBT(defaultCleanIronGladius);
defaultBronzeGladius.getSubCompound("tags").setInteger("fortune", 0); setDefaultNBT(defaultSteelGladius);
defaultBronzeGladius.getSubCompound("tags").setInteger("leech", 0); setDefaultNBT(defaultWootzGladius);
defaultBronzeGladius.getSubCompound("tags").setInteger("sweeping", 0);
defaultBronzeGladius.getSubCompound("tags").setInteger("sharpness", 0);
defaultBronzeGladius.getSubCompound("tags").setBoolean("hot", false);
recipes.register(new CauldronRecipe( List<ItemStack> recipeList = RecipeHelper.buildList(defaultBronzeGladius, defaultCopperGladius, defaultWroughtIronGladius, defaultCleanIronGladius, defaultSteelGladius, defaultWootzGladius);
genRecipesForList(recipeList, recipes);
}
static void setDefaultNBT(ItemStack stack){
stack.getOrCreateSubCompound("tags");
stack.getSubCompound("tags").setInteger("smite", 0);
stack.getSubCompound("tags").setInteger("bane", 0);
stack.getSubCompound("tags").setInteger("fire", 0);
stack.getSubCompound("tags").setInteger("fortune", 0);
stack.getSubCompound("tags").setInteger("leech", 0);
stack.getSubCompound("tags").setInteger("sweeping", 0);
stack.getSubCompound("tags").setInteger("sharpness", 0);
stack.getSubCompound("tags").setBoolean("hot", false);
}
static CauldronRecipe genSmiteRecipe(ItemStack stack) {
return new CauldronRecipe(
5, 5,
new FluidStack(FluidRegistry.WATER, 1000), new FluidStack(FluidRegistry.WATER, 1000),
new FluidStack(PrimalAPI.Fluids.WASTE, 1000), new FluidStack(PrimalAPI.Fluids.WASTE, 1000),
RecipeHelper.getOreStack("dustSilver", 2), RecipeHelper.getOreStack("dustSilver", 2),
RecipeHelper.buildList(defaultBronzeGladius), RecipeHelper.buildList(stack),
defaultBronzeGladius, stack,
ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, "rawbronzegladiussmite")); ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, stack.getUnlocalizedName().toString().concat("smite"));
}
recipes.register(new CauldronRecipe( static CauldronRecipe genBaneRecipe(ItemStack stack) {
return new CauldronRecipe(
5, 5,
new FluidStack(FluidRegistry.WATER, 1000), new FluidStack(FluidRegistry.WATER, 1000),
new FluidStack(PrimalAPI.Fluids.WASTE, 1000), new FluidStack(PrimalAPI.Fluids.WASTE, 1000),
RecipeHelper.getOreStack("foodPoison", 2), RecipeHelper.getOreStack("foodPoison", 2),
RecipeHelper.buildList(defaultBronzeGladius), RecipeHelper.buildList(stack),
defaultBronzeGladius, stack,
ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, "rawbronzegladiusbane")); ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, stack.getUnlocalizedName().toString().concat("bane"));
}
recipes.register(new CauldronRecipe( static CauldronRecipe genFireRecipe(ItemStack stack) {
return new CauldronRecipe(
5, 5,
new FluidStack(FluidRegistry.WATER, 1000), new FluidStack(FluidRegistry.WATER, 1000),
new FluidStack(PrimalAPI.Fluids.WASTE, 1000), new FluidStack(PrimalAPI.Fluids.WASTE, 1000),
RecipeHelper.getOreStack("dustBlaze", 2), RecipeHelper.getOreStack("dustBlaze", 2),
RecipeHelper.buildList(defaultBronzeGladius), RecipeHelper.buildList(stack),
defaultBronzeGladius, stack,
ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, "rawbronzegladiusfire")); ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, stack.getUnlocalizedName().toString().concat("fire"));
}
recipes.register(new CauldronRecipe( static CauldronRecipe genFortuneRecipe(ItemStack stack) {
return new CauldronRecipe(
5, 5,
new FluidStack(FluidRegistry.WATER, 1000), new FluidStack(FluidRegistry.WATER, 1000),
new FluidStack(PrimalAPI.Fluids.WASTE, 1000), new FluidStack(PrimalAPI.Fluids.WASTE, 1000),
RecipeHelper.getOreStack("gemLapis", 2), RecipeHelper.getOreStack("gemLapis", 2),
RecipeHelper.buildList(defaultBronzeGladius), RecipeHelper.buildList(stack),
defaultBronzeGladius, stack,
ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, "rawbronzegladiuslapis")); ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, stack.getUnlocalizedName().toString().concat("fortune"));
recipes.register(new CauldronRecipe(
5,
new FluidStack(FluidRegistry.WATER, 1000),
new FluidStack(PrimalAPI.Fluids.WASTE, 1000),
RecipeHelper.getOreStack("boneWithered", 1),
RecipeHelper.buildList(defaultBronzeGladius),
defaultBronzeGladius,
ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, "rawbronzegladiusleech0"));
recipes.register(new CauldronRecipe(
5,
new FluidStack(FluidRegistry.WATER, 1000),
new FluidStack(PrimalAPI.Fluids.WASTE, 1000),
RecipeHelper.getOreStack("dustWitheredBone", 2),
RecipeHelper.buildList(defaultBronzeGladius),
defaultBronzeGladius,
ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, "rawbronzegladiusleech1"));
recipes.register(new CauldronRecipe(
5,
new FluidStack(FluidRegistry.WATER, 1000),
new FluidStack(PrimalAPI.Fluids.WASTE, 1000),
RecipeHelper.getOreStack("skullWithered", 2),
RecipeHelper.buildList(defaultBronzeGladius),
defaultBronzeGladius,
ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, "rawbronzegladiusleech2"));
} }
}
//int cook_time, static CauldronRecipe genLeechRecipe(ItemStack stack) {
// FluidStack fluid_input, return new CauldronRecipe(
// FluidStack fluid_output, 5,
// List<ItemStack> item_input_1, new FluidStack(FluidRegistry.WATER, 1000),
// List<ItemStack> item_input_2, new FluidStack(PrimalAPI.Fluids.WASTE, 1000),
// ItemStack item_output_1, RecipeHelper.getOreStack("dustWitheredBone", 1),
// ItemStack item_output_2 RecipeHelper.buildList(stack),
stack,
ItemStack.EMPTY).setRecipeName(ModInfo.MOD_ID, stack.getUnlocalizedName().toString().concat("leech"));
}
static void genRecipesForStack(ItemStack stack){
genSmiteRecipe(stack);
genBaneRecipe(stack);
genFireRecipe(stack);
genFortuneRecipe(stack);
genLeechRecipe(stack);
}
static void genRecipesForList(List<ItemStack> list, IForgeRegistry<CauldronRecipe> recipes){
for(ItemStack s : list){
recipes.register(genSmiteRecipe(s));
recipes.register(genBaneRecipe(s));
recipes.register(genFireRecipe(s));
recipes.register(genFortuneRecipe(s));
recipes.register(genLeechRecipe(s));
}
}
}

View File

@@ -2,8 +2,7 @@
"forge_marker":1, "forge_marker":1,
"textures": { "textures": {
"particle": "forgecraft:items/bronze/0", "particle": "forgecraft:items/bronze/0",
"texture": "forgecraft:items/bronze/0", "texture": "forgecraft:items/bronze/0"
"texture1": "blocks/planks_oak"
}, },
"parent": "forgecraft:item/rawgladius" "parent": "forgecraft:item/rawgladius"
} }

View File

@@ -2,8 +2,7 @@
"__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio", "__comment": "Designed by Kitsushadow with Cubik Studio - https://cubik.studio",
"textures": { "textures": {
"particle": "items/finished_bronze", "particle": "items/finished_bronze",
"texture": "items/finished_bronze", "texture": "items/finished_bronze"
"texture1": "blocks/planks_oak"
}, },
"elements": [ "elements": [
{ {