Fixed block information tooltips on pure items
This commit is contained in:
parent
6ddda39d9e
commit
40c69679a9
1 changed files with 18 additions and 15 deletions
|
@ -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 {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue