mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 04:32:24 +00:00
* Added missing ru_RU localization * Fixed first letter * Rename Binnie.Language to short Binnie.I18N Removed some unused methods, classes. Removed some hardcod strings, replaced it on i18n Moved pigment colors of blocks and items to tooltips * #30 Fix some bugged localizations * #30 Added localization for PageSpeciesFlowerGenome * #30 Fixed some format in lang * #30 Added localization for ItemBotany and ItemPollen * Added localization for ItemGermling
This commit is contained in:
1 parent
7fe97e9323
commit
5e4d271f37
13 files changed
+128
-58
No files matched your search
@@ -68,13 +68,13 @@ public abstract class ItemBotany extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) {
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List tooltip, boolean flag) {
|
||||
if (!itemstack.hasTagCompound()) {
|
||||
return;
|
||||
}
|
||||
IFlower individual = (IFlower) getIndividual(itemstack);
|
||||
if (individual == null) {
|
||||
list.add("This item is bugged. Destroy it!");
|
||||
tooltip.add(Binnie.I18N.localise(Botany.instance, "item.tooltip.bugged"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -82,17 +82,16 @@ public abstract class ItemBotany extends Item {
|
||||
IFlowerColor primaryColor = genome.getPrimaryColor();
|
||||
IFlowerColor secondColor = genome.getSecondaryColor();
|
||||
IFlowerColor stemColor = genome.getStemColor();
|
||||
list.add(EnumChatFormatting.YELLOW + primaryColor.getName() + ((primaryColor == secondColor) ? "" : (" and " + secondColor.getName())) + ", " + stemColor.getName() + " Stem");
|
||||
tooltip.add(EnumChatFormatting.YELLOW + primaryColor.getName() + ((primaryColor == secondColor) ? "" : (" and " + secondColor.getName())) + ", " + stemColor.getName() + " Stem");
|
||||
|
||||
if (individual.isAnalyzed()) {
|
||||
if (BinnieCore.proxy.isShiftDown()) {
|
||||
individual.addTooltip(list);
|
||||
individual.addTooltip(tooltip);
|
||||
} else {
|
||||
// TODO remove hardcode strings and localize
|
||||
list.add(EnumChatFormatting.GRAY + "<Hold shift for details>");
|
||||
tooltip.add(EnumChatFormatting.GRAY + Binnie.I18N.localise(Botany.instance, "item.tooltip.holdMore"));
|
||||
}
|
||||
} else {
|
||||
list.add("<Unknown>");
|
||||
tooltip.add(Binnie.I18N.localise(Botany.instance, "item.tooltip.unknownGenome"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,12 +115,18 @@ public abstract class ItemBotany extends Item {
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
if (!itemstack.hasTagCompound()) {
|
||||
return "Unknown";
|
||||
return Binnie.I18N.localise(Botany.instance, "item.tooltip.unknown");
|
||||
}
|
||||
|
||||
IIndividual individual = getIndividual(itemstack);
|
||||
return (individual != null && individual.getGenome() != null) ?
|
||||
(individual.getDisplayName() + getTag()) :
|
||||
"Corrupted Flower";
|
||||
if (individual != null && individual.getGenome() != null) {
|
||||
String tag = getTag();
|
||||
if (tag == null || tag.isEmpty()) {
|
||||
return individual.getDisplayName();
|
||||
}
|
||||
return Binnie.I18N.localise(Botany.instance, "item.botany.name", individual.getDisplayName(), tag);
|
||||
}
|
||||
return Binnie.I18N.localise(Botany.instance, "item.flowerCorrupted.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -195,7 +200,7 @@ public abstract class ItemBotany extends Item {
|
||||
}
|
||||
pollinatable.mateWith(flower);
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
--itemstack.stackSize;
|
||||
itemstack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -264,14 +269,14 @@ public abstract class ItemBotany extends Item {
|
||||
}
|
||||
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
|
||||
Block field_150939_a = Botany.flower;
|
||||
if (!world.setBlock(x, y, z, field_150939_a, metadata, 3)) {
|
||||
Block block = Botany.flower;
|
||||
if (!world.setBlock(x, y, z, block, metadata, 3)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (world.getBlock(x, y, z) == field_150939_a) {
|
||||
field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
field_150939_a.onPostBlockPlaced(world, x, y, z, metadata);
|
||||
if (world.getBlock(x, y, z) == block) {
|
||||
block.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
block.onPostBlockPlaced(world, x, y, z, metadata);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user