generated from tilera/1710mod
fix: get rid of broken UniversalRecipes nonsense
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
closes #2
This commit is contained in:
parent
0afa404d62
commit
e300d23cb7
|
@ -1,107 +0,0 @@
|
|||
package calclavia.lib;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class UniversalRecipes {
|
||||
public static final String PRIMARY_METAL = "ingotSteel";
|
||||
public static final String PRIMARY_PLATE = "plateSteel";
|
||||
public static final String SECONDARY_METAL = "ingotBronze";
|
||||
public static final String SECONDARY_PLATE = "plateBronze";
|
||||
public static final String CIRCUIT_T1 = "circuitBasic";
|
||||
public static final String CIRCUIT_T2 = "circuitAdvanced";
|
||||
public static final String CIRCUIT_T3 = "circuitElite";
|
||||
public static String ADVANCED_BATTERY = "calclavia:ADVANCED_BATTERY";
|
||||
public static String BATTERY = "calclavia:BATTERY";
|
||||
public static String BATTERY_BOX = "calclavia:BATTERY_BOX";
|
||||
public static final String WRENCH = "calclavia:WRENCH";
|
||||
public static final String WIRE = "copperWire";
|
||||
public static final String MOTOR = "motor";
|
||||
public static boolean isInit = false;
|
||||
|
||||
public static void init() {
|
||||
if (!isInit) {
|
||||
// TODO: WTF
|
||||
// register("circuitBasic", new Object[]{"circuitBasic",
|
||||
// Items.getItem("electronicCircuit"), new
|
||||
// ItemStack(Blocks.redstone_torch)}); register("circuitAdvanced",
|
||||
// new Object[]{"circuitAdvanced", Items.getItem("advancedCircuit"), new
|
||||
// ItemStack(Items.repeater)}); register("circuitElite", new
|
||||
// Object[]{"circuitElite", Items.getItem("iridiumPlate"), new
|
||||
// ItemStack(Block.field_94346_cn)}); register(ADVANCED_BATTERY, new
|
||||
// Object[]{"advancedBattery", Items.getItem("energyCrystal"), "battery",
|
||||
// new ItemStack(Items.repeater)}); register(BATTERY, new
|
||||
// Object[]{"battery", Items.getItem("reBattery"), new
|
||||
// ItemStack(Items.repeater)});
|
||||
// register(BATTERY_BOX, new Object[]{"batteryBox",
|
||||
// Items.getItem("batBox"), new ItemStack(Block.field_72105_ah)});
|
||||
// register("calclavia:WRENCH", new Object[]{"wrench",
|
||||
// Items.getItem("wrench"), new ItemStack(Item.field_77708_h)});
|
||||
// register("copperWire", new Object[]{"copperWire",
|
||||
// "copperCableBlock", new ItemStack(Item.field_77767_aC)});
|
||||
// register("motor", new Object[]{"motor",
|
||||
// Items.getItem("generator"), new ItemStack(Block.field_71963_Z)});
|
||||
isInit = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void register(String name, Object... possiblities) {
|
||||
Object[] arr$ = possiblities;
|
||||
int len$ = possiblities.length;
|
||||
|
||||
for (int i$ = 0; i$ < len$; ++i$) {
|
||||
Object possiblity = arr$[i$];
|
||||
|
||||
if (possiblity instanceof ItemStack) {
|
||||
if (registerItemStacksToDictionary(
|
||||
name, new ItemStack[] { (ItemStack) possiblity }
|
||||
)) {
|
||||
break;
|
||||
}
|
||||
} else if (possiblity instanceof String) {
|
||||
if (registerItemStacksToDictionary(name, (String) possiblity)) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
FMLLog.severe(
|
||||
"Universal Recipes: Error Registering " + name, new Object[0]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean registerItemStacksToDictionary(String name, List itemStacks) {
|
||||
boolean returnValue = false;
|
||||
|
||||
if (itemStacks != null && itemStacks.size() > 0) {
|
||||
Iterator i$ = itemStacks.iterator();
|
||||
|
||||
while (i$.hasNext()) {
|
||||
ItemStack stack = (ItemStack) i$.next();
|
||||
|
||||
if (stack != null) {
|
||||
OreDictionary.registerOre(name, stack);
|
||||
returnValue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public static boolean
|
||||
registerItemStacksToDictionary(String name, ItemStack... itemStacks) {
|
||||
return registerItemStacksToDictionary(name, Arrays.asList(itemStacks));
|
||||
}
|
||||
|
||||
public static boolean registerItemStacksToDictionary(String name, String stackName) {
|
||||
return registerItemStacksToDictionary(
|
||||
name, (List) OreDictionary.getOres(stackName)
|
||||
);
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@ import java.util.Arrays;
|
|||
import java.util.logging.Logger;
|
||||
|
||||
import atomicscience.api.poison.PotionRadiation;
|
||||
import calclavia.lib.UniversalRecipes;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
|
@ -123,7 +122,6 @@ public class MainBase {
|
|||
@Mod.EventHandler
|
||||
public void postInit(final FMLPostInitializationEvent event) {
|
||||
if (!MainBase.isPostInit) {
|
||||
UniversalRecipes.init();
|
||||
GameRegistry.addSmelting(
|
||||
MainBase.bLiu, new ItemStack(MainBase.itSulfur, 4), 0.8f
|
||||
);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package icbm.gangshao;
|
||||
|
||||
import calclavia.lib.UniversalRecipes;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
|
@ -191,7 +190,7 @@ public class ICBMSentry extends MainBase {
|
|||
'P',
|
||||
Blocks.piston,
|
||||
'A',
|
||||
UniversalRecipes.BATTERY,
|
||||
"battery",
|
||||
'S',
|
||||
"plateSteel",
|
||||
'C',
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package icbm.wanyi;
|
||||
|
||||
import calclavia.lib.UniversalRecipes;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
|
@ -28,7 +27,6 @@ import net.minecraft.init.Items;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import universalelectricity.core.item.ElectricItemHelper;
|
||||
import universalelectricity.core.item.ItemElectric;
|
||||
|
|
|
@ -3,7 +3,6 @@ package icbm.zhapin;
|
|||
import java.util.List;
|
||||
|
||||
import basiccomponents.common.BasicComponents;
|
||||
import calclavia.lib.UniversalRecipes;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.ModMetadata;
|
||||
|
@ -492,7 +491,7 @@ public class ICBMExplosion extends MainBase {
|
|||
'!',
|
||||
"circuitElite",
|
||||
'@',
|
||||
UniversalRecipes.BATTERY_BOX,
|
||||
"batteryBox",
|
||||
'#',
|
||||
"motor",
|
||||
'W',
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package icbm.zhapin.zhapin.ex;
|
||||
|
||||
import calclavia.lib.UniversalRecipes;
|
||||
import icbm.core.MainBase;
|
||||
import icbm.zhapin.ICBMExplosion;
|
||||
import icbm.zhapin.zhapin.ZhaPin;
|
||||
|
@ -8,9 +7,7 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import universalelectricity.core.item.ElectricItemHelper;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.prefab.RecipeHelper;
|
||||
|
||||
|
@ -41,28 +38,23 @@ public class ExEmp extends ZhaPin {
|
|||
|
||||
@Override
|
||||
public void init() {
|
||||
if (OreDictionary.getOres(UniversalRecipes.BATTERY).size() > 0) {
|
||||
RecipeHelper.addRecipe(
|
||||
(IRecipe) new ShapedOreRecipe(
|
||||
this.getItemStack(),
|
||||
new Object[] {
|
||||
"RBR",
|
||||
"BTB",
|
||||
"RBR",
|
||||
'T',
|
||||
ZhaPin.repulsive.getItemStack(),
|
||||
'R',
|
||||
Blocks.redstone_block,
|
||||
'B',
|
||||
ElectricItemHelper.getUncharged(
|
||||
OreDictionary.getOres(UniversalRecipes.BATTERY).get(0)
|
||||
) }
|
||||
),
|
||||
this.getUnlocalizedName(),
|
||||
MainBase.CONFIGURATION,
|
||||
true
|
||||
);
|
||||
}
|
||||
RecipeHelper.addRecipe(
|
||||
(IRecipe) new ShapedOreRecipe(
|
||||
this.getItemStack(),
|
||||
"RBR",
|
||||
"BTB",
|
||||
"RBR",
|
||||
'T',
|
||||
ZhaPin.repulsive.getItemStack(),
|
||||
'R',
|
||||
Blocks.redstone_block,
|
||||
'B',
|
||||
"battery"
|
||||
),
|
||||
this.getUnlocalizedName(),
|
||||
MainBase.CONFIGURATION,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue