Move to assets lang system

This commit is contained in:
robin4002 2014-02-16 00:48:23 +01:00
parent 42c98f757a
commit 754857dbb6
32 changed files with 139 additions and 361 deletions

Binary file not shown.

View file

@ -104,100 +104,100 @@ gui.pipes.emzuli.title=Extraction Presets
gui.pipes.emzuli.paint=Paint Items %s gui.pipes.emzuli.paint=Paint Items %s
gui.pipes.emzuli.nopaint=Don't Paint Items gui.pipes.emzuli.nopaint=Don't Paint Items
item.bucketFuel=Fuel Bucket item.bucketFuel.name=Fuel Bucket
item.bucketOil=Oil Bucket item.bucketOil.name=Oil Bucket
item.woodenGearItem=Wood Gear item.woodenGearItem.name=Wood Gear
item.stoneGearItem=Stone Gear item.stoneGearItem.name=Stone Gear
item.ironGearItem=Iron Gear item.ironGearItem.name=Iron Gear
item.goldGearItem=Gold Gear item.goldGearItem.name=Gold Gear
item.diamondGearItem=Diamond Gear item.diamondGearItem.name=Diamond Gear
item.templateItem=Template item.templateItem.name=Template
item.wrenchItem=Wrench item.wrenchItem.name=Wrench
item.pipeWaterproof=Pipe Sealant item.pipeWaterproof.name=Pipe Sealant
item.redPipeWire=Red Pipe Wire item.redPipeWire.name=Red Pipe Wire
item.bluePipeWire=Blue Pipe Wire item.bluePipeWire.name=Blue Pipe Wire
item.greenPipeWire=Green Pipe Wire item.greenPipeWire.name=Green Pipe Wire
item.yellowPipeWire=Yellow Pipe Wire item.yellowPipeWire.name=Yellow Pipe Wire
item.redstone_red_chipset=Redstone Chipset item.redstone_red_chipset.name=Redstone Chipset
item.redstone_iron_chipset=Iron Chipset item.redstone_iron_chipset.name=Iron Chipset
item.redstone_gold_chipset=Golden Chipset item.redstone_gold_chipset.name=Golden Chipset
item.redstone_diamond_chipset=Diamond Chipset item.redstone_diamond_chipset.name=Diamond Chipset
item.redstone_pulsating_chipset=Pulsating Chipset item.redstone_pulsating_chipset.name=Pulsating Chipset
item.redstone_quartz_chipset=Quartz Chipset item.redstone_quartz_chipset.name=Quartz Chipset
item.redstone_comp_chipset=Redstone Comp Chipset item.redstone_comp_chipset.name=Redstone Comp Chipset
item.blueprintItem=Blueprint item.blueprintItem.name=Blueprint
item.PipeItemsWood=Wooden Transport Pipe item.PipeItemsWood.name=Wooden Transport Pipe
item.PipeItemsCobblestone=Cobblestone Transport Pipe item.PipeItemsCobblestone.name=Cobblestone Transport Pipe
item.PipeItemsStone=Stone Transport Pipe item.PipeItemsStone.name=Stone Transport Pipe
item.PipeItemsQuartz=Quartz Transport Pipe item.PipeItemsQuartz.name=Quartz Transport Pipe
item.PipeItemsIron=Iron Transport Pipe item.PipeItemsIron.name=Iron Transport Pipe
item.PipeItemsGold=Golden Transport Pipe item.PipeItemsGold.name=Golden Transport Pipe
item.PipeItemsDiamond=Diamond Transport Pipe item.PipeItemsDiamond.name=Diamond Transport Pipe
item.PipeItemsObsidian=Obsidian Transport Pipe item.PipeItemsObsidian.name=Obsidian Transport Pipe
item.PipeItemsEmerald=Emerald Transport Pipe item.PipeItemsEmerald.name=Emerald Transport Pipe
item.PipeItemsLapis=Lazuli Transport Pipe item.PipeItemsLapis.name=Lazuli Transport Pipe
item.PipeItemsDaizuli=Daizuli Transport Pipe item.PipeItemsDaizuli.name=Daizuli Transport Pipe
item.PipeItemsEmzuli=Emzuli Transport Pipe item.PipeItemsEmzuli.name=Emzuli Transport Pipe
item.PipeFluidsWood=Wooden Fluid Pipe item.PipeFluidsWood.name=Wooden Fluid Pipe
item.PipeFluidsCobblestone=Cobblestone Fluid Pipe item.PipeFluidsCobblestone.name=Cobblestone Fluid Pipe
item.PipeFluidsStone=Stone Fluid Pipe item.PipeFluidsStone.name=Stone Fluid Pipe
item.PipeFluidsIron=Iron Fluid Pipe item.PipeFluidsIron.name=Iron Fluid Pipe
item.PipeFluidsGold=Golden Fluid Pipe item.PipeFluidsGold.name=Golden Fluid Pipe
item.PipeFluidsEmerald=Emerald Fluid Pipe item.PipeFluidsEmerald.name=Emerald Fluid Pipe
item.PipePowerWood=Wooden Kinesis Pipe item.PipePowerWood.name=Wooden Kinesis Pipe
item.PipePowerCobblestone=Cobblestone Kinesis Pipe item.PipePowerCobblestone.name=Cobblestone Kinesis Pipe
item.PipePowerStone=Stone Kinesis Pipe item.PipePowerStone.name=Stone Kinesis Pipe
item.PipePowerQuartz=Quartz Kinesis Pipe item.PipePowerQuartz.name=Quartz Kinesis Pipe
item.PipePowerIron=Iron Kinesis Pipe item.PipePowerIron.name=Iron Kinesis Pipe
item.PipePowerGold=Golden Kinesis Pipe item.PipePowerGold.name=Golden Kinesis Pipe
item.PipePowerDiamond=Diamond Kinesis Pipe item.PipePowerDiamond.name=Diamond Kinesis Pipe
item.PipeItemsStripes=Stripes Transport Pipe item.PipeItemsStripes.name=Stripes Transport Pipe
item.PipeStructureCobblestone=Cobblestone Structure Pipe item.PipeStructureCobblestone.name=Cobblestone Structure Pipe
item.PipeItemsVoid=Void Transport Pipe item.PipeItemsVoid.name=Void Transport Pipe
item.PipeFluidsVoid=Void Fluid Pipe item.PipeFluidsVoid.name=Void Fluid Pipe
item.PipeItemsSandstone=Sandstone Transport Pipe item.PipeItemsSandstone.name=Sandstone Transport Pipe
item.PipeFluidsSandstone=Sandstone Fluid Pipe item.PipeFluidsSandstone.name=Sandstone Fluid Pipe
item.Facade=Facade item.Facade.name=Facade
item.PipePlug=Pipe Plug item.PipePlug.name=Pipe Plug
tab.machines=Buildcraft Machines itemGroup.buildcraft.machines=Buildcraft Machines
tab.facades=Buildcraft Facades itemGroup.buildcraft.facades=Buildcraft Facades
tile.architectBlock=Architect Table tile.architectBlock.name=Architect Table
tile.assemblyTableBlock=Assembly Table tile.assemblyTableBlock.name=Assembly Table
tile.assemblyWorkbenchBlock=Advanced Crafting Table tile.assemblyWorkbenchBlock.name=Advanced Crafting Table
tile.autoWorkbenchBlock=Auto Workbench tile.autoWorkbenchBlock.name=Auto Workbench
tile.blockFuel=Fuel tile.blockFuel.name=Fuel
tile.blockHopper=Chute tile.blockHopper.name=Chute
tile.blockOil=Oil tile.blockOil.name=Oil
tile.builderBlock=Builder tile.builderBlock.name=Builder
tile.engineIron=Combustion Engine tile.engineIron.name=Combustion Engine
tile.engineStone=Stirling Engine tile.engineStone.name=Stirling Engine
tile.engineWood=Redstone Engine tile.engineWood.name=Redstone Engine
tile.fillerBlock=Filler tile.fillerBlock.name=Filler
tile.filteredBufferBlock=Filtered Buffer tile.filteredBufferBlock.name=Filtered Buffer
tile.floodGateBlock=Flood Gate tile.floodGateBlock.name=Flood Gate
tile.frameBlock=Frame tile.frameBlock.name=Frame
tile.integrationTableBlock=Integration Table tile.integrationTableBlock.name=Integration Table
tile.laserBlock=Laser tile.laserBlock.name=Laser
tile.libraryBlock=Blueprint Library tile.libraryBlock.name=Blueprint Library
tile.machineBlock=Quarry tile.machineBlock.name=Quarry
tile.markerBlock=Land Mark tile.markerBlock.name=Land Mark
tile.miningWellBlock=Mining Well tile.miningWellBlock.name=Mining Well
tile.pathMarkerBlock=Path Marker tile.pathMarkerBlock.name=Path Marker
tile.plainPipeBlock=Mining Pipe tile.plainPipeBlock.name=Mining Pipe
tile.pumpBlock=Pump tile.pumpBlock.name=Pump
tile.refineryBlock=Refinery tile.refineryBlock.name=Refinery
tile.spring.oil=Oil Spring tile.spring.oil.name=Oil Spring
tile.spring.water=Water Spring tile.spring.water.name=Water Spring
tile.tankBlock=Tank tile.tankBlock.name=Tank
tip.gate.wires=Compatible Wires: tip.gate.wires=§9§oCompatible Wires:
tip.gate.wires.redstone=Red tip.gate.wires.redstone=Red
tip.gate.wires.iron=Red, Blue tip.gate.wires.iron=Red, Blue
tip.gate.wires.gold=Red, Blue, Yellow tip.gate.wires.gold=Red, Blue, Yellow
tip.gate.wires.diamond=Red, Blue, Yellow, Green tip.gate.wires.diamond=Red, Blue, Yellow, Green
tip.gate.expansions=Installed Expansions: tip.gate.expansions=§9§oInstalled Expansions:
tip.PipeFluidsCobblestone=Basic pipe, 10 mB/t\nWon't connect to Stone tip.PipeFluidsCobblestone=Basic pipe, 10 mB/t\nWon't connect to Stone
tip.PipeFluidsEmerald=Extraction pipe, 40 mB/t tip.PipeFluidsEmerald=Extraction pipe, 40 mB/t

