Skip to content

Commit

Permalink
Even though this isn't actually my issue, this will make the code mor…
Browse files Browse the repository at this point in the history
…e robust. Fixed #22
  • Loading branch information
dries007 committed Mar 23, 2017
1 parent f3996d2 commit d826c02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/net/doubledoordev/d3core/util/EventHandler.java
Expand Up @@ -137,7 +137,7 @@ private EventHandler() {}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void itemTooltipEventHandler(ItemTooltipEvent event)
{
if (event.isShowAdvancedItemTooltips())
if (event.isShowAdvancedItemTooltips() && !event.getItemStack().isEmpty())
{
if (enableStringID) event.getToolTip().add(TextFormatting.DARK_AQUA + event.getItemStack().getItem().getRegistryName().toString());
if (enableUnlocalizedName) event.getToolTip().add(TextFormatting.DARK_GREEN + event.getItemStack().getUnlocalizedName());
Expand Down Expand Up @@ -197,7 +197,7 @@ public void playerDeath(LivingDeathEvent event)
{

}
((EntityPlayer) event.getEntityLiving()).sendMessage(new TextComponentString("You died at ").setStyle(new Style().setColor(TextFormatting.AQUA)).appendSibling(posText));
event.getEntityLiving().sendMessage(new TextComponentString("You died at ").setStyle(new Style().setColor(TextFormatting.AQUA)).appendSibling(posText));
}
}

Expand All @@ -215,7 +215,6 @@ public void aprilFools(ServerChatEvent event)
{
if (D3Core.isAprilFools())
{

Style style = event.getComponent().getStyle();
float chance = 0.25f;
if (CoreConstants.RANDOM.nextFloat() < chance)
Expand Down

0 comments on commit d826c02

Please sign in to comment.