Merge branch 'development' of https://github.com/aidancbrady/Mekanism into development

This commit is contained in:
Aidan Brady 2014-01-03 12:13:55 -05:00
commit a4f6690ee9
10 changed files with 73 additions and 39 deletions

View file

@ -66,10 +66,12 @@ public class GuiElectrolyticSeparator extends GuiContainer
int yAxis = (mouseY - (height - ySize) / 2);
fontRenderer.drawString(tileEntity.getInvName(), 45, 6, 0x404040);
String name = tileEntity.leftTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.leftTank.getGas().getGas().getLocalizedName();
String name = tileEntity.dumpLeft ? "Dumping..." : tileEntity.leftTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.leftTank.getGas().getGas().getLocalizedName();
fontRenderer.drawString(name, 21, 73, 0x404040);
name = tileEntity.rightTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.rightTank.getGas().getGas().getLocalizedName();
fontRenderer.drawString(name, 152-(name.length()*5), 73, 0x404040);
name = tileEntity.dumpRight ? "Dumping..." : tileEntity.rightTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.rightTank.getGas().getGas().getLocalizedName();
fontRenderer.drawString(name, 156-fontRenderer.getStringWidth(name), 73, 0x404040);
if(xAxis >= 6 && xAxis <= 22 && yAxis >= 11 && yAxis <= 69)
{

View file

@ -1,6 +1,11 @@
package mekanism.client.nei;
import static codechicken.core.gui.GuiDraw.changeTexture;
import static codechicken.core.gui.GuiDraw.drawTexturedModalRect;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@ -19,7 +24,6 @@ import org.lwjgl.opengl.GL11;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import static codechicken.core.gui.GuiDraw.*;
public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler
{
@ -54,17 +58,19 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler
return "mekanism.infuser";
}
public ItemStack getInfuseStack(InfuseType type)
public List<ItemStack> getInfuseStacks(InfuseType type)
{
List<ItemStack> ret = new ArrayList<ItemStack>();
for(Map.Entry<ItemStack, InfuseObject> obj : InfuseRegistry.getObjectMap().entrySet())
{
if(obj.getValue().type == type)
{
return obj.getKey();
ret.add(obj.getKey());
}
}
return null;
return ret;
}
public Set<Entry<InfusionInput, InfusionOutput>> getRecipes()
@ -119,7 +125,7 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler
{
for(Map.Entry irecipe : getRecipes())
{
arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType));
arecipes.add(new CachedIORecipe(irecipe, getInfuseStacks(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType));
}
}
else {
@ -140,7 +146,7 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler
{
if(NEIServerUtils.areStacksSameTypeCrafting(((InfusionOutput)irecipe.getValue()).resource, result))
{
arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType));
arecipes.add(new CachedIORecipe(irecipe, getInfuseStacks(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType));
}
}
}
@ -152,16 +158,17 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler
{
if(NEIServerUtils.areStacksSameTypeCrafting(((InfusionInput)irecipe.getKey()).inputStack, ingredient))
{
arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType));
arecipes.add(new CachedIORecipe(irecipe, getInfuseStacks(((InfusionInput)irecipe.getKey()).infusionType), ((InfusionInput)irecipe.getKey()).infusionType));
}
}
}
public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe
{
public List<ItemStack> infuseStacks;
public PositionedStack inputStack;
public PositionedStack outputStack;
public PositionedStack infuseStack;
public InfuseType infusionType;
@ -180,27 +187,24 @@ public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler
@Override
public PositionedStack getOtherStack()
{
return infuseStack;
return new PositionedStack(infuseStacks.get(cycleticks/40 % infuseStacks.size()), 12, 20);
}
public CachedIORecipe(ItemStack input, ItemStack output, ItemStack infuse, InfuseType type)
public CachedIORecipe(ItemStack input, ItemStack output, List<ItemStack> infuses, InfuseType type)
{
super();
inputStack = new PositionedStack(input, 46, 28);
outputStack = new PositionedStack(output, 104, 28);
if(infuse != null)
{
infuseStack = new PositionedStack(infuse, 12, 20);
}
infuseStacks = infuses;
infusionType = type;
}
public CachedIORecipe(Map.Entry recipe, ItemStack infuse, InfuseType type)
public CachedIORecipe(Map.Entry recipe, List<ItemStack> infuses, InfuseType type)
{
this(((InfusionInput)recipe.getKey()).inputStack, ((InfusionOutput)recipe.getValue()).resource, infuse, type);
this(((InfusionInput)recipe.getKey()).inputStack, ((InfusionOutput)recipe.getValue()).resource, infuses, type);
}
}
}

View file

@ -1074,7 +1074,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
CHEMICAL_OXIDIZER(Mekanism.machineBlock2ID, 1, "ChemicalOxidizer", 29, 20000, TileEntityChemicalOxidizer.class, true, false),
CHEMICAL_INFUSER(Mekanism.machineBlock2ID, 2, "ChemicalInfuser", 30, 20000, TileEntityChemicalInfuser.class, true, false),
CHEMICAL_INJECTION_CHAMBER(Mekanism.machineBlock2ID, 3, "ChemicalInjectionChamber", 31, Mekanism.chemicalInjectionChamberUsage*400, TileEntityChemicalInjectionChamber.class, false, true),
ELECTROLYTIC_SEPARATOR(Mekanism.machineBlock2ID, 4, "ElectrolyticSeparator", 32, 20000, TileEntityElectrolyticSeparator.class, true, true);
ELECTROLYTIC_SEPARATOR(Mekanism.machineBlock2ID, 4, "ElectrolyticSeparator", 32, 20000, TileEntityElectrolyticSeparator.class, true, false);
public int typeId;

