Skip to content

Commit

Permalink
Fix lang keys
Browse files Browse the repository at this point in the history
  • Loading branch information
jaquadro committed Sep 8, 2019
1 parent 2c65883 commit 71172b7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraft.world.storage.loot.LootContext;
Expand Down Expand Up @@ -331,7 +332,7 @@ else if (StorageDrawers.config.cache.enableDrawerUI) {
{
@Override
public ITextComponent getDisplayName () {
return new StringTextComponent("Drawer UI");
return new TranslationTextComponent(getTranslationKey());
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.util.ActionResultType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
Expand Down Expand Up @@ -45,7 +46,7 @@ public boolean canPlayerBreakBlockWhileHolding(BlockState state, World worldIn,
@OnlyIn(Dist.CLIENT)
public void addInformation (ItemStack stack, @Nullable World worldIn, List<ITextComponent> tooltip, ITooltipFlag flagIn) {
super.addInformation(stack, worldIn, tooltip, flagIn);
tooltip.add(getDescription());
tooltip.add(getDescription().applyTextStyle(TextFormatting.GRAY));
}

@OnlyIn(Dist.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
Expand Down Expand Up @@ -42,7 +43,7 @@ public int getUpgradeGroup() {
@Override
@OnlyIn(Dist.CLIENT)
public void addInformation (@Nonnull ItemStack itemStack, @Nullable World world, List<ITextComponent> list, ITooltipFlag advanced) {
list.add(getDescription());
list.add(getDescription().applyTextStyle(TextFormatting.GRAY));
}

@OnlyIn(Dist.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ protected ItemUpgradeStorage (EnumUpgradeStorage level, Item.Properties properti
@OnlyIn(Dist.CLIENT)
protected ITextComponent getDescription() {
int mult = CommonConfig.UPGRADES.getLevelMult(level.getLevel());
return new TranslationTextComponent(this.getTranslationKey() + ".desc", mult);
return new TranslationTextComponent("item.storagedrawers.storage_upgrade.desc", mult);
}
}
12 changes: 12 additions & 0 deletions src/main/resources/assets/storagedrawers/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,29 @@

"container.storagedrawers.upgrades": "Upgrades",

"item.storagedrawers.storage_upgrade.desc": "Increases storage by %d times base value",
"item.storagedrawers.obsidian_storage_upgrade": "Storage Upgrade (I)",
"item.storagedrawers.iron_storage_upgrade": "Storage Upgrade (II)",
"item.storagedrawers.gold_storage_upgrade": "Storage Upgrade (III)",
"item.storagedrawers.diamond_storage_upgrade": "Storage Upgrade (IV)",
"item.storagedrawers.emerald_storage_upgrade": "Storage Upgrade (V)",
"item.storagedrawers.one_stack_upgrade": "Storage Downgrade",
"item.storagedrawers.one_stack_upgrade.desc": "Reduces base storage to a single stack",
"item.storagedrawers.void_upgrade": "Void Upgrade",
"item.storagedrawers.void_upgrade.desc": "Destroys excess items",
"item.storagedrawers.creative_storage_upgrade": "Creative Storage Upgrade",
"item.storagedrawers.creative_storage_upgrade.desc": "Near-infinite storage",
"item.storagedrawers.creative_vending_upgrade": "Creative Vending Upgrade",
"item.storagedrawers.creative_vending_upgrade.desc": "Unlimited item withdrawal",
"item.storagedrawers.conversion_upgrade": "Conversion Upgrade",
"item.storagedrawers.conversion_upgrade.desc": "Auto-converts compatible items",
"item.storagedrawers.redstone_upgrade": "Redstone Upgrade",
"item.storagedrawers.redstone_upgrade.desc": "Emits signal for total storage",
"item.storagedrawers.min_redstone_upgrade": "Min Redstone Upgrade",
"item.storagedrawers.min_redstone_upgrade.desc": "Emits signal for least full slot",
"item.storagedrawers.max_redstone_upgrade": "Max Redstone Upgrade",
"item.storagedrawers.max_redstone_upgrade.desc": "Emits signal for most full slot",
"item.storagedrawers.upgrade_template": "Upgrade Template",
"item.storagedrawers.drawer_key": "Drawer Key",
"item.storagedrawers.drawer_key.desc": "Locks and unlocks drawers\nHold in off-hand to lock newly-placed drawers",
"item.storagedrawers.shroud_key": "Concealment Key",
Expand Down

0 comments on commit 71172b7

Please sign in to comment.