Fixed block information tooltips on pure items

This commit is contained in:
LemADEC 2016-01-13 01:08:52 +01:00
parent 6ddda39d9e
commit 40c69679a9

View file

@ -1,6 +1,7 @@
package cr0s.warpdrive.event;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
@ -19,6 +20,7 @@ public class ClientHandler {
}
if (WarpDrive.isDev) {// disabled in production
Block block = Block.getBlockFromItem(event.itemStack.getItem());
if (block != Blocks.air) {
try {
String harvestTool = block.getHarvestTool(event.itemStack.getItemDamage());
if (harvestTool != null) {
@ -39,3 +41,4 @@ public class ClientHandler {
}
}
}
}