Search in sources :

Example 6 with IAgriJournalItem

use of com.infinityraider.agricraft.api.v1.content.items.IAgriJournalItem in project AgriCraft by AgriCraft.

the class TileEntitySeedAnalyzer method addDebugInfo.

protected void addDebugInfo(Consumer<String> consumer) {
    ItemStack journalStack = this.getJournal();
    if (journalStack.isEmpty() || !(journalStack.getItem() instanceof IAgriJournalItem)) {
        consumer.accept("No journal present");
    } else {
        IAgriJournalItem journalItem = (IAgriJournalItem) journalStack.getItem();
        consumer.accept("Journal (" + journalItem.getDiscoveredSeeds(journalStack).size() + " plants):");
        for (IAgriPlant plant : journalItem.getDiscoveredSeeds(journalStack)) {
            consumer.accept(" - " + plant.getId());
        }
    }
}
Also used : IAgriPlant(com.infinityraider.agricraft.api.v1.plant.IAgriPlant) ItemStack(net.minecraft.item.ItemStack) IAgriJournalItem(com.infinityraider.agricraft.api.v1.content.items.IAgriJournalItem)

Aggregations

IAgriJournalItem (com.infinityraider.agricraft.api.v1.content.items.IAgriJournalItem)6 ItemStack (net.minecraft.item.ItemStack)6 IAgriSeedItem (com.infinityraider.agricraft.api.v1.content.items.IAgriSeedItem)2 IAgriPlant (com.infinityraider.agricraft.api.v1.plant.IAgriPlant)2 Nonnull (javax.annotation.Nonnull)1 Slot (net.minecraft.inventory.container.Slot)1 TileEntity (net.minecraft.tileentity.TileEntity)1 StringTextComponent (net.minecraft.util.text.StringTextComponent)1 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)1