Localization & gas fixes

This commit is contained in:
Aidan Brady 2013-11-30 11:31:18 -05:00
parent 4c67bef17e
commit 0c618a1cf3
7 changed files with 30 additions and 12 deletions

View file

@ -67,7 +67,7 @@ public class Gas
public NBTTagCompound write(NBTTagCompound nbtTags)
{
nbtTags.setInteger("id", getID());
nbtTags.setString("gasName", getName());
return nbtTags;
}
@ -79,7 +79,7 @@ public class Gas
return null;
}
return GasRegistry.getGas(nbtTags.getInteger("id"));
return GasRegistry.getGas(nbtTags.getString("gasName"));
}
public boolean hasFluid()

View file

@ -50,6 +50,11 @@ public class GasStack
GasStack stack = new GasStack();
stack.read(nbtTags);
if(stack.getGas() == null)
{
return null;
}
return stack;
}

View file

@ -48,12 +48,12 @@ public class GuiRotaryCondensentrator extends GuiMekanism
if(xAxis >= 26 && xAxis <= 42 && yAxis >= 14 && yAxis <= 72)
{
drawCreativeTabHoveringText(tileEntity.gasTank != null ? tileEntity.gasTank.getGas().getLocalizedName() + ": " + tileEntity.gasTank.amount : "Empty", xAxis, yAxis);
drawCreativeTabHoveringText(tileEntity.gasTank != null ? tileEntity.gasTank.getGas().getLocalizedName() + ": " + tileEntity.gasTank.amount : MekanismUtils.localize("gui.empty"), xAxis, yAxis);
}
if(xAxis >= 134 && xAxis <= 150 && yAxis >= 14 && yAxis <= 72)
{
drawCreativeTabHoveringText(tileEntity.fluidTank.getFluid() != null ? tileEntity.fluidTank.getFluid().getFluid().getLocalizedName() + ": " + tileEntity.fluidTank.getFluid().amount + "mB" : "Empty", xAxis, yAxis);
drawCreativeTabHoveringText(tileEntity.fluidTank.getFluid() != null ? tileEntity.fluidTank.getFluid().getFluid().getLocalizedName() + ": " + tileEntity.fluidTank.getFluid().amount + "mB" : MekanismUtils.localize("gui.empty"), xAxis, yAxis);
}
if(xAxis >= 116 && xAxis <= 168 && yAxis >= 76 && yAxis <= 80)
@ -63,7 +63,7 @@ public class GuiRotaryCondensentrator extends GuiMekanism
if(xAxis >= 4 && xAxis <= 22 && yAxis >= 4 && yAxis <= 22)
{
drawCreativeTabHoveringText("Toggle operation", xAxis, yAxis);
drawCreativeTabHoveringText(MekanismUtils.localize("gui.rotaryCondensentrator.toggleOperation"), xAxis, yAxis);
}
super.drawGuiContainerForegroundLayer(mouseX, mouseY);

View file

@ -250,13 +250,16 @@ public class BlockBasic extends Block
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int i1, float f1, float f2, float f3)
{
if(ItemAttacher.canAttach(entityplayer.getCurrentEquippedItem()))
{
return false;
}
int metadata = world.getBlockMetadata(x, y, z);
if(metadata != 6)
{
if(ItemAttacher.canAttach(entityplayer.getCurrentEquippedItem()))
{
return false;
}
}
if(metadata == 2)
{
if(entityplayer.isSneaking())

View file

@ -55,6 +55,12 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI
return metaBlock.getIcon(2, i);
}
@Override
public String getUnlocalizedName(ItemStack itemstack)
{
return getUnlocalizedName() + "." + "GasTank";
}
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
{

View file

@ -69,7 +69,7 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IPo
@Override
public String getInvName()
{
return MekanismUtils.localize(getBlockType().getUnlocalizedName() + "." + tier.name + fullName + ".name");
return MekanismUtils.localize(getBlockType().getUnlocalizedName() + "." + tier.name + ".name");
}
@Override

View file

@ -13,7 +13,6 @@ item.AtomicDisassembler.name=Atomic Disassembler
item.AtomicCore.name=Atomic Core
item.ElectricBow.name=Electric Bow
item.BoundingBlock.name=Bounding Block
tile.GasTank.name=Gas Tank
item.StorageTank.name=Storage Tank
item.ControlCircuit.name=Control Circuit
item.EnrichedIron.name=Enriched Iron
@ -25,6 +24,9 @@ item.NetworkReader.name=Network Reader
item.ManganeseAlloy.name=Manganese Alloy
item.WalkieTalkie.name=Walkie-Talkie
//Gas Tank
tile.GasTank.GasTank.name=Gas Tank
//Basic Block
tile.BasicBlock.OsmiumBlock.name=Osmium Block
tile.BasicBlock.BronzeBlock.name=Bronze Block
@ -155,6 +157,8 @@ gui.slots=Slots
gui.configuration=Configuration
gui.configuration.strictInput=Strict Input
gui.rotaryCondensentrator.toggleOperation=Toggle operation
gui.factory.secondaryEnergy=Secondary energy
gui.factory.smelting=Smelting
gui.factory.enriching=Enriching