View file

@ -251,27 +251,21 @@ public class BuildCraftBuilders extends BuildCraftMod {
markerBlock = new BlockMarker(); markerBlock = new BlockMarker();
CoreProxy.proxy.registerBlock(markerBlock.setBlockName("markerBlock")); CoreProxy.proxy.registerBlock(markerBlock.setBlockName("markerBlock"));
CoreProxy.proxy.addName(markerBlock, "Land Mark");
pathMarkerBlock = new BlockPathMarker(); pathMarkerBlock = new BlockPathMarker();
CoreProxy.proxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock")); CoreProxy.proxy.registerBlock(pathMarkerBlock.setBlockName("pathMarkerBlock"));
CoreProxy.proxy.addName(pathMarkerBlock, "Path Mark");
fillerBlock = new BlockFiller(); fillerBlock = new BlockFiller();
CoreProxy.proxy.registerBlock(fillerBlock.setBlockName("fillerBlock")); CoreProxy.proxy.registerBlock(fillerBlock.setBlockName("fillerBlock"));
CoreProxy.proxy.addName(fillerBlock, "Filler");
builderBlock = new BlockBuilder(); builderBlock = new BlockBuilder();
CoreProxy.proxy.registerBlock(builderBlock.setBlockName("builderBlock")); CoreProxy.proxy.registerBlock(builderBlock.setBlockName("builderBlock"));
CoreProxy.proxy.addName(builderBlock, "Builder");
architectBlock = new BlockArchitect(); architectBlock = new BlockArchitect();
CoreProxy.proxy.registerBlock(architectBlock.setBlockName("architectBlock")); CoreProxy.proxy.registerBlock(architectBlock.setBlockName("architectBlock"));
CoreProxy.proxy.addName(architectBlock, "Architect Table");
libraryBlock = new BlockBlueprintLibrary(); libraryBlock = new BlockBlueprintLibrary();
CoreProxy.proxy.registerBlock(libraryBlock.setBlockName("libraryBlock")); CoreProxy.proxy.registerBlock(libraryBlock.setBlockName("libraryBlock"));
CoreProxy.proxy.addName(libraryBlock, "Blueprint Library");
GameRegistry.registerTileEntity(TileMarker.class, "Marker"); GameRegistry.registerTileEntity(TileMarker.class, "Marker");
GameRegistry.registerTileEntity(TileFiller.class, "Filler"); GameRegistry.registerTileEntity(TileFiller.class, "Filler");

View file

@ -74,7 +74,6 @@ import buildcraft.core.triggers.TriggerInventory;
import buildcraft.core.triggers.TriggerInventoryLevel; import buildcraft.core.triggers.TriggerInventoryLevel;
import buildcraft.core.triggers.TriggerMachine; import buildcraft.core.triggers.TriggerMachine;
import buildcraft.core.utils.BCLog; import buildcraft.core.utils.BCLog;
import buildcraft.core.utils.Localization;
import buildcraft.core.recipes.AssemblyRecipeManager; import buildcraft.core.recipes.AssemblyRecipeManager;
import buildcraft.core.recipes.IntegrationRecipeManager; import buildcraft.core.recipes.IntegrationRecipeManager;
import buildcraft.core.triggers.TriggerRedstoneInput; import buildcraft.core.triggers.TriggerRedstoneInput;
@ -294,9 +293,6 @@ public class BuildCraftCore extends BuildCraftMod {
CoreProxy.proxy.initializeRendering(); CoreProxy.proxy.initializeRendering();
CoreProxy.proxy.initializeEntityRendering(); CoreProxy.proxy.initializeEntityRendering();
Localization.addLocalization("/lang/buildcraft/", DefaultProps.DEFAULT_LANGUAGE);
} }
@EventHandler @EventHandler

