This commit is contained in:
Aidan C. Brady 2015-02-27 00:47:08 -05:00
parent 9c7831d07b
commit 48c872ec37
4 changed files with 33 additions and 30 deletions

View file

@ -261,6 +261,7 @@ public class ClientTickHandler
{ {
SoundHandler.addSound(player, JETPACK, client.replaceSoundsWhenResuming); SoundHandler.addSound(player, JETPACK, client.replaceSoundsWhenResuming);
} }
SoundHandler.playSound(player, JETPACK); SoundHandler.playSound(player, JETPACK);
} }
} }
@ -275,6 +276,7 @@ public class ClientTickHandler
{ {
SoundHandler.addSound(player, GASMASK, client.replaceSoundsWhenResuming); SoundHandler.addSound(player, GASMASK, client.replaceSoundsWhenResuming);
} }
SoundHandler.playSound(player, GASMASK); SoundHandler.playSound(player, GASMASK);
} }
} }
@ -287,6 +289,7 @@ public class ClientTickHandler
{ {
SoundHandler.addSound(player, FLAMETHROWER, client.replaceSoundsWhenResuming); SoundHandler.addSound(player, FLAMETHROWER, client.replaceSoundsWhenResuming);
} }
SoundHandler.playSound(player, FLAMETHROWER); SoundHandler.playSound(player, FLAMETHROWER);
} }
} }

View file

