mirror of
https://github.com/GTNewHorizons/ironchest.git
synced 2026-11-22 13:10:11 +00:00
Reverted recipes removal (#11)
* Reverted recipes removal * Updated buldscript * Spotless apply
This commit is contained in:
1 parent
492eb80372
commit
acd0a09eea
3 files changed
+601
-190
No files matched your search
+548
-186
File diff suppressed because it is too large.
Load diff
@@ -16,8 +16,11 @@ import static cpw.mods.ironchest.IronChestType.OBSIDIAN;
|
||||
import static cpw.mods.ironchest.IronChestType.STEEL;
|
||||
import static cpw.mods.ironchest.IronChestType.WOOD;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public enum ChestChangerType {
|
||||
@@ -64,7 +67,17 @@ public enum ChestChangerType {
|
||||
}
|
||||
|
||||
public void addRecipes() {
|
||||
|
||||
for (String sourceMat : source.getMatList()) {
|
||||
for (String targetMat : target.getMatList()) {
|
||||
Object targetMaterial = IronChestType.translateOreName(targetMat);
|
||||
Object sourceMaterial = IronChestType.translateOreName(sourceMat);
|
||||
// spotless:off
|
||||
IronChestType.addRecipe(new ItemStack(item), recipe,
|
||||
'm', targetMaterial, 's', sourceMaterial,
|
||||
'G', Blocks.glass, 'O', Blocks.obsidian);
|
||||
// spotless:on
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void buildItems(Configuration cfg) {
|
||||
@@ -74,6 +87,9 @@ public enum ChestChangerType {
|
||||
}
|
||||
|
||||
public static void generateRecipes() {
|
||||
if (Loader.isModLoaded("dreamcraft")) {
|
||||
return;
|
||||
}
|
||||
for (ChestChangerType item : values()) {
|
||||
item.addRecipes();
|
||||
}
|
||||
|
||||
@@ -19,7 +19,9 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagByte;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -101,9 +103,39 @@ public enum IronChestType {
|
||||
public static void registerBlocksAndRecipes(BlockIronChest blockResult) {
|
||||
Object previous = "chestWood";
|
||||
for (IronChestType typ : values()) {
|
||||
generateRecipesForType(blockResult, previous, typ);
|
||||
ItemStack chest = new ItemStack(blockResult, 1, typ.ordinal());
|
||||
if (typ.isValidForCreativeMode()) GameRegistry.registerCustomItemStack(typ.friendlyName, chest);
|
||||
if (typ.tieredChest) previous = chest;
|
||||
if (typ.isValidForCreativeMode()) {
|
||||
GameRegistry.registerCustomItemStack(typ.friendlyName, chest);
|
||||
}
|
||||
if (typ.tieredChest) {
|
||||
previous = chest;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void generateRecipesForType(BlockIronChest blockResult, Object previousTier, IronChestType type) {
|
||||
if (Loader.isModLoaded("dreamcraft")) {
|
||||
return;
|
||||
}
|
||||
for (String recipe : type.recipes) {
|
||||
String[] recipeSplit = new String[] { recipe.substring(0, 3), recipe.substring(3, 6),
|
||||
recipe.substring(6, 9) };
|
||||
Object mainMaterial = null;
|
||||
for (String mat : type.matList) {
|
||||
mainMaterial = translateOreName(mat);
|
||||
// spotless:off
|
||||
addRecipe(new ItemStack(blockResult, 1, type.ordinal()), recipeSplit,
|
||||
'm', mainMaterial, 'P', previousTier, /* previous tier of chest */
|
||||
'G', "blockGlass", 'C', "chestWood",
|
||||
'0', new ItemStack(blockResult, 1, 0), /* Iron Chest */
|
||||
'1', new ItemStack(blockResult, 1, 1), /* Gold Chest */
|
||||
'2', new ItemStack(blockResult, 1, 2), /* Diamond Chest */
|
||||
'3', new ItemStack(blockResult, 1, 3), /* Copper Chest */
|
||||
'4', new ItemStack(blockResult, 1, 4) /* Silver Chest */
|
||||
);
|
||||
// spotless:on
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +149,8 @@ public enum IronChestType {
|
||||
}
|
||||
|
||||
public static void addRecipe(ItemStack is, Object... parts) {
|
||||
|
||||
ShapedOreRecipe oreRecipe = new ShapedOreRecipe(is, parts);
|
||||
GameRegistry.addRecipe(oreRecipe);
|
||||
}
|
||||
|
||||
public int getRowCount() {
|
||||
|
||||
Reference in new issue
Block a user