View file

@ -17,7 +17,6 @@ import buildcraft.core.BlockSpring;
import buildcraft.core.DefaultProps; import buildcraft.core.DefaultProps;
import buildcraft.core.InterModComms; import buildcraft.core.InterModComms;
import buildcraft.core.Version; import buildcraft.core.Version;
import buildcraft.core.fluids.BCFluid;
import buildcraft.core.proxy.CoreProxy; import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.triggers.BCTrigger; import buildcraft.core.triggers.BCTrigger;
import buildcraft.energy.BlockBuildcraftFluid; import buildcraft.energy.BlockBuildcraftFluid;
@ -136,19 +135,18 @@ public class BuildCraftEnergy extends BuildCraftMod {
// Oil and fuel // Oil and fuel
buildcraftFluidOil = new BCFluid("oil").setDensity(800).setViscosity(1500); buildcraftFluidOil = new Fluid("oil").setDensity(800).setViscosity(1500);
FluidRegistry.registerFluid(buildcraftFluidOil); FluidRegistry.registerFluid(buildcraftFluidOil);
fluidOil = FluidRegistry.getFluid("oil"); fluidOil = FluidRegistry.getFluid("oil");
buildcraftFluidFuel = new BCFluid("fuel"); buildcraftFluidFuel = new Fluid("fuel");
FluidRegistry.registerFluid(buildcraftFluidFuel); FluidRegistry.registerFluid(buildcraftFluidFuel);
fluidFuel = FluidRegistry.getFluid("fuel"); fluidFuel = FluidRegistry.getFluid("fuel");
if (fluidOil.getBlock() == null) { if (fluidOil.getBlock() == null) {
blockOil = new BlockBuildcraftFluid(fluidOil, Material.water).setFlammable(canOilBurn).setFlammability(0); blockOil = new BlockBuildcraftFluid(fluidOil, Material.water).setFlammable(canOilBurn).setFlammability(0);
blockOil.setBlockName("blockOil"); blockOil.setBlockName("blockOil");
CoreProxy.proxy.addName(blockOil, "Oil");
CoreProxy.proxy.registerBlock(blockOil); CoreProxy.proxy.registerBlock(blockOil);
fluidOil.setBlock(blockOil); fluidOil.setBlock(blockOil);
} else { } else {
@ -164,7 +162,6 @@ public class BuildCraftEnergy extends BuildCraftMod {
if (fluidFuel.getBlock() == null) { if (fluidFuel.getBlock() == null) {
blockFuel = new BlockBuildcraftFluid(fluidFuel, Material.water).setFlammable(true).setFlammability(5).setParticleColor(0.7F, 0.7F, 0.0F); blockFuel = new BlockBuildcraftFluid(fluidFuel, Material.water).setFlammable(true).setFlammability(5).setParticleColor(0.7F, 0.7F, 0.0F);
blockFuel.setBlockName("blockFuel"); blockFuel.setBlockName("blockFuel");
CoreProxy.proxy.addName(blockFuel, "Fuel");
CoreProxy.proxy.registerBlock(blockFuel); CoreProxy.proxy.registerBlock(blockFuel);
fluidFuel.setBlock(blockFuel); fluidFuel.setBlock(blockFuel);
} else { } else {

View file

@ -184,43 +184,33 @@ public class BuildCraftFactory extends BuildCraftMod {
miningWellBlock = new BlockMiningWell(); miningWellBlock = new BlockMiningWell();
CoreProxy.proxy.registerBlock(miningWellBlock.setBlockName("miningWellBlock")); CoreProxy.proxy.registerBlock(miningWellBlock.setBlockName("miningWellBlock"));
CoreProxy.proxy.addName(miningWellBlock, "Mining Well");
plainPipeBlock = new BlockPlainPipe(); plainPipeBlock = new BlockPlainPipe();
CoreProxy.proxy.registerBlock(plainPipeBlock.setBlockName("plainPipeBlock")); CoreProxy.proxy.registerBlock(plainPipeBlock.setBlockName("plainPipeBlock"));
CoreProxy.proxy.addName(plainPipeBlock, "Mining Pipe");
autoWorkbenchBlock = new BlockAutoWorkbench(); autoWorkbenchBlock = new BlockAutoWorkbench();
CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setBlockName("autoWorkbenchBlock")); CoreProxy.proxy.registerBlock(autoWorkbenchBlock.setBlockName("autoWorkbenchBlock"));
CoreProxy.proxy.addName(autoWorkbenchBlock, "Automatic Crafting Table");
frameBlock = new BlockFrame(); frameBlock = new BlockFrame();
CoreProxy.proxy.registerBlock(frameBlock.setBlockName("frameBlock")); CoreProxy.proxy.registerBlock(frameBlock.setBlockName("frameBlock"));
CoreProxy.proxy.addName(frameBlock, "Frame");
quarryBlock = new BlockQuarry(); quarryBlock = new BlockQuarry();
CoreProxy.proxy.registerBlock(quarryBlock.setBlockName("machineBlock")); CoreProxy.proxy.registerBlock(quarryBlock.setBlockName("machineBlock"));
CoreProxy.proxy.addName(quarryBlock, "Quarry");
tankBlock = new BlockTank(); tankBlock = new BlockTank();
CoreProxy.proxy.registerBlock(tankBlock.setBlockName("tankBlock")); CoreProxy.proxy.registerBlock(tankBlock.setBlockName("tankBlock"));
CoreProxy.proxy.addName(tankBlock, "Tank");
pumpBlock = new BlockPump(); pumpBlock = new BlockPump();
CoreProxy.proxy.registerBlock(pumpBlock.setBlockName("pumpBlock")); CoreProxy.proxy.registerBlock(pumpBlock.setBlockName("pumpBlock"));
CoreProxy.proxy.addName(pumpBlock, "Pump");
floodGateBlock = new BlockFloodGate(); floodGateBlock = new BlockFloodGate();
CoreProxy.proxy.registerBlock(floodGateBlock.setBlockName("floodGateBlock")); CoreProxy.proxy.registerBlock(floodGateBlock.setBlockName("floodGateBlock"));
CoreProxy.proxy.addName(floodGateBlock, "Flood Gate");
refineryBlock = new BlockRefinery(); refineryBlock = new BlockRefinery();
CoreProxy.proxy.registerBlock(refineryBlock.setBlockName("refineryBlock")); CoreProxy.proxy.registerBlock(refineryBlock.setBlockName("refineryBlock"));
CoreProxy.proxy.addName(refineryBlock, "Refinery");
hopperBlock = new BlockHopper(); hopperBlock = new BlockHopper();
CoreProxy.proxy.registerBlock(hopperBlock.setBlockName("blockHopper")); CoreProxy.proxy.registerBlock(hopperBlock.setBlockName("blockHopper"));
CoreProxy.proxy.addName(hopperBlock, "Hopper");
FactoryProxy.proxy.initializeEntityRenders(); FactoryProxy.proxy.initializeEntityRenders();

View file

@ -71,7 +71,6 @@ public class BuildCraftSilicon extends BuildCraftMod {
BuildCraftCore.mainConfiguration.save(); BuildCraftCore.mainConfiguration.save();
laserBlock = new BlockLaser(); laserBlock = new BlockLaser();
CoreProxy.proxy.addName(laserBlock.setBlockName("laserBlock"), "Laser");
CoreProxy.proxy.registerBlock(laserBlock); CoreProxy.proxy.registerBlock(laserBlock);
assemblyTableBlock = new BlockLaserTable(); assemblyTableBlock = new BlockLaserTable();

View file

@ -332,7 +332,6 @@ public class BuildCraftTransport extends BuildCraftMod {
filteredBufferBlock = new BlockFilteredBuffer(); filteredBufferBlock = new BlockFilteredBuffer();
CoreProxy.proxy.registerBlock(filteredBufferBlock.setBlockName("filteredBufferBlock")); CoreProxy.proxy.registerBlock(filteredBufferBlock.setBlockName("filteredBufferBlock"));
CoreProxy.proxy.addName(filteredBufferBlock, "Filtered Buffer");
for (PipeContents kind : PipeContents.values()) { for (PipeContents kind : PipeContents.values()) {
triggerPipe[kind.ordinal()] = new TriggerPipeContents(kind); triggerPipe[kind.ordinal()] = new TriggerPipeContents(kind);

View file

@ -79,7 +79,7 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
protected void drawGuiContainerForegroundLayer(int par1, int par2) { protected void drawGuiContainerForegroundLayer(int par1, int par2) {
// fontRenderer.drawString(library.owner + "'s Library", 6, 6, // fontRenderer.drawString(library.owner + "'s Library", 6, 6,
// 0x404040); // 0x404040);
String title = StringUtils.localize("tile.libraryBlock"); String title = StringUtils.localize("tile.libraryBlock.name");
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
int c = 0; int c = 0;

View file

@ -45,7 +45,7 @@ public class GuiBuilder extends GuiAdvancedInterface {
protected void drawGuiContainerForegroundLayer(int par1, int par2) { protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2); super.drawGuiContainerForegroundLayer(par1, par2);
String title = StringUtils.localize("tile.builderBlock"); String title = StringUtils.localize("tile.builderBlock.name");
fontRendererObj.drawString(title, getCenteredOffset(title), 12, 0x404040); fontRendererObj.drawString(title, getCenteredOffset(title), 12, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.building.resources"), 8, 60, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.building.resources"), 8, 60, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);

View file

@ -61,7 +61,7 @@ public class GuiFiller extends GuiBuildCraft {
@Override @Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) { protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtils.localize("tile.fillerBlock"); String title = StringUtils.localize("tile.fillerBlock.name");
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.filling.resources"), 8, 74, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.filling.resources"), 8, 74, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, 142, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, 142, 0x404040);

View file

@ -43,7 +43,7 @@ public class GuiTemplate extends GuiBuildCraft {
@Override @Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) { protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtils.localize("tile.architectBlock"); String title = StringUtils.localize("tile.architectBlock.name");
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 152, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 152, 0x404040);

View file

@ -1,16 +1,13 @@
package buildcraft.core; package buildcraft.core;
import buildcraft.BuildCraftCore;
import buildcraft.core.utils.Localization;
import buildcraft.transport.ItemFacade;
import java.util.Locale; import java.util.Locale;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs; import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import buildcraft.BuildCraftCore;
import buildcraft.transport.ItemFacade;
public enum CreativeTabBuildCraft { public enum CreativeTabBuildCraft {
@ -30,10 +27,6 @@ public enum CreativeTabBuildCraft {
return "buildcraft." + name().toLowerCase(Locale.ENGLISH); return "buildcraft." + name().toLowerCase(Locale.ENGLISH);
} }
private String translate() {
return Localization.get("tab." + name().toLowerCase(Locale.ENGLISH));
}
private ItemStack getItem() { private ItemStack getItem() {
switch (this) { switch (this) {
case FACADES: case FACADES:
@ -55,11 +48,6 @@ public enum CreativeTabBuildCraft {
return getItem(); return getItem();
} }
@Override
public String getTranslatedTabLabel() {
return translate();
}
@Override @Override
public Item getTabIconItem() { public Item getTabIconItem() {
return getItem().getItem(); return getItem().getItem();

View file

@ -23,9 +23,4 @@ public class ItemBlockBuildCraft extends ItemBlock {
public int getMetadata(int i) { public int getMetadata(int i) {
return i; return i;
} }
@Override
public String getItemStackDisplayName(ItemStack itemstack) {
return StringUtils.localize(getUnlocalizedName(itemstack));
}
} }

View file

@ -27,11 +27,6 @@ public class ItemBuildCraft extends Item {
setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
} }
@Override
public String getItemStackDisplayName(ItemStack itemstack) {
return StringUtils.localize(getUnlocalizedName(itemstack));
}
@Override @Override
public Item setUnlocalizedName(String par1Str) { public Item setUnlocalizedName(String par1Str) {
iconName = par1Str; iconName = par1Str;

View file

@ -1,24 +0,0 @@
/**
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.core.fluids;
import buildcraft.core.utils.StringUtils;
import net.minecraftforge.fluids.Fluid;
public class BCFluid extends Fluid {
public BCFluid(String name) {
super(name);
}
@Override
public String getLocalizedName() {
return StringUtils.localize("fluid." + fluidName);
}
}

View file

@ -65,10 +65,6 @@ public class CoreProxy {
return null; return null;
} }
public String getCurrentLanguage() {
return null;
}
/* ENTITY HANDLING */ /* ENTITY HANDLING */
public void removeEntity(Entity entity) { public void removeEntity(Entity entity) {
entity.worldObj.removeEntity(entity); entity.worldObj.removeEntity(entity);
@ -79,13 +75,6 @@ public class CoreProxy {
public void feedSubBlocks(Block block, CreativeTabs tab, List itemList) { public void feedSubBlocks(Block block, CreativeTabs tab, List itemList) {
} }
/* LOCALIZATION */
public void addName(Object obj, String s) {
}
public void addLocalization(String s1, String string) {
}
public String getItemDisplayName(ItemStack newStack) { public String getItemDisplayName(ItemStack newStack) {
return ""; return "";
} }

View file

@ -81,22 +81,6 @@ public class CoreProxyClient extends CoreProxy {
block.getSubBlocks(Item.getItemFromBlock(block), tab, itemList); block.getSubBlocks(Item.getItemFromBlock(block), tab, itemList);
} }
/* LOCALIZATION */
@Override
public String getCurrentLanguage() {
return Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode();
}
@Override
public void addName(Object obj, String s) {
LanguageRegistry.addName(obj, s);
}
@Override
public void addLocalization(String s1, String string) {
LanguageRegistry.instance().addStringLocalization(s1, string);
}
@Override @Override
public String getItemDisplayName(ItemStack stack) { public String getItemDisplayName(ItemStack stack) {
if (stack.getItem() == null) if (stack.getItem() == null)

View file

@ -1,140 +0,0 @@
/**
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
* http://www.mod-buildcraft.com
*
* BuildCraft is distributed under the terms of the Minecraft Mod Public
* License 1.0, or MMPL. Please check the contents of the license located in
* http://www.mod-buildcraft.com/MMPL-1.0.txt
*/
package buildcraft.core.utils;
import buildcraft.core.proxy.CoreProxy;
import java.io.IOException;
import java.io.InputStream;
import java.util.LinkedList;
import java.util.Properties;
/**
* Simple mod localization class.
*/
public class Localization {
private static class modInfo {
final String modName, defaultLanguage;
public modInfo(String modName, String defaultLanguage) {
this.modName = modName;
this.defaultLanguage = defaultLanguage;
}
}
private static String loadedLanguage = getCurrentLanguage();
private static Properties defaultMappings = new Properties();
private static Properties mappings = new Properties();
private static LinkedList<modInfo> mods = new LinkedList<modInfo>();
/**
* Adds localization from a given directory. The files must have the same name as the corresponding language file in minecraft and a ".properties" file
* extention e.g "en_US.properties"
*
* @param path
* The path to the localization files
* @param defaultLanguage
* The default localization to be used when there is no localization for the selected language or if a string is missing (e.g. "en_US")
*/
public static void addLocalization(String path, String defaultLanguage) {
mods.add(new modInfo(path, defaultLanguage));
load(path, defaultLanguage);
}
/**
* Get a string for the given key, in the currently active translation.
*
* @param key
* @return
*/
public static synchronized String get(String key) {
if (getCurrentLanguage() == null) {
return key;
}
if (!getCurrentLanguage().equals(loadedLanguage)) {
defaultMappings.clear();
mappings.clear();
for (modInfo mInfo : mods) {
load(mInfo.modName, mInfo.defaultLanguage);
}
loadedLanguage = getCurrentLanguage();
}
return mappings.getProperty(key, defaultMappings.getProperty(key, key));
}
public static synchronized boolean hasKey(String key) {
if (getCurrentLanguage() == null) {
return false;
}
if (!getCurrentLanguage().equals(loadedLanguage)) {
defaultMappings.clear();
mappings.clear();
for (modInfo mInfo : mods) {
load(mInfo.modName, mInfo.defaultLanguage);
}
loadedLanguage = getCurrentLanguage();
}
return mappings.getProperty(key, defaultMappings.getProperty(key)) != null;
}
private static void load(String path, String default_language) {
InputStream langStream = null;
Properties modMappings = new Properties();
try {
// Load the default language mappings
langStream = Localization.class.getResourceAsStream(path + default_language + ".properties");
modMappings.load(langStream);
defaultMappings.putAll(modMappings);
langStream.close();
// Try to load the current language mappings.
// If the file doesn't exist use the default mappings.
langStream = Localization.class.getResourceAsStream(path + getCurrentLanguage() + ".properties");
if (langStream != null) {
modMappings.clear();
modMappings.load(langStream);
}
// If the selected language inherits mappings from another language
// we use those first and then we overwrite the common ones with
// those in the selected language
if (modMappings.containsKey("language.parent")) {
langStream = Localization.class.getResourceAsStream(path + modMappings.get("language.parent") + ".properties");
if (langStream != null) {
Properties parentModMappings = new Properties();
parentModMappings.load(langStream);
mappings.putAll(parentModMappings);
}
}
mappings.putAll(modMappings);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (langStream != null) {
langStream.close();
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
private static String getCurrentLanguage() {
return CoreProxy.proxy.getCurrentLanguage();
}
}

View file

@ -8,9 +8,19 @@
*/ */
package buildcraft.core.utils; package buildcraft.core.utils;
import com.google.common.base.Splitter;
import net.minecraft.util.StatCollector;
public class StringUtils { public class StringUtils {
public static String localize(String key) { public static final Splitter newLineSplitter = Splitter.on("\\n");
return Localization.get(key);
} public static String localize(String key) {
} return StatCollector.translateToLocal(key);
}
public static boolean canLocalize(String key) {
return StatCollector.canTranslate(key);
}
}

View file

@ -29,11 +29,6 @@ public class ItemBucketBuildcraft extends ItemBucket {
setContainerItem(Items.bucket); setContainerItem(Items.bucket);
} }
@Override
public String getItemStackDisplayName(ItemStack itemstack) {
return StringUtils.localize(getUnlocalizedName(itemstack));
}
@Override @Override
public Item setUnlocalizedName(String par1Str) { public Item setUnlocalizedName(String par1Str) {
iconName = par1Str; iconName = par1Str;

View file

@ -35,7 +35,7 @@ public class GuiCombustionEngine extends GuiEngine {
@Override @Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) { protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2); super.drawGuiContainerForegroundLayer(par1, par2);
String title = StringUtils.localize("tile.engineIron"); String title = StringUtils.localize("tile.engineIron.name");
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);
} }

View file

@ -29,7 +29,7 @@ public class GuiStoneEngine extends GuiEngine {
@Override @Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) { protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2); super.drawGuiContainerForegroundLayer(par1, par2);
String title = StringUtils.localize("tile.engineStone"); String title = StringUtils.localize("tile.engineStone.name");
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);
} }

View file

@ -37,7 +37,7 @@ public class GuiAutoCrafting extends GuiBuildCraft {
@Override @Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) { protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtils.localize("tile.autoWorkbenchBlock"); String title = StringUtils.localize("tile.autoWorkbenchBlock.name");
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);
} }

View file

@ -43,7 +43,7 @@ public class GuiRefinery extends GuiAdvancedInterface {
@Override @Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) { protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtils.localize("tile.refineryBlock"); String title = StringUtils.localize("tile.refineryBlock.name");
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040); fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRendererObj.drawString("->", 63, 59, 0x404040); fontRendererObj.drawString("->", 63, 59, 0x404040);
fontRendererObj.drawString("<-", 106, 59, 0x404040); fontRendererObj.drawString("<-", 106, 59, 0x404040);

View file

@ -218,7 +218,7 @@ public class TileAdvancedCraftingTable extends TileLaserTableBase implements IIn
@Override @Override
public String getInventoryName() { public String getInventoryName() {
return StringUtils.localize("tile.assemblyWorkbenchBlock"); return StringUtils.localize("tile.assemblyWorkbenchBlock.name");
} }
@Override @Override

View file

@ -130,7 +130,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
@Override @Override
public String getInventoryName() { public String getInventoryName() {
return StringUtils.localize("tile.assemblyTableBlock"); return StringUtils.localize("tile.assemblyTableBlock.name");
} }
@Override @Override

View file

@ -164,7 +164,7 @@ public class TileIntegrationTable extends TileLaserTableBase implements ISidedIn
@Override @Override
public String getInventoryName() { public String getInventoryName() {
return StringUtils.localize("tile.integrationTableBlock"); return StringUtils.localize("tile.integrationTableBlock.name");
} }
@Override @Override

View file

@ -138,7 +138,7 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
@Override @Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) { protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2); super.drawGuiContainerForegroundLayer(par1, par2);
String title = StringUtils.localize("tile.assemblyTableBlock"); String title = StringUtils.localize("tile.assemblyTableBlock.name");
fontRendererObj.drawString(title, getCenteredOffset(title), 15, 0x404040); fontRendererObj.drawString(title, getCenteredOffset(title), 15, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040); fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);
drawForegroundSelection(par1, par2); drawForegroundSelection(par1, par2);

View file

@ -8,15 +8,19 @@
*/ */
package buildcraft.transport; package buildcraft.transport;
import buildcraft.core.utils.Localization; import buildcraft.core.utils.StringUtils;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class PipeToolTipManager { public class PipeToolTipManager {
@ -35,13 +39,13 @@ public class PipeToolTipManager {
public static List<String> getToolTip(Class<? extends Pipe> pipe) { public static List<String> getToolTip(Class<? extends Pipe> pipe) {
List<String> tips = new ArrayList<String>(); List<String> tips = new ArrayList<String>();
String tipTag = "tip." + pipe.getSimpleName(); String tipTag = "tip." + pipe.getSimpleName();
if (Localization.hasKey(tipTag)) { if (StringUtils.canLocalize(tipTag)) {
String localized = Localization.get(tipTag); String localized = StringUtils.localize(tipTag);
if (localized != null) { if (localized != null) {
String[] lines = localized.split("\\n"); String[] lines = (String[])Iterables.toArray(StringUtils.newLineSplitter.split(localized), String.class);
tips.addAll(Arrays.asList(lines)); tips.addAll(Arrays.asList(lines));
} }
} }
String tip = toolTips.get(pipe); String tip = toolTips.get(pipe);
if (tip != null) if (tip != null)
tips.add(tip); tips.add(tip);

View file

@ -16,7 +16,7 @@ import buildcraft.api.gates.IAction;
import buildcraft.api.gates.ITrigger; import buildcraft.api.gates.ITrigger;
import buildcraft.core.ItemBuildCraft; import buildcraft.core.ItemBuildCraft;
import buildcraft.core.inventory.InvUtils; import buildcraft.core.inventory.InvUtils;
import buildcraft.core.utils.Localization; import buildcraft.core.utils.StringUtils;
import buildcraft.core.utils.Utils; import buildcraft.core.utils.Utils;
import buildcraft.transport.Gate; import buildcraft.transport.Gate;
import buildcraft.transport.gates.GateDefinition.GateLogic; import buildcraft.transport.gates.GateDefinition.GateLogic;
@ -39,6 +39,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagList;
import net.minecraft.nbt.NBTTagString; import net.minecraft.nbt.NBTTagString;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
public class ItemGate extends ItemBuildCraft { public class ItemGate extends ItemBuildCraft {
@ -174,6 +175,12 @@ public class ItemGate extends ItemBuildCraft {
public String getUnlocalizedName(ItemStack stack) { public String getUnlocalizedName(ItemStack stack) {
return GateDefinition.getLocalizedName(getMaterial(stack), getLogic(stack)); return GateDefinition.getLocalizedName(getMaterial(stack), getLogic(stack));
} }
@Override
public String getItemStackDisplayName(ItemStack stack)
{
return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack))).trim();
}
@SuppressWarnings({"unchecked", "rawtypes"}) @SuppressWarnings({"unchecked", "rawtypes"})
@Override @Override
@ -216,12 +223,12 @@ public class ItemGate extends ItemBuildCraft {
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean adv) {
super.addInformation(stack, player, list, adv); super.addInformation(stack, player, list, adv);
list.add("§9§o" + Localization.get("tip.gate.wires")); list.add(StringUtils.localize("tip.gate.wires"));
list.add(Localization.get("tip.gate.wires." + getMaterial(stack).getTag())); list.add(StringUtils.localize("tip.gate.wires." + getMaterial(stack).getTag()));
Set<IGateExpansion> expansions = getInstalledExpansions(stack); Set<IGateExpansion> expansions = getInstalledExpansions(stack);
if (!expansions.isEmpty()) { if (!expansions.isEmpty()) {
list.add("§9§o" + Localization.get("tip.gate.expansions")); list.add(StringUtils.localize("tip.gate.expansions"));
for (IGateExpansion expansion : expansions) { for (IGateExpansion expansion : expansions) {
list.add(expansion.getDisplayName()); list.add(expansion.getDisplayName());

View file

@ -53,7 +53,7 @@ public class GuiFilteredBuffer extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) { protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtils.localize("tile.filteredBufferBlock"); String title = StringUtils.localize("tile.filteredBufferBlock.name");
int xPos = (xSize - fontRendererObj.getStringWidth(title)) / 2; int xPos = (xSize - fontRendererObj.getStringWidth(title)) / 2;
fontRendererObj.drawString(title, xPos, 10, 0x404040); fontRendererObj.drawString(title, xPos, 10, 0x404040);
} }