Package pneumaticCraft.common.entity.item

Examples of pneumaticCraft.common.entity.item.EntityItemSpecial.copyDataFrom()


                ItemStack stack = ((EntityItem)event.entity).getEntityItem();
                if(!(event.entity instanceof EntityItemSpecial)) {
                    if(stack.getItem() == net.minecraft.init.Items.iron_ingot || stack.getItem() == Item.getItemFromBlock(net.minecraft.init.Blocks.iron_block)) {
                        EntityItemSpecial seedEntity = new EntityItemSpecial(event.world, stack.copy());
                        seedEntity.delayBeforeCanPickup = ((EntityItem)event.entity).delayBeforeCanPickup;
                        seedEntity.copyDataFrom(event.entity, true);
                        event.setCanceled(true);
                        stack.stackSize = 0; //Tinkers Construct fix, because tinkers invokes EntityItem#onCollideWithPlayer(EntityItem) without checking if the item entity is dead.
                        event.world.spawnEntityInWorld(seedEntity);
                    }
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.