View file

@ -278,6 +278,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, ISpec
if(tileEntity instanceof TileEntityFactory)
{
((TileEntityFactory)tileEntity).recipeType = getRecipeType(stack);
world.notifyBlocksOfNeighborChange(x, y, z, tileEntity.getBlockType().blockID);
}
if(tileEntity instanceof ISustainedTank)

View file

@ -743,7 +743,7 @@ public class PartLogisticalTransporter extends PartSidedPipe implements ILogisti
@Override
public boolean onRightClick(EntityPlayer player, int side)
{
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.viewColor") + ": " + color != null ? color.getName() : "None"));
player.sendChatToPlayer(ChatMessageComponent.createFromText(EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " " + MekanismUtils.localize("tooltip.configurator.viewColor") + ": " + (color != null ? color.getName() : "None")));
return true;
}

View file

@ -369,6 +369,14 @@ public class TileEntityAdvancedBoundingBlock extends TileEntityBoundingBlock imp
public IAdvancedBoundingBlock getInv()
{
TileEntity tile = new Coord4D(mainX, mainY, mainZ, worldObj.provider.dimensionId).getTileEntity(worldObj);
if(!(tile instanceof IAdvancedBoundingBlock))
{
worldObj.setBlockToAir(xCoord, yCoord, zCoord);
return null;
}
return (IAdvancedBoundingBlock)new Coord4D(mainX, mainY, mainZ, worldObj.provider.dimensionId).getTileEntity(worldObj);
}
}

View file

@ -147,7 +147,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
if(worldObj.rand.nextInt(3) == 2)
{
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(new ArrayList())), Coord4D.get(this), 40D);
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(0, new ArrayList())), Coord4D.get(this), 40D);
}
}
}
@ -174,7 +174,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
if(worldObj.rand.nextInt(3) == 2)
{
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(new ArrayList())), Coord4D.get(this), 40D);
PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(1, new ArrayList())), Coord4D.get(this), 40D);
}
}
}
@ -219,22 +219,35 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
}
}
public void spawnParticle()
public void spawnParticle(int type)
{
switch(facing)
if(type == 0)
{
case 3:
worldObj.spawnParticle("smoke", xCoord+0.1, yCoord+1, zCoord+0.25, 0.0D, 0.0D, 0.0D);
break;
case 4:
worldObj.spawnParticle("smoke", xCoord+0.75, yCoord+1, zCoord+0.1, 0.0D, 0.0D, 0.0D);
break;
case 2:
worldObj.spawnParticle("smoke", xCoord+0.9, yCoord+1, zCoord+0.75, 0.0D, 0.0D, 0.0D);
break;
case 5:
worldObj.spawnParticle("smoke", xCoord+0.25, yCoord+1, zCoord+0.9, 0.0D, 0.0D, 0.0D);
break;
ForgeDirection side = ForgeDirection.getOrientation(facing);
double x = xCoord + (side.offsetX == 0 ? 0.5 : Math.max(side.offsetX, 0));
double z = zCoord + (side.offsetZ == 0 ? 0.5 : Math.max(side.offsetZ, 0));
worldObj.spawnParticle("smoke", x, yCoord + 0.5, z, 0.0D, 0.0D, 0.0D);
}
else if(type == 1)
{
switch(facing)
{
case 3:
worldObj.spawnParticle("smoke", xCoord+0.9, yCoord+1, zCoord+0.75, 0.0D, 0.0D, 0.0D);
break;
case 4:
worldObj.spawnParticle("smoke", xCoord+0.25, yCoord+1, zCoord+0.9, 0.0D, 0.0D, 0.0D);
break;
case 2:
worldObj.spawnParticle("smoke", xCoord+0.1, yCoord+1, zCoord+0.25, 0.0D, 0.0D, 0.0D);
break;
case 5:
worldObj.spawnParticle("smoke", xCoord+0.75, yCoord+1, zCoord+0.1, 0.0D, 0.0D, 0.0D);
break;
}
}
}
@ -390,7 +403,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
}
else if(type == 1)
{
spawnParticle();
spawnParticle(dataStream.readInt());
}
}
@ -437,10 +450,11 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
return data;
}
public ArrayList getParticlePacket(ArrayList data)
public ArrayList getParticlePacket(int type, ArrayList data)
{
super.getNetworkedData(data);
data.add(1);
data.add(type);
return data;
}

View file

@ -144,6 +144,7 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip
{
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType().blockID);
}
if(updateDelay > 0)
{
updateDelay--;
@ -188,6 +189,8 @@ public class TileEntityFactory extends TileEntityElectricBlock implements IPerip
recipeType = toSet.ordinal();
setSecondaryEnergy(0);
worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, getBlockType().blockID);
MekanismUtils.saveChunk(this);
}
}

View file

@ -155,6 +155,7 @@ item.tinIngot.name=Оловянный слиток
gas.hydrogen=Водород
gas.oxygen=Кислород
gas.water=Водяной пар
gas.chlorine=Хлор
gas.sulfurDioxideGas=Диоксид серы
gas.sulfurTrioxideGas=Триоксид серы
gas.sulfuricAcid=Серная кислота
@ -162,6 +163,7 @@ gas.sulfuricAcid=Серная кислота
//Fluids
fluid.hydrogen=Жидкий водород
fluid.oxygen=Жидкий кислород
fluid.chlorine=Жидкий хлор
fluid.sulfurDioxideGas=Жидкий диоксид серы
fluid.sulfurTrioxideGas=Жидкий триоксид серы
fluid.sulfuricAcid=Жидкая серная кислота

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB