mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-26 15:03:14 +00:00
[1.7.10] Some refactoring (#102)
* Some refactoring * Some refactoring Added some localization * Added some localization Fix wrong branch localization in page branch overview Simplify some localization * Simplify some localization * Removed unused localize method * Simplify some localization * Removed proxy.localise method * Simplify localization
This commit is contained in:
1 parent
81301c3bd2
commit
1ffaad9fcd
232 files changed
+1947
-2054
No files matched your search
@@ -40,7 +40,7 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
if (type >= 0 && type < DoorType.values().length) {
|
||||
return DoorType.values()[type];
|
||||
}
|
||||
return DoorType.Standard;
|
||||
return DoorType.STANDARD;
|
||||
}
|
||||
|
||||
private IIcon getFlippedIcon(boolean upper, boolean flip, int tileMeta) {
|
||||
@@ -53,7 +53,7 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return DoorType.Standard.iconDoorLower;
|
||||
return DoorType.STANDARD.iconDoorLower;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,7 +89,7 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
}
|
||||
return getFlippedIcon(flag3, flag2, tileMeta);
|
||||
}
|
||||
return DoorType.Standard.iconDoorLower;
|
||||
return DoorType.STANDARD.iconDoorLower;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -193,9 +193,9 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
String typeName = getDoorType(meta).getName();
|
||||
String woodName = WoodManager.getPlankType(meta & 0xFF).getName();
|
||||
if (typeName.equals("")) {
|
||||
return I18N.localise(ExtraTrees.instance, "block.door.name", woodName);
|
||||
return I18N.localise("extratrees.block.door.name", woodName);
|
||||
}
|
||||
return I18N.localise(ExtraTrees.instance, "block.door.name.adv", woodName, typeName);
|
||||
return I18N.localise("extratrees.block.door.name.adv", woodName, typeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -211,18 +211,18 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List itemList) {
|
||||
for (IPlankType type : PlankType.ExtraTreePlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
for (IPlankType type : PlankType.ForestryPlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) {
|
||||
if (type.getStack() != null) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
}
|
||||
for (IPlankType type : PlankType.VanillaPlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.STANDARD));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
@@ -129,11 +128,12 @@ public class BlockETLog extends BlockLog implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise(ExtraTrees.instance, "block.log.name", ILogType.ExtraTreeLog.values()[meta].getName());
|
||||
return I18N.localise("extratrees.block.log.name", ILogType.ExtraTreeLog.values()[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -195,7 +195,7 @@ public class BlockETLog extends BlockLog implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
@@ -74,7 +73,7 @@ public class BlockETPlanks extends BlockWood implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise(ExtraTrees.instance, "block.plank.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
return I18N.localise("extratrees.block.plank.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -144,7 +143,7 @@ public class BlockETPlanks extends BlockWood implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,10 @@ public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata {
|
||||
public BlockETSlab(boolean isDouble) {
|
||||
super(isDouble);
|
||||
setCreativeTab(Tabs.tabArboriculture);
|
||||
setHardness(2.0f).setResistance(5.0f).setStepSound(Block.soundTypeWood);
|
||||
setHardness(2.0f);
|
||||
setResistance(5.0f);
|
||||
setStepSound(Block.soundTypeWood);
|
||||
|
||||
if (!field_150004_a) {
|
||||
useNeighborBrightness = true;
|
||||
}
|
||||
@@ -39,7 +42,7 @@ public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int blockMeta, int fortune) {
|
||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
drops.addAll(BlockMetadata.getBlockDropped((IBlockMetadata) ExtraTrees.blockSlab, world, x, y, z, blockMeta));
|
||||
if (field_150004_a) {
|
||||
drops.addAll(BlockMetadata.getBlockDropped((IBlockMetadata) ExtraTrees.blockSlab, world, x, y, z, blockMeta));
|
||||
@@ -48,7 +51,7 @@ public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@@ -82,11 +85,12 @@ public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise(ExtraTrees.instance, "block.woodslab.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
return I18N.localise("extratrees.block.woodslab.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -151,7 +155,7 @@ public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class BlockETStairs extends BlockStairs implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@@ -106,11 +106,12 @@ public class BlockETStairs extends BlockStairs implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise(ExtraTrees.instance, "block.woodstairs.name", WoodManager.getPlankType(meta + 32).getName());
|
||||
return I18N.localise("extratrees.block.woodstairs.name", WoodManager.getPlankType(meta + 32).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.world.IBlockAccess;
|
||||
public class BranchBlockRenderer implements ISimpleBlockRenderingHandler {
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.core.util.I18N;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public enum DoorType {
|
||||
Standard("standard"),
|
||||
Solid("solid"),
|
||||
Double("double"),
|
||||
Full("full");
|
||||
STANDARD("standard"),
|
||||
SOLID("solid"),
|
||||
DOUBLE("double"),
|
||||
FULL("full");
|
||||
|
||||
protected String id;
|
||||
protected IIcon iconDoorLower;
|
||||
@@ -16,11 +16,11 @@ public enum DoorType {
|
||||
protected IIcon iconDoorUpperFlip;
|
||||
protected IIcon iconItem;
|
||||
|
||||
DoorType(String iconName) {
|
||||
id = iconName;
|
||||
DoorType(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("block.door.type." + id);
|
||||
return I18N.localise("extratrees.block.door.type." + id);
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public interface ILogType {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return I18N.localise(ExtraTrees.instance, "block.planks." + name.toLowerCase(Locale.ENGLISH));
|
||||
return I18N.localise("extratrees.block.planks." + name.toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
|
||||
@@ -110,10 +110,10 @@ public class ModuleBlocks implements IInitializable {
|
||||
ItemStack planks2 = plank2.getStack();
|
||||
ItemStack fenceNormal = WoodManager.getFence(plank2, new FenceType(0), 1);
|
||||
ItemStack gate = WoodManager.getGate(plank2);
|
||||
ItemStack doorStandard = WoodManager.getDoor(plank2, DoorType.Standard);
|
||||
ItemStack doorSolid = WoodManager.getDoor(plank2, DoorType.Solid);
|
||||
ItemStack doorSplit = WoodManager.getDoor(plank2, DoorType.Double);
|
||||
ItemStack doorFull = WoodManager.getDoor(plank2, DoorType.Full);
|
||||
ItemStack doorStandard = WoodManager.getDoor(plank2, DoorType.STANDARD);
|
||||
ItemStack doorSolid = WoodManager.getDoor(plank2, DoorType.SOLID);
|
||||
ItemStack doorSplit = WoodManager.getDoor(plank2, DoorType.DOUBLE);
|
||||
ItemStack doorFull = WoodManager.getDoor(plank2, DoorType.FULL);
|
||||
if (planks2 != null) {
|
||||
if (gate == null) {
|
||||
continue;
|
||||
|
||||
@@ -2,6 +2,7 @@ package binnie.extratrees.block;
|
||||
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.api.CarpentryManager;
|
||||
import com.google.common.base.Optional;
|
||||
@@ -75,12 +76,12 @@ public class PlankType {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("block.planks." + toString().toLowerCase());
|
||||
return I18N.localise("extratrees.block.planks." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraTrees.proxy.localise("block.planks." + toString().toLowerCase() + ".desc");
|
||||
return I18N.localise("extratrees.block.planks." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -124,12 +125,12 @@ public class PlankType {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("block.planks.vanilla." + toString().toLowerCase());
|
||||
return I18N.localise("extratrees.block.planks.vanilla." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraTrees.proxy.localise("block.planks.vanilla." + toString().toLowerCase() + ".desc");
|
||||
return I18N.localise("extratrees.block.planks.vanilla." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -189,12 +190,12 @@ public class PlankType {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("block.planks.forestry." + toString().toLowerCase());
|
||||
return I18N.localise("extratrees.block.planks.forestry." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraTrees.proxy.localise("block.planks.forestry." + toString().toLowerCase() + ".desc");
|
||||
return I18N.localise("extratrees.block.planks.forestry." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -239,12 +240,12 @@ public class PlankType {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("block.planks.ebxl." + toString().toLowerCase());
|
||||
return I18N.localise("extratrees.block.planks.ebxl." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraTrees.proxy.localise("block.planks.ebxl." + toString().toLowerCase() + ".desc");
|
||||
return I18N.localise("extratrees.block.planks.ebxl." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -121,7 +121,7 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise(ExtraTrees.instance, "block.woodfence.name", getDescription(meta).getPlankType().getName());
|
||||
return I18N.localise("extratrees.block.woodfence.name", getDescription(meta).getPlankType().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,7 +4,6 @@ import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.IPlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -104,7 +103,7 @@ public class BlockGate extends BlockFenceGate implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return I18N.localise(ExtraTrees.instance, "block.woodgate.name", WoodManager.getPlankType(meta).getName());
|
||||
return I18N.localise("extratrees.block.woodgate.name", WoodManager.getPlankType(meta).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,7 +3,6 @@ package binnie.extratrees.block.decor;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.IPlankType;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import binnie.extratrees.block.WoodManager;
|
||||
@@ -40,6 +39,6 @@ public class BlockMultiFence extends BlockFence implements IBlockMetadata {
|
||||
IPlankType type2 = getDescription(meta).getSecondaryPlankType();
|
||||
boolean twoTypes = type1 != type2;
|
||||
FenceType type3 = getDescription(meta).getFenceType();
|
||||
return I18N.localise(ExtraTrees.instance, "block.woodslab.name" + (twoTypes ? "2" : ""), type3.getPrefix(), type1.getName(), type2.getName());
|
||||
return I18N.localise("extratrees.block.woodslab.name" + (twoTypes ? "2" : ""), type3.getPrefix(), type1.getName(), type2.getName());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user