@ -77,7 +77,7 @@ public class MekanismKeyHandler extends MekKeyHandler
Item item = StackUtils.getItem(toolStack); Item item = StackUtils.getItem(toolStack);
if(player.isSneaking() && item instanceof ItemConfigurator) if(player.isSneaking() && item instanceof ItemConfigurator)
{ {
ItemConfigurator configurator = (ItemConfigurator) item; ItemConfigurator configurator = (ItemConfigurator)item;
configurator.setState(toolStack, (byte) (configurator.getState(toolStack) < 3 ? configurator.getState(toolStack) + 1 : 0)); configurator.setState(toolStack, (byte) (configurator.getState(toolStack) < 3 ? configurator.getState(toolStack) + 1 : 0));
Mekanism.packetHandler.sendToServer(new ConfiguratorStateMessage(configurator.getState(toolStack))); Mekanism.packetHandler.sendToServer(new ConfiguratorStateMessage(configurator.getState(toolStack)));
@ -85,7 +85,7 @@ public class MekanismKeyHandler extends MekKeyHandler
} }
else if(player.isSneaking() && item instanceof ItemElectricBow) else if(player.isSneaking() && item instanceof ItemElectricBow)
{ {
ItemElectricBow bow = (ItemElectricBow) item; ItemElectricBow bow = (ItemElectricBow)item;
bow.setFireState(toolStack, !bow.getFireState(toolStack)); bow.setFireState(toolStack, !bow.getFireState(toolStack));
Mekanism.packetHandler.sendToServer(new ElectricBowStateMessage(bow.getFireState(toolStack))); Mekanism.packetHandler.sendToServer(new ElectricBowStateMessage(bow.getFireState(toolStack)));
@ -93,7 +93,7 @@ public class MekanismKeyHandler extends MekKeyHandler
} }
else if(player.isSneaking() && item instanceof ItemBlockMachine) else if(player.isSneaking() && item instanceof ItemBlockMachine)
{ {
ItemBlockMachine machine = (ItemBlockMachine) item; ItemBlockMachine machine = (ItemBlockMachine)item;
if(MachineType.get(toolStack) == MachineType.PORTABLE_TANK) if(MachineType.get(toolStack) == MachineType.PORTABLE_TANK)
{ {
@ -104,7 +104,7 @@ public class MekanismKeyHandler extends MekKeyHandler
} }
else if(player.isSneaking() && item instanceof ItemWalkieTalkie) else if(player.isSneaking() && item instanceof ItemWalkieTalkie)
{ {
ItemWalkieTalkie wt = (ItemWalkieTalkie) item; ItemWalkieTalkie wt = (ItemWalkieTalkie)item;
if(wt.getOn(toolStack)) if(wt.getOn(toolStack))
{ {

View file

@ -5,10 +5,9 @@ import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import mekanism.api.gas.GasStack; import mekanism.api.gas.GasStack;
import mekanism.client.gui.GuiElectrolyticSeparator; import mekanism.client.gui.GuiElectrolyticSeparator;
@ -28,6 +27,7 @@ import mekanism.common.ObfuscatedNames;
import mekanism.common.recipe.RecipeHandler.Recipe; import mekanism.common.recipe.RecipeHandler.Recipe;
import mekanism.common.recipe.inputs.FluidInput; import mekanism.common.recipe.inputs.FluidInput;
import mekanism.common.recipe.machines.SeparatorRecipe; import mekanism.common.recipe.machines.SeparatorRecipe;
import mekanism.common.recipe.outputs.ChemicalPairOutput;
import mekanism.common.util.LangUtils; import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType; import mekanism.common.util.MekanismUtils.ResourceType;
@ -111,9 +111,9 @@ public class ElectrolyticSeparatorRecipeHandler extends BaseRecipeHandler
return "mekanism.electrolyticseparator"; return "mekanism.electrolyticseparator";
} }
public Set<Entry<FluidStack, SeparatorRecipe>> getRecipes() public Collection<SeparatorRecipe> getRecipes()
{ {
return Recipe.ELECTROLYTIC_SEPARATOR.get().entrySet(); return Recipe.ELECTROLYTIC_SEPARATOR.get().values();
} }
@Override @Override
@ -140,17 +140,17 @@ public class ElectrolyticSeparatorRecipeHandler extends BaseRecipeHandler
fluidInput.renderScale(0, 0, -xOffset, -yOffset); fluidInput.renderScale(0, 0, -xOffset, -yOffset);
} }
if(recipe.outputPair.recipeOutput.leftGas != null) if(recipe.outputPair.leftGas != null)
{ {
displayGauge(28, 59-xOffset, 19-yOffset, 176, 68, 28, null, recipe.outputPair.recipeOutput.leftGas); displayGauge(28, 59-xOffset, 19-yOffset, 176, 68, 28, null, recipe.outputPair.leftGas);
leftGas.setDummyType(recipe.outputPair.recipeOutput.leftGas.getGas()); leftGas.setDummyType(recipe.outputPair.leftGas.getGas());
leftGas.renderScale(0, 0, -xOffset, -yOffset); leftGas.renderScale(0, 0, -xOffset, -yOffset);
} }
if(recipe.outputPair.recipeOutput.rightGas != null) if(recipe.outputPair.rightGas != null)
{ {
displayGauge(28, 101-xOffset, 19-yOffset, 176, 68, 28, null, recipe.outputPair.recipeOutput.rightGas); displayGauge(28, 101-xOffset, 19-yOffset, 176, 68, 28, null, recipe.outputPair.rightGas);
rightGas.setDummyType(recipe.outputPair.recipeOutput.rightGas.getGas()); rightGas.setDummyType(recipe.outputPair.rightGas.getGas());
rightGas.renderScale(0, 0, -xOffset, -yOffset); rightGas.renderScale(0, 0, -xOffset, -yOffset);
} }
} }
@ -174,16 +174,16 @@ public class ElectrolyticSeparatorRecipeHandler extends BaseRecipeHandler
{ {
if(outputId.equals(getRecipeId())) if(outputId.equals(getRecipeId()))
{ {
for(Map.Entry irecipe : getRecipes()) for(SeparatorRecipe irecipe : getRecipes())
{ {
arecipes.add(new CachedIORecipe(irecipe)); arecipes.add(new CachedIORecipe(irecipe));
} }
} }
else if(outputId.equals("gas") && results.length == 1 && results[0] instanceof GasStack) else if(outputId.equals("gas") && results.length == 1 && results[0] instanceof GasStack)
{ {
for(Map.Entry<FluidStack, SeparatorRecipe> irecipe : getRecipes()) for(SeparatorRecipe irecipe : getRecipes())
{ {
if(irecipe.getValue().recipeOutput.containsType((GasStack)results[0])) if(irecipe.recipeOutput.containsType((GasStack)results[0]))
{ {
arecipes.add(new CachedIORecipe(irecipe)); arecipes.add(new CachedIORecipe(irecipe));
} }
@ -199,9 +199,9 @@ public class ElectrolyticSeparatorRecipeHandler extends BaseRecipeHandler
{ {
if(inputId.equals("fluid") && ingredients.length == 1 && ingredients[0] instanceof FluidStack) if(inputId.equals("fluid") && ingredients.length == 1 && ingredients[0] instanceof FluidStack)
{ {
for(Map.Entry<FluidStack, SeparatorRecipe> irecipe : getRecipes()) for(SeparatorRecipe irecipe : getRecipes())
{ {
if(irecipe.getKey().isFluidEqual((FluidStack)ingredients[0])) if(irecipe.recipeInput.ingredient.isFluidEqual((FluidStack)ingredients[0]))
{ {
arecipes.add(new CachedIORecipe(irecipe)); arecipes.add(new CachedIORecipe(irecipe));
} }
@ -226,11 +226,11 @@ public class ElectrolyticSeparatorRecipeHandler extends BaseRecipeHandler
} }
else if(xAxis >= 59 && xAxis <= 75 && yAxis >= 19+7 && yAxis <= 47+7) else if(xAxis >= 59 && xAxis <= 75 && yAxis >= 19+7 && yAxis <= 47+7)
{ {
currenttip.add(((CachedIORecipe)arecipes.get(recipe)).outputPair.recipeOutput.leftGas.getGas().getLocalizedName()); currenttip.add(((CachedIORecipe)arecipes.get(recipe)).outputPair.leftGas.getGas().getLocalizedName());
} }
else if(xAxis >= 101 && xAxis <= 117 && yAxis >= 19+7 && yAxis <= 47+7) else if(xAxis >= 101 && xAxis <= 117 && yAxis >= 19+7 && yAxis <= 47+7)
{ {
currenttip.add(((CachedIORecipe)arecipes.get(recipe)).outputPair.recipeOutput.rightGas.getGas().getLocalizedName()); currenttip.add(((CachedIORecipe)arecipes.get(recipe)).outputPair.rightGas.getGas().getLocalizedName());
} }
return super.handleTooltip(gui, currenttip, recipe); return super.handleTooltip(gui, currenttip, recipe);
@ -253,11 +253,11 @@ public class ElectrolyticSeparatorRecipeHandler extends BaseRecipeHandler
} }
else if(xAxis >= 59 && xAxis <= 75 && yAxis >= 19+7 && yAxis <= 47+7) else if(xAxis >= 59 && xAxis <= 75 && yAxis >= 19+7 && yAxis <= 47+7)
{ {
gas = ((CachedIORecipe)arecipes.get(recipe)).outputPair.recipeOutput.leftGas; gas = ((CachedIORecipe)arecipes.get(recipe)).outputPair.leftGas;
} }
else if(xAxis >= 101 && xAxis <= 117 && yAxis >= 19+7 && yAxis <= 47+7) else if(xAxis >= 101 && xAxis <= 117 && yAxis >= 19+7 && yAxis <= 47+7)
{ {
gas = ((CachedIORecipe)arecipes.get(recipe)).outputPair.recipeOutput.rightGas; gas = ((CachedIORecipe)arecipes.get(recipe)).outputPair.rightGas;
} }
if(gas != null) if(gas != null)
@ -315,11 +315,11 @@ public class ElectrolyticSeparatorRecipeHandler extends BaseRecipeHandler
} }
else if(xAxis >= 59 && xAxis <= 75 && yAxis >= 19+7 && yAxis <= 47+7) else if(xAxis >= 59 && xAxis <= 75 && yAxis >= 19+7 && yAxis <= 47+7)
{ {
gas = ((CachedIORecipe)arecipes.get(recipe)).outputPair.recipeOutput.leftGas; gas = ((CachedIORecipe)arecipes.get(recipe)).outputPair.leftGas;
} }
else if(xAxis >= 101 && xAxis <= 117 && yAxis >= 19+7 && yAxis <= 47+7) else if(xAxis >= 101 && xAxis <= 117 && yAxis >= 19+7 && yAxis <= 47+7)
{ {
gas = ((CachedIORecipe)arecipes.get(recipe)).outputPair.recipeOutput.rightGas; gas = ((CachedIORecipe)arecipes.get(recipe)).outputPair.rightGas;
} }
if(gas != null) if(gas != null)
@ -369,7 +369,7 @@ public class ElectrolyticSeparatorRecipeHandler extends BaseRecipeHandler
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{ {
public FluidInput fluidInput; public FluidInput fluidInput;
public SeparatorRecipe outputPair; public ChemicalPairOutput outputPair;
@Override @Override
public PositionedStack getResult() public PositionedStack getResult()
@ -377,15 +377,15 @@ public class ElectrolyticSeparatorRecipeHandler extends BaseRecipeHandler
return null; return null;
} }
public CachedIORecipe(FluidInput input, SeparatorRecipe pair) public CachedIORecipe(FluidInput input, ChemicalPairOutput pair)
{ {
fluidInput = input; fluidInput = input;
outputPair = pair; outputPair = pair;
} }
public CachedIORecipe(Map.Entry recipe) public CachedIORecipe(SeparatorRecipe recipe)
{ {
this((FluidInput)recipe.getKey(), (SeparatorRecipe)recipe.getValue()); this(recipe.recipeInput, recipe.recipeOutput);
} }
} }
} }

View file

@ -68,7 +68,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
public TileEntityChemicalOxidizer() public TileEntityChemicalOxidizer()
{ {
super("machine.oxidiser", "ChemicalOxidizer", MachineType.CHEMICAL_OXIDIZER.baseEnergy); super("machine.oxidizer", "ChemicalOxidizer", MachineType.CHEMICAL_OXIDIZER.baseEnergy);
inventory = new ItemStack[4]; inventory = new ItemStack[4];
} }