Work on things!

This commit is contained in:
Aidan C. Brady 2014-01-18 11:26:24 -05:00
parent a4017fcc0e
commit 769a8a8e0c
5 changed files with 73 additions and 52 deletions

View file

@ -47,11 +47,16 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler
@Override
public void drawExtras(int i)
{
/*float f = ticksPassed >= 20 && ticksPassed < 40 ? (ticksPassed - 20) % 20 / 20.0F : 1.0F;
CachedIORecipe recipe = (CachedIORecipe)arecipes.get(i);
float f = ticksPassed >= 20 ? (ticksPassed - 20) % 20 / 20.0F : 0;
drawProgressBar(63, 34, 176, 0, 24, 7, f, 0);
int displayInt = ticksPassed < 20 ? ();
displayGauge(61, 37 + 12 - displayInt, 6, displayInt, tileEntity.gasTank.getGas());*/
if(recipe.input.gasType != null)
{
int displayInt = ticksPassed < 20 ? ticksPassed*12 / 20 : 12;
displayGauge(45, 32 + 12 - displayInt, 6, displayInt, new GasStack(recipe.input.gasType, 1));
}
}
@Override
@ -128,11 +133,12 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
{
Point point = GuiDraw.getMousePosition();
Point offset = gui.getRecipePosition(recipe);
int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);
int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft)-offset.x;
int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop)-offset.y;
if(xAxis >= 61 && xAxis <= 67 && yAxis >= 37+13 && yAxis <= 49+13)
if(xAxis >= 45 && xAxis <= 51 && yAxis >= 33 && yAxis <= 45)
{
currenttip.add(((CachedIORecipe)arecipes.get(recipe)).input.gasType.getLocalizedName());
}
@ -144,13 +150,14 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe)
{
Point point = GuiDraw.getMousePosition();
Point offset = gui.getRecipePosition(recipe);
int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);
int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft)-offset.x;
int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop)-offset.y;
GasStack stack = null;
if(xAxis >= 61 && xAxis <= 67 && yAxis >= 37+13 && yAxis <= 49+13)
if(xAxis >= 45 && xAxis <= 51 && yAxis >= 33 && yAxis <= 45)
{
stack = new GasStack(((CachedIORecipe)arecipes.get(recipe)).input.gasType, 1);
}
@ -180,13 +187,14 @@ public abstract class AdvancedMachineRecipeHandler extends BaseRecipeHandler
public boolean mouseClicked(GuiRecipe gui, int button, int recipe)
{
Point point = GuiDraw.getMousePosition();
Point offset = gui.getRecipePosition(recipe);
int xAxis = point.x - (Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
int yAxis = point.y - (Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);
int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft)-offset.x;
int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop)-offset.y;
GasStack stack = null;
if(xAxis >= 61 && xAxis <= 67 && yAxis >= 37+13 && yAxis <= 49+13)
if(xAxis >= 45 && xAxis <= 51 && yAxis >= 33 && yAxis <= 45)
{
stack = new GasStack(((CachedIORecipe)arecipes.get(recipe)).input.gasType, 1);
}

View file

