本文整理汇总了Java中net.minecraft.entity.projectile.EntityEgg类的典型用法代码示例。如果您正苦于以下问题:Java EntityEgg类的具体用法?Java EntityEgg怎么用?Java EntityEgg使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityEgg类属于net.minecraft.entity.projectile包,在下文中一共展示了EntityEgg类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onItemRightClick
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
/**
* Called when the equipped item is right clicked.
*/
@Override
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn)
{
ItemStack itemstack = playerIn.getHeldItem(handIn);
itemstack.shrink(1);
worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!worldIn.isRemote)
{
EntityEgg entityegg = new CoreEntityEgg(worldIn, playerIn);
entityegg.setHeadingFromThrower(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
worldIn.spawnEntity(entityegg);
}
playerIn.addStat(StatList.getObjectUseStats(this));
return new ActionResult(EnumActionResult.SUCCESS, itemstack);
}
示例2: onItemRightClick
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn)
{
if (!playerIn.capabilities.isCreativeMode)
{
--itemStackIn.stackSize;
}
worldIn.playSoundAtEntity(playerIn, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!worldIn.isRemote)
{
worldIn.spawnEntityInWorld(new EntityEgg(worldIn, playerIn));
}
playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
return itemStackIn;
}
示例3: onItemRightClick
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
public ActionResult<ItemStack> onItemRightClick(World itemStackIn, EntityPlayer worldIn, EnumHand playerIn)
{
ItemStack itemstack = worldIn.getHeldItem(playerIn);
if (!worldIn.capabilities.isCreativeMode)
{
itemstack.func_190918_g(1);
}
itemStackIn.playSound((EntityPlayer)null, worldIn.posX, worldIn.posY, worldIn.posZ, SoundEvents.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!itemStackIn.isRemote)
{
EntityEgg entityegg = new EntityEgg(itemStackIn, worldIn);
entityegg.setHeadingFromThrower(worldIn, worldIn.rotationPitch, worldIn.rotationYaw, 0.0F, 1.5F, 1.0F);
itemStackIn.spawnEntityInWorld(entityegg);
}
worldIn.addStat(StatList.getObjectUseStats(this));
return new ActionResult(EnumActionResult.SUCCESS, itemstack);
}
示例4: onItemRightClick
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand)
{
if (!playerIn.capabilities.isCreativeMode)
{
--itemStackIn.stackSize;
}
worldIn.playSound((EntityPlayer)null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_EGG_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!worldIn.isRemote)
{
EntityEgg entityegg = new EntityEgg(worldIn, playerIn);
entityegg.setHeadingFromThrower(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 1.5F, 1.0F);
worldIn.spawnEntityInWorld(entityegg);
}
playerIn.addStat(StatList.getObjectUseStats(this));
return new ActionResult(EnumActionResult.SUCCESS, itemStackIn);
}
示例5: onItemRightClick
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isClient)
{
par2World.spawnEntityInWorld(new EntityEgg(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
示例6: update
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
@Override
public void update() {
super.update();
List<Entity> entityList = worldObj.getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(pos.getX() - .5, pos.getY() - .5, pos.getZ() - .5, pos.getX() + 1.5, pos.getY() + 1.5, pos.getZ() + 1.5));
for (Entity entity : entityList) {
if (entity instanceof EntitySnowball || entity instanceof EntityEgg) {
//Fun fact: Eggs and snowballs use the same particle code
for (int i = 0; i < 8; ++i) {
this.worldObj.spawnParticle(EnumParticleTypes.SNOWBALL, entity.posX, entity.posY, entity.posZ, 0.0D, 0.0D, 0.0D);
}
entity.setDead();
if (!worldObj.isRemote) {
onEntityCollidedWithBlock(entity);
}
} else if (entity instanceof EntityArrow) {
entity.setDead();
if (!worldObj.isRemote) {
onEntityCollidedWithBlock(entity);
}
}
}
}
示例7: onItemRightClick
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_)
{
if (!p_77659_3_.capabilities.isCreativeMode)
{
--p_77659_1_.stackSize;
}
p_77659_2_.playSoundAtEntity(p_77659_3_, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!p_77659_2_.isRemote)
{
p_77659_2_.spawnEntityInWorld(new EntityEgg(p_77659_2_, p_77659_3_));
}
return p_77659_1_;
}
示例8: onItemRightClick
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
--par1ItemStack.stackSize;
}
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityEgg(par2World, par3EntityPlayer));
}
return par1ItemStack;
}
示例9: onEntityCollidedWithBlock
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
public void onEntityCollidedWithBlock(Entity entity) {
if (entity instanceof EntityArrow) {
addFuel(Config.pumpArrowDuration, Config.pumpArrowSpeed);
}
if (entity instanceof EntityEgg) {
addFuel(Config.pumpEggDuration, Config.pumpEggSpeed);
}
if (entity instanceof EntitySnowball) {
addFuel(Config.pumpSnowballDuration, Config.pumpSnowballSpeed);
}
}
示例10: onItemRightClick
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if(par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.consumeInventoryItem(Items.egg)) {
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1F, 0.9F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityEgg(par2World, par3EntityPlayer));
}
}
return par1ItemStack;
}
示例11: func_77659_a
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
public ItemStack func_77659_a(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_) {
if(!p_77659_3_.field_71075_bZ.field_75098_d) {
--p_77659_1_.field_77994_a;
}
p_77659_2_.func_72956_a(p_77659_3_, "random.bow", 0.5F, 0.4F / (field_77697_d.nextFloat() * 0.4F + 0.8F));
if(!p_77659_2_.field_72995_K) {
p_77659_2_.func_72838_d(new EntityEgg(p_77659_2_, p_77659_3_));
}
return p_77659_1_;
}
示例12: CraftEgg
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
public CraftEgg(CraftServer server, EntityEgg entity) {
super(server, entity);
}
示例13: getHandle
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
@Override
public EntityEgg getHandle() {
return (EntityEgg) entity;
}
示例14: RenderManager
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
public RenderManager(TextureManager renderEngineIn, RenderItem itemRendererIn)
{
this.renderEngine = renderEngineIn;
this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider(this));
this.entityRenderMap.put(EntitySpider.class, new RenderSpider(this));
this.entityRenderMap.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F));
this.entityRenderMap.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F));
this.entityRenderMap.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F));
this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F));
this.entityRenderMap.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F));
this.entityRenderMap.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F));
this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F));
this.entityRenderMap.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F));
this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish(this));
this.entityRenderMap.put(EntityEndermite.class, new RenderEndermite(this));
this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper(this));
this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman(this));
this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan(this));
this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton(this));
this.entityRenderMap.put(EntityWitch.class, new RenderWitch(this));
this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze(this));
this.entityRenderMap.put(EntityPigZombie.class, new RenderPigZombie(this));
this.entityRenderMap.put(EntityZombie.class, new RenderZombie(this));
this.entityRenderMap.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F));
this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube(this));
this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F));
this.entityRenderMap.put(EntityGhast.class, new RenderGhast(this));
this.entityRenderMap.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F));
this.entityRenderMap.put(EntityVillager.class, new RenderVillager(this));
this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem(this));
this.entityRenderMap.put(EntityBat.class, new RenderBat(this));
this.entityRenderMap.put(EntityGuardian.class, new RenderGuardian(this));
this.entityRenderMap.put(EntityDragon.class, new RenderDragon(this));
this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
this.entityRenderMap.put(EntityWither.class, new RenderWither(this));
this.entityRenderMap.put(Entity.class, new RenderEntity(this));
this.entityRenderMap.put(EntityPainting.class, new RenderPainting(this));
this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(this, itemRendererIn));
this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot(this));
this.entityRenderMap.put(EntityArrow.class, new RenderArrow(this));
this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(this, Items.snowball, itemRendererIn));
this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(this, Items.ender_pearl, itemRendererIn));
this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(this, Items.ender_eye, itemRendererIn));
this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(this, Items.egg, itemRendererIn));
this.entityRenderMap.put(EntityPotion.class, new RenderPotion(this, itemRendererIn));
this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(this, Items.experience_bottle, itemRendererIn));
this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.fireworks, itemRendererIn));
this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull(this));
this.entityRenderMap.put(EntityItem.class, new RenderEntityItem(this, itemRendererIn));
this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb(this));
this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
this.entityRenderMap.put(EntityFallingBlock.class, new RenderFallingBlock(this));
this.entityRenderMap.put(EntityArmorStand.class, new ArmorStandRenderer(this));
this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart(this));
this.entityRenderMap.put(EntityBoat.class, new RenderBoat(this));
this.entityRenderMap.put(EntityFishHook.class, new RenderFish(this));
this.entityRenderMap.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F));
this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt(this));
this.playerRenderer = new RenderPlayer(this);
this.skinMap.put("default", this.playerRenderer);
this.skinMap.put("slim", new RenderPlayer(this, true));
}
示例15: RenderManager
import net.minecraft.entity.projectile.EntityEgg; //导入依赖的package包/类
public RenderManager(TextureManager renderEngineIn, RenderItem itemRendererIn)
{
this.renderEngine = renderEngineIn;
this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider(this));
this.entityRenderMap.put(EntitySpider.class, new RenderSpider(this));
this.entityRenderMap.put(EntityPig.class, new RenderPig(this, new ModelPig(), 0.7F));
this.entityRenderMap.put(EntitySheep.class, new RenderSheep(this, new ModelSheep2(), 0.7F));
this.entityRenderMap.put(EntityCow.class, new RenderCow(this, new ModelCow(), 0.7F));
this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(this, new ModelCow(), 0.7F));
this.entityRenderMap.put(EntityWolf.class, new RenderWolf(this, new ModelWolf(), 0.5F));
this.entityRenderMap.put(EntityChicken.class, new RenderChicken(this, new ModelChicken(), 0.3F));
this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(this, new ModelOcelot(), 0.4F));
this.entityRenderMap.put(EntityRabbit.class, new RenderRabbit(this, new ModelRabbit(), 0.3F));
this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish(this));
this.entityRenderMap.put(EntityEndermite.class, new RenderEndermite(this));
this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper(this));
this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman(this));
this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan(this));
this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton(this));
this.entityRenderMap.put(EntityWitch.class, new RenderWitch(this));
this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze(this));
this.entityRenderMap.put(EntityPigZombie.class, new RenderPigZombie(this));
this.entityRenderMap.put(EntityZombie.class, new RenderZombie(this));
this.entityRenderMap.put(EntitySlime.class, new RenderSlime(this, new ModelSlime(16), 0.25F));
this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube(this));
this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(this, new ModelZombie(), 0.5F, 6.0F));
this.entityRenderMap.put(EntityGhast.class, new RenderGhast(this));
this.entityRenderMap.put(EntitySquid.class, new RenderSquid(this, new ModelSquid(), 0.7F));
this.entityRenderMap.put(EntityVillager.class, new RenderVillager(this));
this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem(this));
this.entityRenderMap.put(EntityBat.class, new RenderBat(this));
this.entityRenderMap.put(EntityGuardian.class, new RenderGuardian(this));
this.entityRenderMap.put(EntityDragon.class, new RenderDragon(this));
this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal(this));
this.entityRenderMap.put(EntityWither.class, new RenderWither(this));
this.entityRenderMap.put(Entity.class, new RenderEntity(this));
this.entityRenderMap.put(EntityPainting.class, new RenderPainting(this));
this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame(this, itemRendererIn));
this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot(this));
this.entityRenderMap.put(EntityArrow.class, new RenderArrow(this));
this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(this, Items.snowball, itemRendererIn));
this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(this, Items.ender_pearl, itemRendererIn));
this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(this, Items.ender_eye, itemRendererIn));
this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(this, Items.egg, itemRendererIn));
this.entityRenderMap.put(EntityPotion.class, new RenderPotion(this, itemRendererIn));
this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(this, Items.experience_bottle, itemRendererIn));
this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(this, Items.fireworks, itemRendererIn));
this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(this, 2.0F));
this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(this, 0.5F));
this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull(this));
this.entityRenderMap.put(EntityItem.class, new RenderEntityItem(this, itemRendererIn));
this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb(this));
this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed(this));
this.entityRenderMap.put(EntityFallingBlock.class, new RenderFallingBlock(this));
this.entityRenderMap.put(EntityArmorStand.class, new ArmorStandRenderer(this));
this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart(this));
this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner(this));
this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart(this));
this.entityRenderMap.put(EntityBoat.class, new RenderBoat(this));
this.entityRenderMap.put(EntityFishHook.class, new RenderFish(this));
this.entityRenderMap.put(EntityHorse.class, new RenderHorse(this, new ModelHorse(), 0.75F));
this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt(this));
this.playerRenderer = new RenderPlayer(this);
this.skinMap.put("default", this.playerRenderer);
this.skinMap.put("slim", new RenderPlayer(this, true));
PlayerItemsLayer.register(this.skinMap);
if (Reflector.RenderingRegistry_loadEntityRenderers.exists())
{
Reflector.call(Reflector.RenderingRegistry_loadEntityRenderers, new Object[] {this.entityRenderMap});
}
}