Added item registry name tooltips in dev

This commit is contained in:
LemADEC 2017-04-21 23:07:25 +02:00
parent 98f7b59929
commit dcd78320f4

View file

@ -7,6 +7,7 @@ import cr0s.warpdrive.config.WarpDriveConfig;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.util.StatCollector;
import cpw.mods.fml.common.eventhandler.EventPriority;
@ -58,6 +59,16 @@ public class ClientHandler {
// no operation
}
Commons.addTooltip(event.toolTip, "Explosion resistance is " + block.getExplosionResistance(null));
} else {
try {
String uniqueName = Item.itemRegistry.getNameForObject(event.itemStack.getItem());
if (uniqueName != null) {
Commons.addTooltip(event.toolTip, "" + uniqueName + "");
}
} catch(Exception exception) {
// no operation
}
}
}
}