@ -22,7 +22,7 @@ public class BasicRenderingHandler implements ISimpleBlockRenderingHandler
GL11.glPushMatrix();
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
if(block.blockID == Mekanism.basicBlockID)
if(block.blockID == Mekanism.basicBlockID || block.blockID == Mekanism.basicBlock2ID)
{
MekanismRenderer.renderItem(renderer, metadata, block);
}
@ -33,7 +33,7 @@ public class BasicRenderingHandler implements ISimpleBlockRenderingHandler
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
{
if(block.blockID == Mekanism.basicBlockID)
if(block.blockID == Mekanism.basicBlockID || block.blockID == Mekanism.basicBlock2ID)
{
int metadata = world.getBlockMetadata(x, y, z);

View file

@ -57,6 +57,30 @@ public final class MekanismHooks
if(IC2Loaded)
{
for(Map.Entry<IRecipeInput, RecipeOutput> entry : Recipes.macerator.getRecipes().entrySet())
{
if(!entry.getKey().getInputs().isEmpty())
{
List<String> names = MekanismUtils.getOreDictName(entry.getKey().getInputs().get(0));
for(String name : names)
{
boolean did = false;
if(name.startsWith("ingot"))
{
RecipeHandler.addCrusherRecipe(entry.getKey().getInputs().get(0), entry.getValue().items.get(0));
did = true;
}
if(did)
{
break;
}
}
}
}
try {
Recipes.macerator.addRecipe(new RecipeInputOreDict("oreOsmium"), null, new ItemStack(Mekanism.Dust, 2, 2));
} catch(Exception e) {}
@ -77,33 +101,6 @@ public final class MekanismHooks
Recipes.macerator.addRecipe(new RecipeInputOreDict("clumpSilver"), null, new ItemStack(Mekanism.DirtyDust, 1, 5));
} catch(Exception e) {}
for(Map.Entry<IRecipeInput, RecipeOutput> entry : Recipes.macerator.getRecipes().entrySet())
{
if(!entry.getKey().getInputs().isEmpty())
{
List<String> names = MekanismUtils.getOreDictName(entry.getKey().getInputs().get(0));
for(String name : names)
{
boolean did = false;
if(name.startsWith("ingot"))
{
if(!Recipe.CRUSHER.containsRecipe(entry.getKey().getInputs().get(0)))
{
RecipeHandler.addCrusherRecipe(entry.getKey().getInputs().get(0), entry.getValue().items.get(0));
did = true;
}
}
if(did)
{
break;
}
}
}
}
NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("amplification", 50000);

View file

@ -4,6 +4,8 @@ import ic2.api.recipe.RecipeInputOreDict;
import ic2.api.recipe.Recipes;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import mekanism.api.ChanceOutput;
import mekanism.api.gas.GasRegistry;
@ -263,6 +265,23 @@ public final class OreDictManager
RecipeHandler.addChemicalInjectionChamberRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Shard, 4, 7));
}
for(ItemStack ore : OreDictionary.getOres("oreNickel"))
{
try {
RecipeHandler.addEnrichmentChamberRecipe(MekanismUtils.size(ore, 1), StackUtils.size(OreDictionary.getOres("dustNickel").get(0), 2));
} catch(Exception e) {}
}
for(ItemStack ore : OreDictionary.getOres("ingotCopper"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 6));
}
for(ItemStack ore : OreDictionary.getOres("ingotTin"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 7));
}
for(ItemStack ore : OreDictionary.getOres("ingotLead"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 9));
@ -293,6 +312,13 @@ public final class OreDictManager
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Item.glowstone));
}
for(ItemStack ore : OreDictionary.getOres("ingotNickel"))
{
try {
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), StackUtils.size(OreDictionary.getOres("dustNickel").get(0), 1));
} catch(Exception e) {}
}
try {
RecipeHandler.addCrusherRecipe(new ItemStack(Mekanism.Ingot, 1, 2), MekanismUtils.size(OreDictionary.getOres("dustBronze").get(0), 1));
@ -318,16 +344,6 @@ public final class OreDictManager
RecipeHandler.addCrusherRecipe(new ItemStack(Item.coal, 1, 1), MekanismUtils.size(OreDictionary.getOres("dustCharcoal").get(0), 1));
} catch(Exception e) {}
for(ItemStack ore : OreDictionary.getOres("ingotCopper"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 6));
}
for(ItemStack ore : OreDictionary.getOres("ingotTin"))
{
RecipeHandler.addCrusherRecipe(MekanismUtils.size(ore, 1), new ItemStack(Mekanism.Dust, 1, 7));
}
try {
for(ItemStack ore : OreDictionary.getOres("ingotSilver"))
{

View file

@ -420,7 +420,7 @@ public final class RecipeHandler
return true;
}
}
if(entry.getKey() instanceof FluidStack)
else if(entry.getKey() instanceof FluidStack)
{
if(((FluidStack)entry.getKey()).isFluidEqual(input))
{