mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-26 23:12:58 +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
@@ -1,7 +1,6 @@
|
||||
package binnie.extratrees.carpentry;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import forestry.api.core.Tabs;
|
||||
@@ -26,7 +25,7 @@ public class BlockCarpentry extends BlockDesign {
|
||||
|
||||
@Override
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return I18N.localise(ExtraTrees.instance, "block.woodentile.name", design.getDesign().getName());
|
||||
return I18N.localise("extratrees.block.woodentile.name", design.getDesign().getName());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package binnie.extratrees.carpentry;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
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 net.minecraft.block.Block;
|
||||
@@ -85,7 +84,7 @@ public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
@Override
|
||||
public String getBlockName(ItemStack stack) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
return I18N.localise(ExtraTrees.instance, "block.woodenpanel.name", block.getDesign().getName());
|
||||
return I18N.localise("extratrees.block.woodenpanel.name", block.getDesign().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,7 +6,6 @@ import binnie.core.block.IMultipassBlock;
|
||||
import binnie.core.block.MultipassBlockRenderer;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.api.CarpentryManager;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.api.IDesignSystem;
|
||||
@@ -135,7 +134,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
tooltip.add(I18N.localise(ExtraTrees.instance, "block.tooltip.twoColors", block.getPrimaryMaterial().getName(), block.getSecondaryMaterial().getName()));
|
||||
tooltip.add(I18N.localise("extratrees.block.tooltip.twoColors", block.getPrimaryMaterial().getName(), block.getSecondaryMaterial().getName()));
|
||||
} else {
|
||||
tooltip.add(block.getPrimaryMaterial().getName());
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package binnie.extratrees.carpentry;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -59,6 +58,6 @@ public class BlockStainedDesign extends BlockDesign {
|
||||
|
||||
@Override
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return I18N.localise(ExtraTrees.instance, "block.stainedglass.name", design.getDesign().getName());
|
||||
return I18N.localise("extratrees.block.stainedglass.name", design.getDesign().getName());
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.extratrees.carpentry;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import binnie.extratrees.api.IDesignSystem;
|
||||
@@ -137,7 +136,7 @@ public class DesignBlock {
|
||||
Label_1107:
|
||||
{
|
||||
switch (getFacing()) {
|
||||
case UP: {
|
||||
case UP:
|
||||
if (dir == ForgeDirection.DOWN || dir == ForgeDirection.UP) {
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
@@ -145,8 +144,8 @@ public class DesignBlock {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
|
||||
case DOWN:
|
||||
switch (dir) {
|
||||
case UP:
|
||||
case DOWN: {
|
||||
@@ -168,8 +167,8 @@ public class DesignBlock {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EAST: {
|
||||
|
||||
case EAST:
|
||||
switch (dir) {
|
||||
case SOUTH:
|
||||
case UP: {
|
||||
@@ -201,108 +200,102 @@ public class DesignBlock {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
|
||||
case WEST:
|
||||
switch (dir) {
|
||||
case NORTH: {
|
||||
case NORTH:
|
||||
layout = layout.rotateRight();
|
||||
break;
|
||||
}
|
||||
|
||||
case SOUTH:
|
||||
case UP: {
|
||||
case UP:
|
||||
layout = layout.rotateLeft();
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
|
||||
case DOWN:
|
||||
layout = layout.rotateLeft().flipVertical();
|
||||
break;
|
||||
}
|
||||
case EAST: {
|
||||
|
||||
case EAST:
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
|
||||
case WEST:
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NORTH: {
|
||||
|
||||
case NORTH:
|
||||
switch (dir) {
|
||||
case WEST: {
|
||||
case WEST:
|
||||
layout = layout.rotateLeft();
|
||||
break Label_1107;
|
||||
}
|
||||
case EAST: {
|
||||
|
||||
case EAST:
|
||||
layout = layout.rotateRight();
|
||||
break Label_1107;
|
||||
}
|
||||
case DOWN: {
|
||||
|
||||
case DOWN:
|
||||
layout = layout.flipHorizontal();
|
||||
break Label_1107;
|
||||
}
|
||||
case SOUTH: {
|
||||
|
||||
case SOUTH:
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break Label_1107;
|
||||
}
|
||||
case NORTH: {
|
||||
|
||||
case NORTH:
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break Label_1107;
|
||||
}
|
||||
default: {
|
||||
|
||||
default:
|
||||
break Label_1107;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
case SOUTH: {
|
||||
case SOUTH:
|
||||
switch (dir) {
|
||||
case EAST: {
|
||||
case EAST:
|
||||
layout = layout.rotateLeft();
|
||||
break Label_1107;
|
||||
}
|
||||
case WEST: {
|
||||
|
||||
case WEST:
|
||||
layout = layout.rotateRight();
|
||||
break Label_1107;
|
||||
}
|
||||
case UP: {
|
||||
|
||||
case UP:
|
||||
layout = layout.rotateRight().rotateRight();
|
||||
break Label_1107;
|
||||
}
|
||||
case DOWN: {
|
||||
|
||||
case DOWN:
|
||||
layout = layout.flipVertical();
|
||||
break Label_1107;
|
||||
}
|
||||
case NORTH: {
|
||||
|
||||
case NORTH:
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break Label_1107;
|
||||
}
|
||||
case SOUTH: {
|
||||
|
||||
case SOUTH:
|
||||
for (int j = 0; j < rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break Label_1107;
|
||||
}
|
||||
default: {
|
||||
break Label_1107;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
default:
|
||||
break Label_1107;
|
||||
}
|
||||
}
|
||||
}
|
||||
return layout;
|
||||
@@ -319,7 +312,9 @@ public class DesignBlock {
|
||||
}
|
||||
|
||||
public IIcon getIcon(IDesignSystem system, boolean secondary, ForgeDirection dir) {
|
||||
return secondary ? getSecondaryIcon(system, dir) : getPrimaryIcon(system, dir);
|
||||
return secondary
|
||||
? getSecondaryIcon(system, dir)
|
||||
: getPrimaryIcon(system, dir);
|
||||
}
|
||||
|
||||
public ForgeDirection getFacing() {
|
||||
@@ -364,8 +359,7 @@ public class DesignBlock {
|
||||
|
||||
if (rotation > 3) {
|
||||
rotation = 0;
|
||||
}
|
||||
if (rotation < 0) {
|
||||
} else if (rotation < 0) {
|
||||
rotation = 3;
|
||||
}
|
||||
}
|
||||
@@ -385,7 +379,7 @@ public class DesignBlock {
|
||||
public String getString() {
|
||||
String type;
|
||||
if (getPrimaryMaterial() != getSecondaryMaterial()) {
|
||||
type = I18N.localise(ExtraTrees.instance, "block.tooltip.twoMaterials", getPrimaryMaterial().getName(), getSecondaryMaterial().getName());
|
||||
type = I18N.localise("extratrees.block.tooltip.twoMaterials", getPrimaryMaterial().getName(), getSecondaryMaterial().getName());
|
||||
} else {
|
||||
type = getPrimaryMaterial().getName();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.extratrees.carpentry;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.api.ILayout;
|
||||
@@ -412,7 +411,7 @@ public enum EnumDesign implements IDesign {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise(Botany.instance, "design." + name);
|
||||
return I18N.localise("botany.design." + name);
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.extratrees.carpentry;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.api.CarpentryManager;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
@@ -28,7 +27,7 @@ public enum EnumDesignCategory implements IDesignCategory {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return I18N.localise(Botany.instance, "design.category." + name);
|
||||
return I18N.localise("botany.design.category." + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user