use of blusunrize.immersiveengineering.api.crafting.CrusherRecipe in project ImmersiveEngineering by BluSunrize.
the class IERecipes method initCrusherRecipes.
public static void initCrusherRecipes() {
oreOutputSecondaries.put("Iron", new Object[] { "dustNickel", .1f });
oreOutputSecondaries.put("Gold", new Object[] { "crystalCinnabar", .05f });
oreOutputSecondaries.put("Copper", new Object[] { "dustGold", .1f });
oreOutputSecondaries.put("Lead", new Object[] { "dustSilver", .1f });
oreOutputSecondaries.put("Silver", new Object[] { "dustLead", .1f });
oreOutputSecondaries.put("Nickel", new Object[] { "dustPlatinum", .1f });
// addCrusherRecipe(new ItemStack(IEContent.itemMetal,1,15), "ingotConstantan", 3600, null,0);
// addCrusherRecipe(new ItemStack(IEContent.itemMetal,1,16), "ingotElectrum", 3600, null,0);
// addCrusherRecipe(new ItemStack(IEContent.itemMetal,1,19), "ingotHOPGraphite", 3600, null,0);
// CrusherRecipe.addRecipe(new ItemStack(IEContent.itemMetal,1,17), "fuelCoke", 4800);
// CrusherRecipe.addRecipe(new ItemStack(IEContent.itemMetal,1,18), "gemQuartz", 4800);
oreOutputModifier.put("Lapis", new ItemStack(Items.DYE, 9, 4));
oreOutputModifier.put("Diamond", new ItemStack(Items.DIAMOND, 2));
oreOutputModifier.put("Redstone", new ItemStack(Items.REDSTONE, 6));
oreOutputSecondaries.put("Redstone", new Object[] { "crystalCinnabar", .25f });
oreOutputModifier.put("Emerald", new ItemStack(Items.EMERALD, 2));
oreOutputModifier.put("Quartz", new ItemStack(Items.QUARTZ, 3));
oreOutputSecondaries.put("Quartz", new Object[] { "dustSulfur", .15f });
oreOutputModifier.put("Coal", new ItemStack(Items.COAL, 4));
oreOutputSecondaries.put("Platinum", new Object[] { "dustNickel", .1f });
oreOutputSecondaries.put("Tungsten", new Object[] { "dustManganese", .1f });
oreOutputSecondaries.put("Uranium", new Object[] { "dustLead", .1f });
oreOutputSecondaries.put("Yellorium", new Object[] { "dustLead", .1f });
oreOutputSecondaries.put("Plutonium", new Object[] { "dustUranium", .1f });
Item item = GameRegistry.findItem("IC2", "itemOreIridium");
oreOutputSecondaries.put("Osmium", new Object[] { item, .01f });
oreOutputSecondaries.put("Iridium", new Object[] { "dustPlatium", .1f });
oreOutputSecondaries.put("FzDarkIron", new Object[] { "dustIron", .1f });
item = GameRegistry.findItem("Railcraft", "firestone.raw");
if (item != null)
oreOutputModifier.put("Firestone", new ItemStack(item));
oreOutputSecondaries.put("Nikolite", new Object[] { Items.DIAMOND, .025f });
addCrusherRecipe(new ItemStack(Blocks.GRAVEL), "cobblestone", 1600);
addCrusherRecipe(new ItemStack(Blocks.SAND), Blocks.GRAVEL, 1600);
addCrusherRecipe(new ItemStack(Blocks.SAND), "itemSlag", 1600);
addCrusherRecipe(new ItemStack(Blocks.SAND), "blockGlass", 3200);
addCrusherRecipe(new ItemStack(Items.QUARTZ, 4), "blockQuartz", 3200);
addCrusherRecipe(new ItemStack(Items.GLOWSTONE_DUST, 4), "glowstone", 3200);
addCrusherRecipe(new ItemStack(Items.BLAZE_POWDER, 4), "rodBlaze", 3200, "dustSulfur", .5f);
addCrusherRecipe(new ItemStack(Items.DYE, 6, 15), Items.BONE, 3200);
addCrusherRecipe(new ItemStack(IEContent.itemMaterial, 1, 17), "fuelCoke", 2400);
addCrusherRecipe(new ItemStack(IEContent.itemMaterial, 9, 17), "blockFuelCoke", 4800);
addItemToOreDictCrusherRecipe("dustCoal", 1, new ItemStack(Items.COAL), 2400);
addItemToOreDictCrusherRecipe("dustObsidian", 4, Blocks.OBSIDIAN, 6000);
for (int i = 0; i < 16; i++) {
CrusherRecipe r = CrusherRecipe.addRecipe(new ItemStack(Items.STRING, 4), new ItemStack(Blocks.WOOL, 1, i), 3200);
if (i != 0)
r.addToSecondaryOutput(new ItemStack(Items.DYE, 1, 15 - i), .05f);
}
}
use of blusunrize.immersiveengineering.api.crafting.CrusherRecipe in project ImmersiveEngineering by BluSunrize.
the class TileEntityCrusher method onEntityCollision.
@Override
public void onEntityCollision(World world, Entity entity) {
boolean bpos = pos == 16 || pos == 17 || pos == 18 || pos == 21 || pos == 22 || pos == 23 || pos == 26 || pos == 27 || pos == 28;
if (bpos && !world.isRemote && entity != null && !entity.isDead && !isRSDisabled()) {
TileEntityCrusher master = master();
if (master == null)
return;
Vec3d center = new Vec3d(master.getPos()).addVector(.5, .75, .5);
AxisAlignedBB crusherInternal = new AxisAlignedBB(center.xCoord - 1.0625, center.yCoord, center.zCoord - 1.0625, center.xCoord + 1.0625, center.yCoord + 1.25, center.zCoord + 1.0625);
if (!entity.getEntityBoundingBox().intersectsWith(crusherInternal))
return;
if (entity instanceof EntityItem && ((EntityItem) entity).getEntityItem() != null) {
ItemStack stack = ((EntityItem) entity).getEntityItem();
if (stack == null)
return;
CrusherRecipe recipe = master.findRecipeForInsertion(stack);
if (recipe == null)
return;
ItemStack displayStack = null;
for (IngredientStack ingr : recipe.getItemInputs()) if (ingr.matchesItemStack(stack)) {
displayStack = Utils.copyStackWithAmount(stack, ingr.inputSize);
break;
}
MultiblockProcess<CrusherRecipe> process = new MultiblockProcessInWorld<CrusherRecipe>(recipe, .5f, displayStack);
if (master.addProcessToQueue(process, true, true)) {
master.addProcessToQueue(process, false, true);
stack.stackSize -= displayStack.stackSize;
if (stack.stackSize <= 0)
entity.setDead();
}
} else if (entity instanceof EntityLivingBase && (!(entity instanceof EntityPlayer) || !((EntityPlayer) entity).capabilities.disableDamage)) {
int consumed = master.energyStorage.extractEnergy(80, true);
if (consumed > 0) {
master.energyStorage.extractEnergy(consumed, false);
EventHandler.crusherMap.put(entity.getUniqueID(), master);
entity.attackEntityFrom(IEDamageSources.crusher, consumed / 20f);
}
}
}
}
use of blusunrize.immersiveengineering.api.crafting.CrusherRecipe in project ImmersiveEngineering by BluSunrize.
the class Crusher method addRecipe.
@ZenMethod
public static void addRecipe(IItemStack output, IIngredient input, int energy, @Optional IItemStack secondaryOutput, @Optional double secondaryChance) {
Object oInput = CraftTweakerHelper.toObject(input);
if (oInput == null) {
MineTweakerAPI.getLogger().logError("Did not add crusher recipe for " + output.getDisplayName() + ", input was null");
return;
}
CrusherRecipe r = new CrusherRecipe(CraftTweakerHelper.toStack(output), oInput, energy);
if (r.input == null) {
MineTweakerAPI.getLogger().logError("Did not add crusher recipe for " + output.getDisplayName() + ", converted input was null");
return;
}
if (secondaryOutput != null)
r.addToSecondaryOutput(CraftTweakerHelper.toStack(secondaryOutput), (float) secondaryChance);
MineTweakerAPI.apply(new Add(r));
}
use of blusunrize.immersiveengineering.api.crafting.CrusherRecipe in project ImmersiveEngineering by BluSunrize.
the class DenseOresHelper method postInit.
@Override
public void postInit() {
HashMap map = null;
Field f_baseOreDictionary = null;
try {
Class c_DenseOresRegistry = Class.forName("com.rwtema.denseores.DenseOresRegistry");
Class c_DenseOre = Class.forName("com.rwtema.denseores.DenseOre");
f_baseOreDictionary = c_DenseOre.getField("baseOreDictionaryEntry");
map = (HashMap) c_DenseOresRegistry.getField("ores").get(null);
} catch (Exception e) {
}
if (map != null && f_baseOreDictionary != null) {
ArrayList<CrusherRecipe> crushRecipes = new ArrayList<CrusherRecipe>();
ArrayList<ArcFurnaceRecipe> arcRecipes = new ArrayList<ArcFurnaceRecipe>();
for (Object o : map.values()) {
try {
String baseOre = (String) f_baseOreDictionary.get(o);
String denseOre = "dense" + baseOre;
boolean c = false;
for (CrusherRecipe recipe : CrusherRecipe.recipeList) if (recipe.oreInputString != null && recipe.oreInputString.equals(baseOre)) {
ItemStack out = Utils.copyStackWithAmount(recipe.output, recipe.output.stackSize * 4);
CrusherRecipe r = new CrusherRecipe(out, denseOre, (int) (recipe.getTotalProcessEnergy() / CrusherRecipe.energyModifier) * 2);
if (recipe.secondaryOutput != null) {
Object[] newSec = new Object[recipe.secondaryOutput.length * 2];
for (int i = 0; i < recipe.secondaryOutput.length; i++) {
newSec[i * 2] = Utils.copyStackWithAmount(recipe.secondaryOutput[i], recipe.secondaryOutput[i].stackSize * 2);
newSec[i * 2 + 1] = recipe.secondaryChance[i] * 2;
}
r.addToSecondaryOutput(newSec);
}
crushRecipes.add(r);
c = true;
}
boolean a = false;
for (ArcFurnaceRecipe recipe : ArcFurnaceRecipe.recipeList) if (recipe.oreInputString != null && recipe.oreInputString.equals(baseOre)) {
ItemStack out = Utils.copyStackWithAmount(recipe.output, recipe.output.stackSize * 4);
int time = (int) (recipe.getTotalProcessTime() / ArcFurnaceRecipe.timeModifier);
int perTick = (int) (recipe.getTotalProcessEnergy() / recipe.getTotalProcessTime() / ArcFurnaceRecipe.energyModifier);
ArcFurnaceRecipe r = new ArcFurnaceRecipe(out, denseOre, recipe.slag, time, perTick);
arcRecipes.add(r);
a = true;
}
IELogger.info("Supporting DenseOre: " + denseOre + "(" + baseOre + "), Crushing:" + (c ? "[X]" : "[ ]") + ", Arc Smelting:" + (a ? "[X]" : "[ ]"));
} catch (Exception e) {
e.printStackTrace();
}
}
CrusherRecipe.recipeList.addAll(crushRecipes);
ArcFurnaceRecipe.recipeList.addAll(arcRecipes);
}
}
Aggregations