Search in sources :

Example 11 with ItemEntity

use of net.minecraft.entity.item.ItemEntity in project AgriCraft by AgriCraft.

the class MagnifyingGlassGenomeInspector method onInspectionStart.

@Override
public void onInspectionStart(World world, Entity entity, PlayerEntity player) {
    ItemEntity item = (ItemEntity) entity;
    IAgriGeneCarrierItem seed = (IAgriGeneCarrierItem) item.getItem().getItem();
    this.genomeCache = seed.getGenome(item.getItem()).map(IAgriGenome::getGeneList).orElse(ImmutableList.of());
}
Also used : IAgriGeneCarrierItem(com.infinityraider.agricraft.api.v1.genetics.IAgriGeneCarrierItem) ItemEntity(net.minecraft.entity.item.ItemEntity) IAgriGenome(com.infinityraider.agricraft.api.v1.genetics.IAgriGenome)

Aggregations

ItemEntity (net.minecraft.entity.item.ItemEntity)11 ItemStack (net.minecraft.item.ItemStack)7 List (java.util.List)2 PlayerEntity (net.minecraft.entity.player.PlayerEntity)2 ServerPlayerEntity (net.minecraft.entity.player.ServerPlayerEntity)2 Direction (net.minecraft.util.Direction)2 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)2 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)2 IAgriGeneCarrierItem (com.infinityraider.agricraft.api.v1.genetics.IAgriGeneCarrierItem)1 IAgriGenome (com.infinityraider.agricraft.api.v1.genetics.IAgriGenome)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 LivingEntity (net.minecraft.entity.LivingEntity)1 IInventory (net.minecraft.inventory.IInventory)1 ITickableTileEntity (net.minecraft.tileentity.ITickableTileEntity)1 TileEntity (net.minecraft.tileentity.TileEntity)1 BlockPos (net.minecraft.util.math.BlockPos)1 World (net.minecraft.world.World)1 OnlyIn (net.minecraftforge.api.distmarker.OnlyIn)1 FakePlayer (net.minecraftforge.common.util.FakePlayer)1 TickEvent (net.minecraftforge.event.TickEvent)1