Skip to content

Commit

Permalink
Add "Decorative only" tooltips to wooden pillars
Browse files Browse the repository at this point in the history
  • Loading branch information
ljfa-ag committed Aug 13, 2018
1 parent 44537c8 commit 5938b8a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/main/java/pokefenn/totemic/block/BlockDecoPillar.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package pokefenn.totemic.block;

import java.util.List;

import javax.annotation.Nullable;

import net.minecraft.block.BlockPlanks;
Expand All @@ -13,6 +15,8 @@
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
Expand Down Expand Up @@ -95,6 +99,12 @@ public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World wo
return new ItemStack(this, 1, tile.getDropMetadata());
}

@Override
public void addInformation(ItemStack stack, @Nullable World world, List<String> tooltip, ITooltipFlag flag)
{
tooltip.add(I18n.format("tile.totemic:wooden_pillar.tooltip"));
}

@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> items)
{
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/pokefenn/totemic/block/BlockDecoPillarBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import net.minecraft.block.state.BlockFaceShape;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
Expand Down Expand Up @@ -108,6 +110,12 @@ public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World wo
return new ItemStack(this, 1, tile.getDropMetadata());
}

@Override
public void addInformation(ItemStack stack, @Nullable World world, List<String> tooltip, ITooltipFlag flag)
{
tooltip.add(I18n.format("tile.totemic:wooden_pillar.tooltip"));
}

@Override
public void getSubBlocks(CreativeTabs tab, NonNullList<ItemStack> items)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void renderItem(IGuiLexiconEntry gui, int xPos, int yPos, ItemStack stack
if(accountForContainer)
{
ItemStack containerStack = stack.getItem().getContainerItem(stack);
if(!containerStack.isEmpty())
if(!containerStack.isEmpty() && !containerStack.isItemEqualIgnoreDurability(stack))
tooltipContainerStack = containerStack;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/totemic/lang/de_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ tile.totemic:wooden_pillar_base.stripped_jungle.name=Entrindete Tropenholzpfahlb
tile.totemic:wooden_pillar_base.stripped_acacia.name=Entrindete Akazienholzpfahlbasis
tile.totemic:wooden_pillar_base.stripped_dark_oak.name=Entrindete Schwarzeichenholzpfahlbasis
tile.totemic:wooden_pillar_base.stripped_cedar.name=Entrindete Zedernholzpfahlbasis
tile.totemic:wooden_pillar.tooltip=Nur dekorativ

#Entity localizations
entity.totemic:buffalo.name=Büffel
Expand Down Expand Up @@ -195,6 +196,7 @@ totemicmisc.clickToIndex=Umschalt+Klick zum Inhaltsverzeichnis
totemicmisc.clickToRecipe=Umschalt+Klick zum Rezept
totemicmisc.shapeless=Formlos
totemicmisc.oredict=Ore Dictionary
totemicmisc.craftingContainer=Gibt den Behälter zurück
totemic.gui.lexicon.recipeNotAvailable=(Handwerksrezept siehe Rezeptbuch)
totemic.gui.lexicon.wip=In Arbeit

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/totemic/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ tile.totemic:wooden_pillar_base.stripped_jungle.name=Stripped Jungle Wood Pillar
tile.totemic:wooden_pillar_base.stripped_acacia.name=Stripped Acacia Wood Pillar Base
tile.totemic:wooden_pillar_base.stripped_dark_oak.name=Stripped Dark Oak Wood Pillar Base
tile.totemic:wooden_pillar_base.stripped_cedar.name=Stripped Red Cedar Pillar Base
tile.totemic:wooden_pillar.tooltip=Decorative only

#Entity localizations
entity.totemic:buffalo.name=Buffalo
Expand Down Expand Up @@ -201,6 +202,7 @@ totemicmisc.clickToIndex=Shift+Click to return to index
totemicmisc.clickToRecipe=Shift+Click to see recipe
totemicmisc.shapeless=Shapeless
totemicmisc.oredict=Ore Dictionary
totemicmisc.craftingContainer=Returns the container
totemic.gui.lexicon.recipeNotAvailable=(Check recipe book for crafting recipe)
totemic.gui.lexicon.wip=Work In Progress

Expand Down

0 comments on commit 5938b8a

Please sign in to comment.