Guidebook

Guidebook

6M Downloads

1.10.2 Texturing issue

Asherslab opened this issue ยท 2 comments

commented

Hi so i'm using the following line of code for adding the book to an inventory:
chest.setInventorySlotContents(2, new ItemGuidebook("gbook:guidebook").of(GUIDE_BOOK));

But when it is put in the Inventory it has No Texture (Purple, black checkers instead). Whereas if i get it out of the Creative Tab, it shows the correct texture. Am i doing something wrong?
(no it's not the "front cover" of the texture thats the wrong texture, its the whole item),

commented

And it disappears every time a player exits the game.

commented

You should NEVER create new instances of the Item classes.

The correct way to get a book item in your code, is to use the ItemStackHolder annotation, like so:

@GameRegistry.ItemStackHolder(value = "gbook:guidebook", nbt = "{Book:\"modid:path/to/book.xml\"}")
public static ItemStack book;

This way if the mod is not present, the field will remain null, and you will know not to generate recipes for it.