Package net.minecraft.entity.item

Examples of net.minecraft.entity.item.EntityItem.copyDataFrom()


            Item newItem = getEntityItem().getItem() == net.minecraft.init.Items.iron_ingot ? Itemss.ingotIronCompressed : Item.getItemFromBlock(Blockss.compressedIron);
            ItemStack newStack = new ItemStack(newItem, getEntityItem().stackSize, getEntityItem().getItemDamage());
            if(getEntityItem().stackSize >= 3) {
                newStack.stackSize = (int)(getEntityItem().stackSize * (rand.nextDouble() * Math.min(Config.configCompressedIngotLossRate * 0.02D, 0.2D) + (Math.max(0.9D, 1D - Config.configCompressedIngotLossRate * 0.01D) - Config.configCompressedIngotLossRate * 0.01D)));
            }
            compressedIngot.copyDataFrom(this, true);
            compressedIngot.setEntityItemStack(newStack);
            compressedIngot.delayBeforeCanPickup = delayBeforeCanPickup;
            worldObj.spawnEntityInWorld(compressedIngot);
            getEntityItem().stackSize = 0;
        }
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.