mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-25 14:34:33 +00:00
Improve ceramic localization
This commit is contained in:
1 parent
e0d23ada41
commit
6df4570bca
10 files changed
+128
-119
No files matched your search
@@ -5,6 +5,7 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.carpentry.BlockDesign;
|
||||
import binnie.extratrees.carpentry.DesignBlock;
|
||||
@@ -26,6 +27,6 @@ public class BlockCeramicPatterned extends BlockDesign {
|
||||
|
||||
@Override
|
||||
public String getBlockName(final DesignBlock design) {
|
||||
return design.getDesign().getName() + " Ceramic Block";
|
||||
return I18N.localise("botany.ceramic.block.name", design.getDesign().getName());
|
||||
}
|
||||
}
|
||||
@@ -137,14 +137,14 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
|
||||
|
||||
@Override
|
||||
public String getDisplayName(final ItemStack itemStack) {
|
||||
final int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return EnumFlowerColor.get(meta).getFlowerColorAllele().getColorName() + " " + I18N.localise("tile.botany.pigmented.glass.name");
|
||||
EnumFlowerColor color = EnumFlowerColor.get(TileEntityMetadata.getItemDamage(itemStack));
|
||||
return I18N.localise("botany.pigmented.glass.name", color.getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item itemIn, final CreativeTabs tab, final NonNullList<ItemStack> itemList) {
|
||||
for (final EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
|
||||
for (EnumFlowerColor color : EnumFlowerColor.values()) {
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, color.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,6 +178,7 @@ public class BlockStainedGlass extends Block implements IBlockMetadata, IColored
|
||||
if (worldIn == null || pos == null) {
|
||||
return 0;
|
||||
}
|
||||
return EnumFlowerColor.get(TileEntityMetadata.getTileMetadata(worldIn, pos)).getFlowerColorAllele().getColor(false);
|
||||
EnumFlowerColor color = EnumFlowerColor.get(TileEntityMetadata.getTileMetadata(worldIn, pos));
|
||||
return color.getFlowerColorAllele().getColor(false);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package binnie.botany.ceramic;
|
||||
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -10,6 +9,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import forestry.core.items.IColoredItem;
|
||||
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public class ItemCeramic extends ItemBlock implements IColoredItem {
|
||||
public ItemCeramic(BlockCeramic block) {
|
||||
@@ -24,12 +24,14 @@ public class ItemCeramic extends ItemBlock implements IColoredItem {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getColorFromItemstack(ItemStack stack, int tintIndex) {
|
||||
return EnumFlowerColor.get(stack.getMetadata()).getFlowerColorAllele().getColor(false);
|
||||
EnumFlowerColor color = EnumFlowerColor.get(stack.getItemDamage());
|
||||
return color.getFlowerColorAllele().getColor(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getItemStackDisplayName(ItemStack itemStack) {
|
||||
return EnumFlowerColor.get(itemStack.getItemDamage()).getFlowerColorAllele().getColorName() + " " + I18n.translateToLocal("tile.botany.ceramic.name").trim();
|
||||
EnumFlowerColor color = EnumFlowerColor.get(itemStack.getItemDamage());
|
||||
return I18N.localise("botany.ceramic.name", color.getDisplayName());
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ public class ItemStainedGlass extends ItemMetadata implements IColoredItem {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getColorFromItemstack(ItemStack stack, int tintIndex) {
|
||||
return EnumFlowerColor.get(TileEntityMetadata.getItemDamage(stack)).getFlowerColorAllele().getColor(false);
|
||||
EnumFlowerColor color = EnumFlowerColor.get(TileEntityMetadata.getItemDamage(stack));
|
||||
return color.getFlowerColorAllele().getColor(false);
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public class CeramicBrickPair {
|
||||
EnumFlowerColor colorFirst;
|
||||
@@ -48,7 +49,7 @@ public class CeramicBrickPair {
|
||||
if (this.type.canDouble() && this.colorSecond != this.colorFirst) {
|
||||
name = name + " & " + this.colorSecond.getFlowerColorAllele().getColorName();
|
||||
}
|
||||
return name + " " + this.type.name;
|
||||
return I18N.localise("botany.ceramic.type." + type.id + ".name", name);
|
||||
}
|
||||
|
||||
public int ordinal() {
|
||||
|
||||
@@ -18,7 +18,7 @@ import binnie.botany.items.BotanyItems;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
|
||||
public enum CeramicBrickType implements IStringSerializable {
|
||||
Tile("tile", "Ceramic Tile") {
|
||||
Tile("tile") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() != 4) {
|
||||
@@ -52,19 +52,19 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
return new CeramicBrickPair(c, c, CeramicBrickType.Tile).getStack(3);
|
||||
}
|
||||
},
|
||||
Brick("brick", "Ceramic Bricks") {
|
||||
Brick("brick") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
return getBrickRecipe(this, stacks);
|
||||
}
|
||||
},
|
||||
StripeBrick("brickstripe", "Striped Ceramic Bricks") {
|
||||
StripeBrick("brickstripe") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
return getBrickRecipe(this, stacks);
|
||||
}
|
||||
},
|
||||
LargeBrick("bricklarge", "Large Ceramic Bricks") {
|
||||
LargeBrick("bricklarge") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() == 1) {
|
||||
@@ -113,7 +113,7 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
}
|
||||
}
|
||||
},
|
||||
Split("split", "Split Ceramic Tile") {
|
||||
Split("split") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() != 4) {
|
||||
@@ -141,7 +141,7 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
return new CeramicBrickPair(EnumFlowerColor.get(colors[0]), EnumFlowerColor.get(colors[1]), CeramicBrickType.Split).getStack(4);
|
||||
}
|
||||
},
|
||||
Chequered("cheque", "Chequered Ceramic Tile") {
|
||||
Chequered("cheque") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() != 4) {
|
||||
@@ -170,7 +170,7 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
return new CeramicBrickPair(EnumFlowerColor.get(colors[0]), EnumFlowerColor.get(colors[1]), CeramicBrickType.Chequered).getStack(4);
|
||||
}
|
||||
},
|
||||
Mixed("mixed", "Mixed Ceramic Tile") {
|
||||
Mixed("mixed") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() != 4) {
|
||||
@@ -209,19 +209,19 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
return new CeramicBrickPair(EnumFlowerColor.get(colors[0]), EnumFlowerColor.get(colors[1]), CeramicBrickType.Mixed).getStack(4);
|
||||
}
|
||||
},
|
||||
VerticalBrick("verticalbrick", "Vertical Ceramic Bricks") {
|
||||
VerticalBrick("verticalbrick") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
return getVerticalBrickRecipe(stacks);
|
||||
}
|
||||
},
|
||||
VerticalStripeBrick("verticalbrickstripe", "Vertical Striped Ceramic Bricks") {
|
||||
VerticalStripeBrick("verticalbrickstripe") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
return getVerticalBrickRecipe(stacks);
|
||||
}
|
||||
},
|
||||
VerticalLargeBrick("verticalbricklarge", "Large Vertical Ceramic Bricks") {
|
||||
VerticalLargeBrick("verticalbricklarge") {
|
||||
@Override
|
||||
public ItemStack getRecipe(List<ItemStack> stacks) {
|
||||
return getVerticalBrickRecipe(stacks);
|
||||
@@ -231,15 +231,13 @@ public enum CeramicBrickType implements IStringSerializable {
|
||||
public static final CeramicBrickType[] VALUES = values();
|
||||
|
||||
String id;
|
||||
String name;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Nullable
|
||||
TextureAtlasSprite[] sprites;
|
||||
|
||||
CeramicBrickType(final String id, final String name) {
|
||||
CeramicBrickType(String id) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public static CeramicBrickType get(final int id) {
|
||||
|
||||
@@ -27,15 +27,6 @@ public class TileCeramicBrick extends TileEntity {
|
||||
return s;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
CeramicBrickType type = CeramicBrickType.VALUES[getBlockMetadata()];
|
||||
String name = this.colorFirst.getFlowerColorAllele().getColorName();
|
||||
if (type.canDouble() && this.colorSecond != this.colorFirst) {
|
||||
name = name + " & " + this.colorSecond.getFlowerColorAllele().getColorName();
|
||||
}
|
||||
return name + " " + type.name;
|
||||
}
|
||||
|
||||
public int ordinal() {
|
||||
return this.colorFirst.ordinal() + this.colorSecond.ordinal() * 256 + getBlockMetadata() * 256 * 256;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.util.IStringSerializable;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
public enum EnumFlowerColor implements IStringSerializable {
|
||||
Aquamarine("aquamarine", 8388564),
|
||||
@@ -2940,6 +2941,10 @@ public enum EnumFlowerColor implements IStringSerializable {
|
||||
return values()[Math.max(0, i) % values().length];
|
||||
}
|
||||
|
||||
public String getDisplayName(){
|
||||
return I18N.localise("botany.color." + getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase();
|
||||
|
||||
@@ -5,9 +5,6 @@ import forestry.api.genetics.IAlleleInteger;
|
||||
import binnie.botany.api.IFlowerColour;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
/**
|
||||
* Created by Marcin on 03.06.2017.
|
||||
*/
|
||||
public class FlowerColorAllele implements IFlowerColour, IAlleleInteger {
|
||||
private int color;
|
||||
private String uid;
|
||||
|
||||
@@ -22,6 +22,21 @@ botany.plant.weeds_very_long=Weed Very Long
|
||||
botany.plant.dead_flower=Dead Flower
|
||||
botany.plant.decaying_flower=Decaying Flower
|
||||
|
||||
botany.ceramic.name=%s Ceramic Block
|
||||
botany.ceramic.block.name=%s Ceramic Block
|
||||
botany.pigmented.glass.name=%s Pigmented Glass
|
||||
|
||||
botany.ceramic.type.tile.name=%s Ceramic Tile
|
||||
botany.ceramic.type.brick.name=%s Ceramic Bricks
|
||||
botany.ceramic.type.brickstripe.name=%s Striped Ceramic Bricks
|
||||
botany.ceramic.type.bricklarge.name=%s Large Ceramic Bricks
|
||||
botany.ceramic.type.split.name=%s Split Ceramic Tile
|
||||
botany.ceramic.type.cheque.name=%s Chequered Ceramic Tile
|
||||
botany.ceramic.type.mixed.name=%s Mixed Ceramic Tile
|
||||
botany.ceramic.type.verticalbrick.name=%s Vertical Ceramic Bricks
|
||||
botany.ceramic.type.verticalbrickstripe.name=%s Vertical Striped Ceramic Bricks
|
||||
botany.ceramic.type.verticalbricklarge.name=%s Large Vertical Ceramic Bricks
|
||||
|
||||
item.botany.germling.name=Germling
|
||||
item.botany.pollen.name=Pollen
|
||||
item.botany.flower.corrupted.name=Corrupted Flower
|
||||
@@ -58,92 +73,89 @@ item.botany.flower.destroy=This item is bugged. Destroy it!
|
||||
item.botany.grammar.flower=%PRIMARY, %STEM Stem
|
||||
item.botany.grammar.flower.secondary=%PRIMARY and %SECONDARY, %STEM Stem
|
||||
|
||||
tile.botany.ceramic.name=Ceramic Block
|
||||
tile.botany.pigmented.glass.name=Pigmented Glass
|
||||
|
||||
item.botany.botanist_bag.name=Botanist's Backpack
|
||||
botany.jei.description.botanist_bag=Extra inventory that automatically picks up flowers.
|
||||
|
||||
botany.colour.aquamarine=Aquamarine
|
||||
botany.colour.black=Black
|
||||
botany.colour.blue=Deep Blue
|
||||
botany.colour.brown=Red-Brown
|
||||
botany.colour.cadetblue=Dull Blue
|
||||
botany.colour.chocolate=Light Brown
|
||||
botany.colour.coral=Coral
|
||||
botany.colour.crimson=Crimson
|
||||
botany.colour.cyan=Cyan
|
||||
botany.colour.darkgoldenrod=Dark Bronze
|
||||
botany.colour.darkgray=Gray
|
||||
botany.colour.darkgreen=Dark Green
|
||||
botany.colour.darkkhaki=Dark Beige
|
||||
botany.colour.darkolivegreen=Dark Olive
|
||||
botany.colour.darkorange=Red-Orange
|
||||
botany.colour.darksalmon=Dark Salmon
|
||||
botany.colour.darkseagreen=Dull Green
|
||||
botany.colour.darkslateblue=Dark Slate
|
||||
botany.colour.darkslategray=Dark Teal
|
||||
botany.colour.darkturquoise=Turquoise
|
||||
botany.colour.darkviolet=Purple
|
||||
botany.colour.deeppink=Deep Pink
|
||||
botany.colour.deepskyblue=Light Blue
|
||||
botany.colour.dimgray=Dark Gray
|
||||
botany.colour.dodgerblue=Blue
|
||||
botany.colour.gold=Gold
|
||||
botany.colour.goldenrod=Bronze
|
||||
botany.colour.gray=Dim Gray
|
||||
botany.colour.green=Green
|
||||
botany.colour.hotpink=Pink
|
||||
botany.colour.indianred=Brick Red
|
||||
botany.colour.indigo=Indigo
|
||||
botany.colour.khaki=Beige
|
||||
botany.colour.lavender=Alice Blue
|
||||
botany.colour.lemonchiffon=Pale Yellow
|
||||
botany.colour.lightgray=Light Gray
|
||||
botany.colour.lightseagreen=Dark Turquoise
|
||||
botany.colour.lightsteelblue=Pale Blue
|
||||
botany.colour.lime=Lime
|
||||
botany.colour.limegreen=Light Green
|
||||
botany.colour.magenta=Magenta
|
||||
botany.colour.maroon=Maroon
|
||||
botany.colour.mediumaquamarine=Light Mint
|
||||
botany.colour.mediumorchid=Light Purple
|
||||
botany.colour.mediumpurple=Light Slate
|
||||
botany.colour.mediumseagreen=Mint
|
||||
botany.colour.mediumvioletred=Purple-Red
|
||||
botany.colour.mistyrose=Pale Rose
|
||||
botany.colour.navy=Navy
|
||||
botany.colour.olive=Dark Yellow
|
||||
botany.colour.olivedrab=Olive
|
||||
botany.colour.orange=Orange
|
||||
botany.colour.palegreen=Pale Green
|
||||
botany.colour.paleturquoise=Pale Turquoise
|
||||
botany.colour.palevioletred=Dull Pink
|
||||
botany.colour.peru=Tan
|
||||
botany.colour.pink=Pale Pink
|
||||
botany.colour.plum=Light Mauve
|
||||
botany.colour.purple=Dark Purple
|
||||
botany.colour.red=Red
|
||||
botany.colour.rosybrown=Dull Red
|
||||
botany.colour.royalblue=Royal Blue
|
||||
botany.colour.salmon=Salmon
|
||||
botany.colour.sandybrown=Pale Brown
|
||||
botany.colour.seagreen=Dark Mint
|
||||
botany.colour.sienna=Brown
|
||||
botany.colour.skyblue=Sky Blue
|
||||
botany.colour.slateblue=Slate Blue
|
||||
botany.colour.slategray=Slate
|
||||
botany.colour.springgreen=Spring Green
|
||||
botany.colour.steelblue=Steel Blue
|
||||
botany.colour.tan=Pale Tan
|
||||
botany.colour.teal=Teal
|
||||
botany.colour.thistle=Pale Purple
|
||||
botany.colour.turquoise=Light Turquoise
|
||||
botany.colour.violet=Mauve
|
||||
botany.colour.wheat=Pale Orange
|
||||
botany.colour.white=White
|
||||
botany.colour.yellow=Yellow
|
||||
botany.colour.yellowgreen=Yellow-Green
|
||||
botany.color.aquamarine=Aquamarine
|
||||
botany.color.black=Black
|
||||
botany.color.blue=Deep Blue
|
||||
botany.color.brown=Red-Brown
|
||||
botany.color.cadetblue=Dull Blue
|
||||
botany.color.chocolate=Light Brown
|
||||
botany.color.coral=Coral
|
||||
botany.color.crimson=Crimson
|
||||
botany.color.cyan=Cyan
|
||||
botany.color.darkgoldenrod=Dark Bronze
|
||||
botany.color.darkgray=Gray
|
||||
botany.color.darkgreen=Dark Green
|
||||
botany.color.darkkhaki=Dark Beige
|
||||
botany.color.darkolivegreen=Dark Olive
|
||||
botany.color.darkorange=Red-Orange
|
||||
botany.color.darksalmon=Dark Salmon
|
||||
botany.color.darkseagreen=Dull Green
|
||||
botany.color.darkslateblue=Dark Slate
|
||||
botany.color.darkslategray=Dark Teal
|
||||
botany.color.darkturquoise=Turquoise
|
||||
botany.color.darkviolet=Purple
|
||||
botany.color.deeppink=Deep Pink
|
||||
botany.color.deepskyblue=Light Blue
|
||||
botany.color.dimgray=Dark Gray
|
||||
botany.color.dodgerblue=Blue
|
||||
botany.color.gold=Gold
|
||||
botany.color.goldenrod=Bronze
|
||||
botany.color.gray=Dim Gray
|
||||
botany.color.green=Green
|
||||
botany.color.hotpink=Pink
|
||||
botany.color.indianred=Brick Red
|
||||
botany.color.indigo=Indigo
|
||||
botany.color.khaki=Beige
|
||||
botany.color.lavender=Alice Blue
|
||||
botany.color.lemonchiffon=Pale Yellow
|
||||
botany.color.lightgray=Light Gray
|
||||
botany.color.lightseagreen=Dark Turquoise
|
||||
botany.color.lightsteelblue=Pale Blue
|
||||
botany.color.lime=Lime
|
||||
botany.color.limegreen=Light Green
|
||||
botany.color.magenta=Magenta
|
||||
botany.color.maroon=Maroon
|
||||
botany.color.mediumaquamarine=Light Mint
|
||||
botany.color.mediumorchid=Light Purple
|
||||
botany.color.mediumpurple=Light Slate
|
||||
botany.color.mediumseagreen=Mint
|
||||
botany.color.mediumvioletred=Purple-Red
|
||||
botany.color.mistyrose=Pale Rose
|
||||
botany.color.navy=Navy
|
||||
botany.color.olive=Dark Yellow
|
||||
botany.color.olivedrab=Olive
|
||||
botany.color.orange=Orange
|
||||
botany.color.palegreen=Pale Green
|
||||
botany.color.paleturquoise=Pale Turquoise
|
||||
botany.color.palevioletred=Dull Pink
|
||||
botany.color.peru=Tan
|
||||
botany.color.pink=Pale Pink
|
||||
botany.color.plum=Light Mauve
|
||||
botany.color.purple=Dark Purple
|
||||
botany.color.red=Red
|
||||
botany.color.rosybrown=Dull Red
|
||||
botany.color.royalblue=Royal Blue
|
||||
botany.color.salmon=Salmon
|
||||
botany.color.sandybrown=Pale Brown
|
||||
botany.color.seagreen=Dark Mint
|
||||
botany.color.sienna=Brown
|
||||
botany.color.skyblue=Sky Blue
|
||||
botany.color.slateblue=Slate Blue
|
||||
botany.color.slategray=Slate
|
||||
botany.color.springgreen=Spring Green
|
||||
botany.color.steelblue=Steel Blue
|
||||
botany.color.tan=Pale Tan
|
||||
botany.color.teal=Teal
|
||||
botany.color.thistle=Pale Purple
|
||||
botany.color.turquoise=Light Turquoise
|
||||
botany.color.violet=Mauve
|
||||
botany.color.wheat=Pale Orange
|
||||
botany.color.white=White
|
||||
botany.color.yellow=Yellow
|
||||
botany.color.yellowgreen=Yellow-Green
|
||||
|
||||
for.binnie.circuit.garden.fertilized=Fertilized
|
||||
for.binnie.circuit.garden.unfertilized=Unfertilized
|
||||
|
||||
Reference in new issue
Block a user