Skip to content

Commit

Permalink
Added notes that player can be null for tooltips on items
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkGuardsman committed Mar 17, 2018
1 parent dcef1a0 commit 566cf1a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main/java/icbm/classic/prefab/item/ItemBlockAbstract.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard;

import javax.annotation.Nullable;
import java.util.List;

/**
Expand Down Expand Up @@ -92,8 +93,9 @@ protected boolean canPlace(EntityPlayer player, World worldIn, BlockPos pos, Ite

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List list, ITooltipFlag flag)
public void addInformation(ItemStack stack, @Nullable World world, List list, ITooltipFlag flag)
{
//Get player, don't run tool tips without
EntityPlayer player = Minecraft.getMinecraft().player;
try
{
Expand Down Expand Up @@ -137,7 +139,7 @@ public void addInformation(ItemStack stack, World world, List list, ITooltipFlag
* @param player
* @param list
*/
protected void getDetailedInfo(ItemStack stack, EntityPlayer player, List list)
protected void getDetailedInfo(ItemStack stack, @Nullable EntityPlayer player, List list)
{
//Per item detailed info
String translationKey = getUnlocalizedName(stack) + ".info";
Expand Down Expand Up @@ -169,7 +171,7 @@ protected void getDetailedInfo(ItemStack stack, EntityPlayer player, List list)
* @param player
* @param list
*/
protected void getShiftDetailedInfo(ItemStack stack, EntityPlayer player, List list)
protected void getShiftDetailedInfo(ItemStack stack, @Nullable EntityPlayer player, List list)
{
//Per item detailed info
String translationKey = getUnlocalizedName(stack) + ".info.detailed";
Expand Down Expand Up @@ -198,7 +200,7 @@ protected void getShiftDetailedInfo(ItemStack stack, EntityPlayer player, List l
* @param player
* @return
*/
protected boolean hasDetailedInfo(ItemStack stack, EntityPlayer player)
protected boolean hasDetailedInfo(ItemStack stack, @Nullable EntityPlayer player)
{
String translationKey = getUnlocalizedName() + ".info";
String translationKey2 = getUnlocalizedName(stack) + ".info";
Expand All @@ -213,7 +215,7 @@ protected boolean hasDetailedInfo(ItemStack stack, EntityPlayer player)
* @param player
* @return
*/
protected boolean hasShiftInfo(ItemStack stack, EntityPlayer player)
protected boolean hasShiftInfo(ItemStack stack, @Nullable EntityPlayer player)
{
return false;
}
Expand Down

0 comments on commit 566cf1a

Please sign in to comment.