diff options
author | Antifluxfield <lyj_299792458@163.com> | 2017-10-19 16:51:13 +0800 |
---|---|---|
committer | Antifluxfield <lyj_299792458@163.com> | 2017-10-19 16:51:13 +0800 |
commit | 4c6415d8a26d09a46fe6ca095376fa49395e971e (patch) | |
tree | bcb28a2c3e650012f19c512aa60469c809d0ea27 /src/main/java/gregtech/common | |
parent | 2d0053f921cec8a684ea71c029abc44a8e4fad17 (diff) | |
download | GT5-Unofficial-4c6415d8a26d09a46fe6ca095376fa49395e971e.tar.gz GT5-Unofficial-4c6415d8a26d09a46fe6ca095376fa49395e971e.tar.bz2 GT5-Unofficial-4c6415d8a26d09a46fe6ca095376fa49395e971e.zip |
l10n improve
Diffstat (limited to 'src/main/java/gregtech/common')
9 files changed, 582 insertions, 531 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java index 2f54c9c415..3598d602d4 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Metal.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Metal.java @@ -1,43 +1,43 @@ -package gregtech.common.blocks; - -import cpw.mods.fml.common.Loader; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.IIconContainer; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_OreDictUnificator; -import net.minecraft.block.material.Material; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -public class GT_Block_Metal extends GT_Block_Storage { - public Materials[] mMats; - public OrePrefixes mPrefix; - public IIconContainer[] mBlockIcons; - public boolean mHideBlocks; - - public GT_Block_Metal(String aName, Materials[] aMats, OrePrefixes aPrefix, IIconContainer[] aBlockIcons) { - super(GT_Item_Storage.class, aName, Material.iron); - mMats = aMats; - mPrefix = aPrefix; - mBlockIcons = aBlockIcons; - mHideBlocks = Loader.isModLoaded("NotEnoughItems"); - - for (int i = 0; i < aMats.length; i++) { - if (aMats[i].mMetaItemSubID > 0 && aMats[i].mHasParentMod) { - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", "Block of " + aMats[i].mDefaultLocalName); - GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i)); - } - } - if (aMats.length<16 && Loader.isModLoaded("NotEnoughItems")) { - for (int i = aMats.length; i < 16; i++) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i)); - } - } - - public IIcon getIcon(int aSide, int aMeta) { - if ((aMeta >= 0) && (aMeta < 16) && aMeta < mMats.length) { - return mBlockIcons[aMeta].getIcon(); - } - return null; - } -} +package gregtech.common.blocks;
+
+import cpw.mods.fml.common.Loader;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.IIconContainer;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_OreDictUnificator;
+import net.minecraft.block.material.Material;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+
+public class GT_Block_Metal extends GT_Block_Storage {
+ public Materials[] mMats;
+ public OrePrefixes mPrefix;
+ public IIconContainer[] mBlockIcons;
+ public boolean mHideBlocks;
+
+ public GT_Block_Metal(String aName, Materials[] aMats, OrePrefixes aPrefix, IIconContainer[] aBlockIcons) {
+ super(GT_Item_Storage.class, aName, Material.iron);
+ mMats = aMats;
+ mPrefix = aPrefix;
+ mBlockIcons = aBlockIcons;
+ mHideBlocks = Loader.isModLoaded("NotEnoughItems");
+
+ for (int i = 0; i < aMats.length; i++) {
+ if (aMats[i].mMetaItemSubID > 0 && aMats[i].mHasParentMod) {
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + i + ".name", "Block of %material");
+ GT_OreDictUnificator.registerOre(aPrefix, aMats[i], new ItemStack(this, 1, i));
+ }
+ }
+ if (aMats.length<16 && Loader.isModLoaded("NotEnoughItems")) {
+ for (int i = aMats.length; i < 16; i++) codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i));
+ }
+ }
+
+ public IIcon getIcon(int aSide, int aMeta) {
+ if ((aMeta >= 0) && (aMeta < 16) && aMeta < mMats.length) {
+ return mBlockIcons[aMeta].getIcon();
+ }
+ return null;
+ }
+}
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java index 5595fa8673..82da6f3a4c 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Ores_Abstract.java @@ -1,273 +1,278 @@ -package gregtech.common.blocks; - -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.GT_Mod; -import gregtech.api.GregTech_API; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.interfaces.ITexture; -import gregtech.api.items.GT_Generic_Block; -import gregtech.api.util.GT_LanguageManager; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.common.render.GT_Renderer_Block; -import net.minecraft.block.Block; -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -import net.minecraft.entity.boss.EntityDragon; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements ITileEntityProvider { - public static ThreadLocal<GT_TileEntity_Ores> mTemporaryTileEntity = new ThreadLocal(); - public static boolean FUCKING_LOCK = false; - public static boolean tHideOres; - private final String aTextName = ".name"; - private final String aTextSmall = "Small "; - public static Set aBlockedOres = new HashSet<Materials>(); - - protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) { - super(GT_Item_Ores.class, aUnlocalizedName, aMaterial); - this.isBlockContainer = true; - setStepSound(soundTypeStone); - setCreativeTab(GregTech_API.TAB_GREGTECH_ORES); - tHideOres = Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres; - if(aOreMetaCount > 8 || aOreMetaCount < 0) aOreMetaCount = 8; - - for (int i = 0; i < 16; i++) { - GT_ModHandler.addValuableOre(this, i, 1); - } - for (int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) { - if (GregTech_API.sGeneratedMaterials[i] != null) { - for (int j = 0; j < aOreMetaCount; j++) { - if (!this.getEnabledMetas()[j]) continue; - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + (j * 1000)) + aTextName, getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + aTextName, aTextSmall + getLocalizedName(GregTech_API.sGeneratedMaterials[i])); - if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0 && !aBlockedOres.contains(GregTech_API.sGeneratedMaterials[i])) { - GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[j] != null ? this.getProcessingPrefix()[j].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + (j * 1000))); - if (tHideOres) { - if (!(j == 0 && !aHideFirstMeta)) { - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + (j * 1000))); - } - codechicken.nei.api.API.hideItem(new ItemStack(this, 1, (i + 16000) + (j * 1000))); - } - } - } - } - } - } - - public int getBaseBlockHarvestLevel(int aMeta) { - return 0; - } - - public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) { - if (!FUCKING_LOCK) { - FUCKING_LOCK = true; - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof GT_TileEntity_Ores)) { - ((GT_TileEntity_Ores) tTileEntity).onUpdated(); - } - } - FUCKING_LOCK = false; - } - - public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aBlock) { - if (!FUCKING_LOCK) { - FUCKING_LOCK = true; - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof GT_TileEntity_Ores)) { - ((GT_TileEntity_Ores) tTileEntity).onUpdated(); - } - } - FUCKING_LOCK = false; - } - - public String getLocalizedName(Materials aMaterial) { - switch (aMaterial.mName) { - case "InfusedAir": - case "InfusedDull": - case "InfusedEarth": - case "InfusedEntropy": - case "InfusedFire": - case "InfusedOrder": - case "InfusedVis": - case "InfusedWater": - return aMaterial.mDefaultLocalName + " Infused Stone"; - case "Vermiculite": - case "Bentonite": - case "Kaolinite": - case "Talc": - case "BasalticMineralSand": - case "GraniticMineralSand": - case "GlauconiteSand": - case "CassiteriteSand": - case "GarnetSand": - case "QuartzSand": - case "Pitchblende": - case "FullersEarth": - return aMaterial.mDefaultLocalName; - default: - return aMaterial.mDefaultLocalName + OrePrefixes.ore.mLocalizedMaterialPost; - } - } - - public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) { - super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_); - TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_); - return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false; - } - - public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) { - return (!(entity instanceof EntityDragon)) && (super.canEntityDestroy(world, x, y, z, entity)); - } - - public String getHarvestTool(int aMeta) { - return aMeta < 8 ? "pickaxe" : "shovel"; - } - - public int getHarvestLevel(int aMeta) { - return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8; - } - - public float getBlockHardness(World aWorld, int aX, int aY, int aZ) { - return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F; - } - - public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, double explosionY, double explosionZ) { - return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F; - } - - protected boolean canSilkHarvest() { - return false; - } - - public abstract String getUnlocalizedName(); - - public String getLocalizedName() { - return StatCollector.translateToLocal(getUnlocalizedName() + aTextName); - } - - public int getRenderType() { - if (GT_Renderer_Block.INSTANCE == null) { - return super.getRenderType(); - } - return GT_Renderer_Block.INSTANCE.mRenderID; - } - - public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) { - return false; - } - - public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) { - return true; - } - - public boolean hasTileEntity(int aMeta) { - return true; - } - - public boolean renderAsNormalBlock() { - return true; - } - - public boolean isOpaqueCube() { - return true; - } - - public TileEntity createNewTileEntity(World aWorld, int aMeta) { - return createTileEntity(aWorld, aMeta); - } - - public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) { - return Blocks.stone.getIcon(0, 0); - } - - public IIcon getIcon(int aSide, int aMeta) { - return Blocks.stone.getIcon(0, 0); - } - - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister aIconRegister) { - } - - public int getDamageValue(World aWorld, int aX, int aY, int aZ) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if (((tTileEntity instanceof GT_TileEntity_Ores))) { - return ((GT_TileEntity_Ores) tTileEntity).getMetaData(); - } - return 0; - } - - public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof GT_TileEntity_Ores)) { - mTemporaryTileEntity.set((GT_TileEntity_Ores) tTileEntity); - } - super.breakBlock(aWorld, aX, aY, aZ, par5, par6); - aWorld.removeTileEntity(aX, aY, aZ); - } - - public abstract OrePrefixes[] getProcessingPrefix(); //Must have 8 entries; an entry can be null to disable automatic recipes. - - public abstract boolean[] getEnabledMetas(); //Must have 8 entries. - - public abstract Block getDroppedBlock(); - - public abstract Materials[] getDroppedDusts(); //Must have 8 entries; can be null. - - public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) { - TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ); - if ((tTileEntity instanceof GT_TileEntity_Ores)) { - return ((GT_TileEntity_Ores) tTileEntity).getDrops(getDroppedBlock(), aFortune); - } - return mTemporaryTileEntity.get() == null ? new ArrayList() : ((GT_TileEntity_Ores) mTemporaryTileEntity.get()).getDrops(getDroppedBlock(), aFortune); - } - - public TileEntity createTileEntity(World aWorld, int aMeta) { - return new GT_TileEntity_Ores(); - } - - public abstract ITexture[] getTextureSet(); //Must have 16 entries. - - @Override - public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) { - for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) { - Materials tMaterial = GregTech_API.sGeneratedMaterials[i]; - if ((tMaterial != null) && ((tMaterial.mTypes & 0x8) != 0)&& !aBlockedOres.contains(tMaterial)) { - if (!(new ItemStack(aItem, 1, i).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i)); - if (!(new ItemStack(aItem, 1, i + 1000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 1000)); - if (!(new ItemStack(aItem, 1, i + 2000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 2000)); - if (!(new ItemStack(aItem, 1, i + 3000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 3000)); - if (!(new ItemStack(aItem, 1, i + 4000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 4000)); - if (!(new ItemStack(aItem, 1, i + 5000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 5000)); - if (!(new ItemStack(aItem, 1, i + 6000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 6000)); - if (!(new ItemStack(aItem, 1, i + 7000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 7000)); - if (!(new ItemStack(aItem, 1, i + 16000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 16000)); - if (!(new ItemStack(aItem, 1, i + 17000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 17000)); - if (!(new ItemStack(aItem, 1, i + 18000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 18000)); - if (!(new ItemStack(aItem, 1, i + 19000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 19000)); - if (!(new ItemStack(aItem, 1, i + 20000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 20000)); - if (!(new ItemStack(aItem, 1, i + 21000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 21000)); - if (!(new ItemStack(aItem, 1, i + 22000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 22000)); - if (!(new ItemStack(aItem, 1, i + 23000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 23000)); - } - } - } +package gregtech.common.blocks;
+
+import cpw.mods.fml.common.Loader;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.GT_Mod;
+import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
+import gregtech.api.enums.OrePrefixes;
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.items.GT_Generic_Block;
+import gregtech.api.util.GT_LanguageManager;
+import gregtech.api.util.GT_ModHandler;
+import gregtech.api.util.GT_OreDictUnificator;
+import gregtech.common.render.GT_Renderer_Block;
+import net.minecraft.block.Block;
+import net.minecraft.block.ITileEntityProvider;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.boss.EntityDragon;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public abstract class GT_Block_Ores_Abstract extends GT_Generic_Block implements ITileEntityProvider {
+ public static ThreadLocal<GT_TileEntity_Ores> mTemporaryTileEntity = new ThreadLocal();
+ public static boolean FUCKING_LOCK = false;
+ public static boolean tHideOres;
+ private final String aTextName = ".name";
+ private final String aTextSmall = "Small ";
+ public static Set aBlockedOres = new HashSet<Materials>();
+
+ protected GT_Block_Ores_Abstract(String aUnlocalizedName, int aOreMetaCount, boolean aHideFirstMeta, Material aMaterial) {
+ super(GT_Item_Ores.class, aUnlocalizedName, aMaterial);
+ this.isBlockContainer = true;
+ setStepSound(soundTypeStone);
+ setCreativeTab(GregTech_API.TAB_GREGTECH_ORES);
+ tHideOres = Loader.isModLoaded("NotEnoughItems") && GT_Mod.gregtechproxy.mHideUnusedOres;
+ if(aOreMetaCount > 8 || aOreMetaCount < 0) aOreMetaCount = 8;
+
+ for (int i = 0; i < 16; i++) {
+ GT_ModHandler.addValuableOre(this, i, 1);
+ }
+ for (int i = 1; i < GregTech_API.sGeneratedMaterials.length; i++) {
+ if (GregTech_API.sGeneratedMaterials[i] != null) {
+ for (int j = 0; j < aOreMetaCount; j++) {
+ if (!this.getEnabledMetas()[j]) continue;
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + (i + (j * 1000)) + aTextName, getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]));
+ GT_LanguageManager.addStringLocalization(getUnlocalizedName() + "." + ((i + 16000) + (j * 1000)) + aTextName, aTextSmall + getLocalizedNameFormat(GregTech_API.sGeneratedMaterials[i]));
+ if ((GregTech_API.sGeneratedMaterials[i].mTypes & 0x8) != 0 && !aBlockedOres.contains(GregTech_API.sGeneratedMaterials[i])) {
+ GT_OreDictUnificator.registerOre(this.getProcessingPrefix()[j] != null ? this.getProcessingPrefix()[j].get(GregTech_API.sGeneratedMaterials[i]) : "", new ItemStack(this, 1, i + (j * 1000)));
+ if (tHideOres) {
+ if (!(j == 0 && !aHideFirstMeta)) {
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, i + (j * 1000)));
+ }
+ codechicken.nei.api.API.hideItem(new ItemStack(this, 1, (i + 16000) + (j * 1000)));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ public int getBaseBlockHarvestLevel(int aMeta) {
+ return 0;
+ }
+
+ public void onNeighborChange(IBlockAccess aWorld, int aX, int aY, int aZ, int aTileX, int aTileY, int aTileZ) {
+ if (!FUCKING_LOCK) {
+ FUCKING_LOCK = true;
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if ((tTileEntity instanceof GT_TileEntity_Ores)) {
+ ((GT_TileEntity_Ores) tTileEntity).onUpdated();
+ }
+ }
+ FUCKING_LOCK = false;
+ }
+
+ public void onNeighborBlockChange(World aWorld, int aX, int aY, int aZ, Block aBlock) {
+ if (!FUCKING_LOCK) {
+ FUCKING_LOCK = true;
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if ((tTileEntity instanceof GT_TileEntity_Ores)) {
+ ((GT_TileEntity_Ores) tTileEntity).onUpdated();
+ }
+ }
+ FUCKING_LOCK = false;
+ }
+
+ public String getLocalizedNameFormat(Materials aMaterial) {
+ switch (aMaterial.mName) {
+ case "InfusedAir":
+ case "InfusedDull":
+ case "InfusedEarth":
+ case "InfusedEntropy":
+ case "InfusedFire":
+ case "InfusedOrder":
+ case "InfusedVis":
+ case "InfusedWater":
+ return "%material Infused Stone";
+ case "Vermiculite":
+ case "Bentonite":
+ case "Kaolinite":
+ case "Talc":
+ case "BasalticMineralSand":
+ case "GraniticMineralSand":
+ case "GlauconiteSand":
+ case "CassiteriteSand":
+ case "GarnetSand":
+ case "QuartzSand":
+ case "Pitchblende":
+ case "FullersEarth":
+ return "%material";
+ default:
+ return "%material" + OrePrefixes.ore.mLocalizedMaterialPost;
+ }
+ }
+
+ @Deprecated
+ public String getLocalizedName(Materials aMaterial) {
+ return aMaterial.getLocalizedNameForItem(getLocalizedNameFormat(aMaterial));
+ }
+
+ public boolean onBlockEventReceived(World p_149696_1_, int p_149696_2_, int p_149696_3_, int p_149696_4_, int p_149696_5_, int p_149696_6_) {
+ super.onBlockEventReceived(p_149696_1_, p_149696_2_, p_149696_3_, p_149696_4_, p_149696_5_, p_149696_6_);
+ TileEntity tileentity = p_149696_1_.getTileEntity(p_149696_2_, p_149696_3_, p_149696_4_);
+ return tileentity != null ? tileentity.receiveClientEvent(p_149696_5_, p_149696_6_) : false;
+ }
+
+ public boolean canEntityDestroy(IBlockAccess world, int x, int y, int z, Entity entity) {
+ return (!(entity instanceof EntityDragon)) && (super.canEntityDestroy(world, x, y, z, entity));
+ }
+
+ public String getHarvestTool(int aMeta) {
+ return aMeta < 8 ? "pickaxe" : "shovel";
+ }
+
+ public int getHarvestLevel(int aMeta) {
+ return aMeta == 5 || aMeta == 6 ? 2 : aMeta % 8;
+ }
+
+ public float getBlockHardness(World aWorld, int aX, int aY, int aZ) {
+ return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F;
+ }
+
+ public float getExplosionResistance(Entity par1Entity, World aWorld, int aX, int aY, int aZ, double explosionX, double explosionY, double explosionZ) {
+ return 1.0F + getHarvestLevel(aWorld.getBlockMetadata(aX, aY, aZ)) * 1.0F;
+ }
+
+ protected boolean canSilkHarvest() {
+ return false;
+ }
+
+ public abstract String getUnlocalizedName();
+
+ public String getLocalizedName() {
+ return StatCollector.translateToLocal(getUnlocalizedName() + aTextName);
+ }
+
+ public int getRenderType() {
+ if (GT_Renderer_Block.INSTANCE == null) {
+ return super.getRenderType();
+ }
+ return GT_Renderer_Block.INSTANCE.mRenderID;
+ }
+
+ public boolean canBeReplacedByLeaves(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ return false;
+ }
+
+ public boolean isNormalCube(IBlockAccess aWorld, int aX, int aY, int aZ) {
+ return true;
+ }
+
+ public boolean hasTileEntity(int aMeta) {
+ return true;
+ }
+
+ public boolean renderAsNormalBlock() {
+ return true;
+ }
+
+ public boolean isOpaqueCube() {
+ return true;
+ }
+
+ public TileEntity createNewTileEntity(World aWorld, int aMeta) {
+ return createTileEntity(aWorld, aMeta);
+ }
+
+ public IIcon getIcon(IBlockAccess aIBlockAccess, int aX, int aY, int aZ, int aSide) {
+ return Blocks.stone.getIcon(0, 0);
+ }
+
+ public IIcon getIcon(int aSide, int aMeta) {
+ return Blocks.stone.getIcon(0, 0);
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void registerBlockIcons(IIconRegister aIconRegister) {
+ }
+
+ public int getDamageValue(World aWorld, int aX, int aY, int aZ) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if (((tTileEntity instanceof GT_TileEntity_Ores))) {
+ return ((GT_TileEntity_Ores) tTileEntity).getMetaData();
+ }
+ return 0;
+ }
+
+ public void breakBlock(World aWorld, int aX, int aY, int aZ, Block par5, int par6) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if ((tTileEntity instanceof GT_TileEntity_Ores)) {
+ mTemporaryTileEntity.set((GT_TileEntity_Ores) tTileEntity);
+ }
+ super.breakBlock(aWorld, aX, aY, aZ, par5, par6);
+ aWorld.removeTileEntity(aX, aY, aZ);
+ }
+
+ public abstract OrePrefixes[] getProcessingPrefix(); //Must have 8 entries; an entry can be null to disable automatic recipes.
+
+ public abstract boolean[] getEnabledMetas(); //Must have 8 entries.
+
+ public abstract Block getDroppedBlock();
+
+ public abstract Materials[] getDroppedDusts(); //Must have 8 entries; can be null.
+
+ public ArrayList<ItemStack> getDrops(World aWorld, int aX, int aY, int aZ, int aMeta, int aFortune) {
+ TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
+ if ((tTileEntity instanceof GT_TileEntity_Ores)) {
+ return ((GT_TileEntity_Ores) tTileEntity).getDrops(getDroppedBlock(), aFortune);
+ }
+ return mTemporaryTileEntity.get() == null ? new ArrayList() : ((GT_TileEntity_Ores) mTemporaryTileEntity.get()).getDrops(getDroppedBlock(), aFortune);
+ }
+
+ public TileEntity createTileEntity(World aWorld, int aMeta) {
+ return new GT_TileEntity_Ores();
+ }
+
+ public abstract ITexture[] getTextureSet(); //Must have 16 entries.
+
+ @Override
+ public void getSubBlocks(Item aItem, CreativeTabs aTab, List aList) {
+ for (int i = 0; i < GregTech_API.sGeneratedMaterials.length; i++) {
+ Materials tMaterial = GregTech_API.sGeneratedMaterials[i];
+ if ((tMaterial != null) && ((tMaterial.mTypes & 0x8) != 0)&& !aBlockedOres.contains(tMaterial)) {
+ if (!(new ItemStack(aItem, 1, i).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i));
+ if (!(new ItemStack(aItem, 1, i + 1000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 1000));
+ if (!(new ItemStack(aItem, 1, i + 2000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 2000));
+ if (!(new ItemStack(aItem, 1, i + 3000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 3000));
+ if (!(new ItemStack(aItem, 1, i + 4000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 4000));
+ if (!(new ItemStack(aItem, 1, i + 5000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 5000));
+ if (!(new ItemStack(aItem, 1, i + 6000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 6000));
+ if (!(new ItemStack(aItem, 1, i + 7000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 7000));
+ if (!(new ItemStack(aItem, 1, i + 16000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 16000));
+ if (!(new ItemStack(aItem, 1, i + 17000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 17000));
+ if (!(new ItemStack(aItem, 1, i + 18000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 18000));
+ if (!(new ItemStack(aItem, 1, i + 19000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 19000));
+ if (!(new ItemStack(aItem, 1, i + 20000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 20000));
+ if (!(new ItemStack(aItem, 1, i + 21000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 21000));
+ if (!(new ItemStack(aItem, 1, i + 22000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 22000));
+ if (!(new ItemStack(aItem, 1, i + 23000).getDisplayName().contains(aTextName))) aList.add(new ItemStack(aItem, 1, i + 23000));
+ }
+ }
+ }
}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java index aa54506468..7586787505 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Machines.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Machines.java @@ -2,7 +2,12 @@ package gregtech.common.blocks; import gregtech.api.GregTech_API;
import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Materials;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Cable;
+import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Fluid;
+import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Frame;
+import gregtech.api.metatileentity.implementations.GT_MetaPipeEntity_Item;
import gregtech.api.util.GT_ItsNotMyFaultException;
import gregtech.api.util.GT_LanguageManager;
import gregtech.api.util.GT_Log;
@@ -100,6 +105,27 @@ public class GT_Item_Machines return "";
}
+ public String getItemStackDisplayName(ItemStack aStack) {
+ String aName = super.getItemStackDisplayName(aStack);
+ short aDamage = (short) getDamage(aStack);
+ if (aDamage >= 0 && aDamage < GregTech_API.METATILEENTITIES.length && GregTech_API.METATILEENTITIES[aDamage] != null) {
+ Materials aMaterial = null;
+ if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Item) {
+ aMaterial = ((GT_MetaPipeEntity_Item) GregTech_API.METATILEENTITIES[aDamage]).mMaterial;
+ } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Fluid) {
+ aMaterial = ((GT_MetaPipeEntity_Fluid) GregTech_API.METATILEENTITIES[aDamage]).mMaterial;
+ } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Cable) {
+ aMaterial = ((GT_MetaPipeEntity_Cable) GregTech_API.METATILEENTITIES[aDamage]).mMaterial;
+ } else if (GregTech_API.METATILEENTITIES[aDamage] instanceof GT_MetaPipeEntity_Frame) {
+ aMaterial = ((GT_MetaPipeEntity_Frame) GregTech_API.METATILEENTITIES[aDamage]).mMaterial;
+ }
+ if (aMaterial != null) {
+ aName = aMaterial.getLocalizedNameForItem(aName);
+ }
+ }
+ return aName;
+ }
+
public void onCreated(ItemStack aStack, World aWorld, EntityPlayer aPlayer) {
super.onCreated(aStack, aWorld, aPlayer);
short tDamage = (short) getDamage(aStack);
diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java index 399c5d6bdd..10d71bfcc9 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Ores.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Ores.java @@ -1,6 +1,7 @@ package gregtech.common.blocks;
import gregtech.api.GregTech_API;
+import gregtech.api.enums.Materials;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
@@ -24,6 +25,14 @@ public class GT_Item_Ores return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack);
}
+ public String getItemStackDisplayName(ItemStack aStack) {
+ String aName = super.getItemStackDisplayName(aStack);
+ if (this.field_150939_a instanceof GT_Block_Ores_Abstract) {
+ aName = Materials.getLocalizedNameForItem(aName, aStack.getItemDamage() % 1000);
+ }
+ return aName;
+ }
+
public boolean placeBlockAt(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int side, float hitX, float hitY, float hitZ, int aMeta) {
short tDamage = (short) getDamage(aStack);
if (tDamage > 0) {
diff --git a/src/main/java/gregtech/common/blocks/GT_Item_Storage.java b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java index 6dccff429a..84cbcba6f1 100644 --- a/src/main/java/gregtech/common/blocks/GT_Item_Storage.java +++ b/src/main/java/gregtech/common/blocks/GT_Item_Storage.java @@ -1,30 +1,41 @@ -package gregtech.common.blocks; - -import gregtech.api.GregTech_API; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -import java.util.List; - -public class GT_Item_Storage extends ItemBlock { - public GT_Item_Storage(Block par1) { - super(par1); - setMaxDamage(0); - setHasSubtypes(true); - setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS); - } - - public String getUnlocalizedName(ItemStack aStack) { - return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack); - } - - public int getMetadata(int aMeta) { - return aMeta; - } - - public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { - super.addInformation(aStack, aPlayer, aList, aF3_H); - } +package gregtech.common.blocks;
+
+import gregtech.api.GregTech_API;
+import net.minecraft.block.Block;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+
+import java.util.List;
+
+public class GT_Item_Storage extends ItemBlock {
+ public GT_Item_Storage(Block par1) {
+ super(par1);
+ setMaxDamage(0);
+ setHasSubtypes(true);
+ setCreativeTab(GregTech_API.TAB_GREGTECH_MATERIALS);
+ }
+
+ public String getUnlocalizedName(ItemStack aStack) {
+ return this.field_150939_a.getUnlocalizedName() + "." + getDamage(aStack);
+ }
+
+ public String getItemStackDisplayName(ItemStack aStack) {
+ String aName = super.getItemStackDisplayName(aStack);
+ if (this.field_150939_a instanceof GT_Block_Metal) {
+ int aDamage = aStack.getItemDamage();
+ if (aDamage >= 0 && aDamage < ((GT_Block_Metal) this.field_150939_a).mMats.length) {
+ aName = ((GT_Block_Metal) this.field_150939_a).mMats[aDamage].getLocalizedNameForItem(aName);
+ }
+ }
+ return aName;
+ }
+
+ public int getMetadata(int aMeta) {
+ return aMeta;
+ }
+
+ public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) {
+ super.addInformation(aStack, aPlayer, aList, aF3_H);
+ }
}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java b/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java index 2ccabd8dc6..f381ffc9d7 100644 --- a/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java +++ b/src/main/java/gregtech/common/items/GT_FluidDisplayItem.java @@ -1,92 +1,92 @@ -package gregtech.common.items; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.items.GT_Generic_Item; -import gregtech.api.util.GT_Utility; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; - -import java.util.List; - -public class GT_FluidDisplayItem - extends GT_Generic_Item { - public GT_FluidDisplayItem() { - super("GregTech_FluidDisplay", "Fluid Display", null); - ItemList.Display_Fluid.set(this); - } - - protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { - NBTTagCompound aNBT = aStack.getTagCompound(); - if (GT_Values.D1) { - Fluid tFluid = FluidRegistry.getFluid(aStack.getItemDamage()); - if (tFluid != null) { - aList.add("Registry: " + tFluid.getName()); - } - } - if (aNBT != null) { - long tToolTipAmount = aNBT.getLong("mFluidDisplayAmount"); - if (tToolTipAmount > 0L) { - aList.add(EnumChatFormatting.BLUE + "Amount: " + tToolTipAmount + EnumChatFormatting.GRAY); - } - aList.add(EnumChatFormatting.RED + "Temperature: " + aNBT.getLong("mFluidDisplayHeat") + " K" + EnumChatFormatting.GRAY); - aList.add(EnumChatFormatting.GREEN + "State: " + (aNBT.getBoolean("mFluidState") ? "Gas" : "Liquid") + EnumChatFormatting.GRAY); - } - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister aIconRegister) { - } - - public IIcon getIconFromDamage(int aMeta) { - Fluid tFluid = FluidRegistry.getFluid(aMeta); - return tFluid == null ? FluidRegistry.WATER.getStillIcon() : tFluid.getStillIcon(); - } - - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack aStack, int aRenderPass) { - Fluid tFluid = FluidRegistry.getFluid(aStack.getItemDamage()); - return tFluid == null ? 16777215 : tFluid.getColor(); - } - - public int getSpriteNumber() { - return 0; - } - - public String getUnlocalizedName(ItemStack aStack) { - if (aStack != null) { - return GT_Utility.getFluidName(FluidRegistry.getFluid(aStack.getItemDamage()), false); - } - return ""; - } - - public String getItemStackDisplayName(ItemStack aStack) { - if (aStack != null) { - return GT_Utility.getFluidName(FluidRegistry.getFluid(aStack.getItemDamage()), true); - } - return ""; - } - - @SideOnly(Side.CLIENT) - public void getSubItems(Item aItem, CreativeTabs aTab, List aList) { - if (GT_Values.D1) { - int i = 0; - for (int j = FluidRegistry.getMaxID(); i < j; i++) { - ItemStack tStack = GT_Utility.getFluidDisplayStack(FluidRegistry.getFluid(i)); - if (tStack != null) { - aList.add(tStack); - } - } - } - } -} +package gregtech.common.items;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.ItemList;
+import gregtech.api.items.GT_Generic_Item;
+import gregtech.api.util.GT_Utility;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidRegistry;
+
+import java.util.List;
+
+public class GT_FluidDisplayItem
+ extends GT_Generic_Item {
+ public GT_FluidDisplayItem() {
+ super("GregTech_FluidDisplay", "Fluid Display", null);
+ ItemList.Display_Fluid.set(this);
+ }
+
+ protected void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
+ NBTTagCompound aNBT = aStack.getTagCompound();
+ if (GT_Values.D1) {
+ Fluid tFluid = FluidRegistry.getFluid(aStack.getItemDamage());
+ if (tFluid != null) {
+ aList.add("Registry: " + tFluid.getName());
+ }
+ }
+ if (aNBT != null) {
+ long tToolTipAmount = aNBT.getLong("mFluidDisplayAmount");
+ if (tToolTipAmount > 0L) {
+ aList.add(EnumChatFormatting.BLUE + String.format(trans("016", "Amount: %s L"), "" + tToolTipAmount) + EnumChatFormatting.GRAY);
+ }
+ aList.add(EnumChatFormatting.RED + String.format(trans("017", "Temperature: %s K"), "" + aNBT.getLong("mFluidDisplayHeat")) + EnumChatFormatting.GRAY);
+ aList.add(EnumChatFormatting.GREEN + String.format(trans("018", "State: %s"), aNBT.getBoolean("mFluidState") ? "Gas" : "Liquid") + EnumChatFormatting.GRAY);
+ }
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void registerIcons(IIconRegister aIconRegister) {
+ }
+
+ public IIcon getIconFromDamage(int aMeta) {
+ Fluid tFluid = FluidRegistry.getFluid(aMeta);
+ return tFluid == null ? FluidRegistry.WATER.getStillIcon() : tFluid.getStillIcon();
+ }
+
+ @SideOnly(Side.CLIENT)
+ public int getColorFromItemStack(ItemStack aStack, int aRenderPass) {
+ Fluid tFluid = FluidRegistry.getFluid(aStack.getItemDamage());
+ return tFluid == null ? 16777215 : tFluid.getColor();
+ }
+
+ public int getSpriteNumber() {
+ return 0;
+ }
+
+ public String getUnlocalizedName(ItemStack aStack) {
+ if (aStack != null) {
+ return GT_Utility.getFluidName(FluidRegistry.getFluid(aStack.getItemDamage()), false);
+ }
+ return "";
+ }
+
+ public String getItemStackDisplayName(ItemStack aStack) {
+ if (aStack != null) {
+ return GT_Utility.getFluidName(FluidRegistry.getFluid(aStack.getItemDamage()), true);
+ }
+ return "";
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item aItem, CreativeTabs aTab, List aList) {
+ if (GT_Values.D1) {
+ int i = 0;
+ for (int j = FluidRegistry.getMaxID(); i < j; i++) {
+ ItemStack tStack = GT_Utility.getFluidDisplayStack(FluidRegistry.getFluid(i));
+ if (tStack != null) {
+ aList.add(tStack);
+ }
+ }
+ }
+ }
+}
diff --git a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java index 01a6b105f8..3f29054e9d 100644 --- a/src/main/java/gregtech/common/items/GT_SensorCard_Item.java +++ b/src/main/java/gregtech/common/items/GT_SensorCard_Item.java @@ -1,93 +1,93 @@ -package gregtech.common.items; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation; -import gregtech.api.items.GT_Generic_Item; -import gregtech.api.util.GT_LanguageManager; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import shedar.mods.ic2.nuclearcontrol.api.*; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.UUID; - -public class GT_SensorCard_Item - extends GT_Generic_Item - implements IRemoteSensor, IPanelDataSource { - private static final UUID CARD_TYPE = new UUID(0L, 41L); - - public GT_SensorCard_Item(String aUnlocalized, String aEnglish) { - super(aUnlocalized, aEnglish, "Insert into Display Panel"); - setMaxStackSize(1); - } - - public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) { - super.addAdditionalToolTips(aList, aStack, aPlayer); - if (aStack != null) { - NBTTagCompound tNBT = aStack.getTagCompound(); - if (tNBT == null) { - aList.add("Missing Coodinates!"); - } else { - aList.add("Device at:"); - aList.add(String.format("x: %d, y: %d, z: %d", new Object[]{Integer.valueOf(tNBT.getInteger("x")), Integer.valueOf(tNBT.getInteger("y")), Integer.valueOf(tNBT.getInteger("z"))})); - } - } - } - - @Override - public CardState update(TileEntity aPanel, ICardWrapper aCard, int aMaxRange) { - return update(aPanel.getWorldObj(), aCard, aMaxRange); - } - - @Override - public CardState update(World world, ICardWrapper aCard, int aMaxRange) { - ChunkCoordinates target = aCard.getTarget(); - - TileEntity tTileEntity = world.getTileEntity(target.posX, target.posY, target.posZ); - if (((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) { - String[] tInfoData = ((IGregTechDeviceInformation) tTileEntity).getInfoData(); - for (int i = 0; i < tInfoData.length; i++) { - aCard.setString("mString" + i, tInfoData[i]); - } - return CardState.OK; - } - return CardState.NO_TARGET; - } - - public List<PanelString> getStringData(int aSettings, ICardWrapper aCard, boolean aLabels) { - List<PanelString> rList = new LinkedList(); - for (int i = 0; i < 8; i++) { - if ((aSettings & 1 << i) != 0) { - PanelString line = new PanelString(); - line.textLeft = GT_LanguageManager.getTranslation(aCard.getString("mString" + i), "\\\\"); - rList.add(line); - } - } - return rList; - } - - public List<PanelSetting> getSettingsList() { - List<PanelSetting> rList = new ArrayList(30); - for (int i = 0; i < 8; i++) { - rList.add(new PanelSetting(String.valueOf((i + 1)), 1 << i, getCardType())); - } - return rList; - } - - public UUID getCardType() { - return CARD_TYPE; - } - - @SideOnly(Side.CLIENT) - public void getSubItems(Item var1, CreativeTabs aTab, List aList) { - } -} +package gregtech.common.items;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation;
+import gregtech.api.items.GT_Generic_Item;
+import gregtech.api.util.GT_LanguageManager;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ChunkCoordinates;
+import net.minecraft.world.World;
+import shedar.mods.ic2.nuclearcontrol.api.*;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.UUID;
+
+public class GT_SensorCard_Item
+ extends GT_Generic_Item
+ implements IRemoteSensor, IPanelDataSource {
+ private static final UUID CARD_TYPE = new UUID(0L, 41L);
+
+ public GT_SensorCard_Item(String aUnlocalized, String aEnglish) {
+ super(aUnlocalized, aEnglish, "Insert into Display Panel");
+ setMaxStackSize(1);
+ }
+
+ public void addAdditionalToolTips(List aList, ItemStack aStack, EntityPlayer aPlayer) {
+ super.addAdditionalToolTips(aList, aStack, aPlayer);
+ if (aStack != null) {
+ NBTTagCompound tNBT = aStack.getTagCompound();
+ if (tNBT == null) {
+ aList.add(trans("014", "Missing Coodinates!"));
+ } else {
+ aList.add(trans("015", "Device at:"));
+ aList.add(String.format("x: %d, y: %d, z: %d", new Object[]{Integer.valueOf(tNBT.getInteger("x")), Integer.valueOf(tNBT.getInteger("y")), Integer.valueOf(tNBT.getInteger("z"))}));
+ }
+ }
+ }
+
+ @Override
+ public CardState update(TileEntity aPanel, ICardWrapper aCard, int aMaxRange) {
+ return update(aPanel.getWorldObj(), aCard, aMaxRange);
+ }
+
+ @Override
+ public CardState update(World world, ICardWrapper aCard, int aMaxRange) {
+ ChunkCoordinates target = aCard.getTarget();
+
+ TileEntity tTileEntity = world.getTileEntity(target.posX, target.posY, target.posZ);
+ if (((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation) tTileEntity).isGivingInformation())) {
+ String[] tInfoData = ((IGregTechDeviceInformation) tTileEntity).getInfoData();
+ for (int i = 0; i < tInfoData.length; i++) {
+ aCard.setString("mString" + i, tInfoData[i]);
+ }
+ return CardState.OK;
+ }
+ return CardState.NO_TARGET;
+ }
+
+ public List<PanelString> getStringData(int aSettings, ICardWrapper aCard, boolean aLabels) {
+ List<PanelString> rList = new LinkedList();
+ for (int i = 0; i < 8; i++) {
+ if ((aSettings & 1 << i) != 0) {
+ PanelString line = new PanelString();
+ line.textLeft = GT_LanguageManager.getTranslation(aCard.getString("mString" + i), "\\\\");
+ rList.add(line);
+ }
+ }
+ return rList;
+ }
+
+ public List<PanelSetting> getSettingsList() {
+ List<PanelSetting> rList = new ArrayList(30);
+ for (int i = 0; i < 8; i++) {
+ rList.add(new PanelSetting(String.valueOf((i + 1)), 1 << i, getCardType()));
+ }
+ return rList;
+ }
+
+ public UUID getCardType() {
+ return CARD_TYPE;
+ }
+
+ @SideOnly(Side.CLIENT)
+ public void getSubItems(Item var1, CreativeTabs aTab, List aList) {
+ }
+}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java index 6eca1fc408..fa56059564 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_HPSteam.java @@ -138,7 +138,7 @@ public class GT_MetaTileEntity_LargeTurbine_HPSteam extends GT_MetaTileEntity_La public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { looseFit^=true; - GT_Utility.sendChatToPlayer(aPlayer, "Fitting: "+(looseFit?"Loose - More Flow":"Tight - More Efficiency")); + GT_Utility.sendChatToPlayer(aPlayer, looseFit ? trans("500", "Fitting: Loose - More Flow") : trans("501", "Fitting: Tight - More Efficiency")); } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java index b7dd997015..aca9becd9c 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Steam.java @@ -146,7 +146,7 @@ public class GT_MetaTileEntity_LargeTurbine_Steam extends GT_MetaTileEntity_Larg public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (aSide == getBaseMetaTileEntity().getFrontFacing()) { looseFit^=true; - GT_Utility.sendChatToPlayer(aPlayer, "Fitting: "+(looseFit?"Loose - More Flow":"Tight - More Efficiency")); + GT_Utility.sendChatToPlayer(aPlayer, looseFit ? trans("500", "Fitting: Loose - More Flow") : trans("501", "Fitting: Tight - More Efficiency")); } } |