本文整理汇总了Java中net.minecraft.entity.monster.EntitySkeleton.getSkeletonType方法的典型用法代码示例。如果您正苦于以下问题:Java EntitySkeleton.getSkeletonType方法的具体用法?Java EntitySkeleton.getSkeletonType怎么用?Java EntitySkeleton.getSkeletonType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.monster.EntitySkeleton
的用法示例。
在下文中一共展示了EntitySkeleton.getSkeletonType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onMobDrops
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
@SubscribeEvent
public void onMobDrops(LivingDropsEvent e)
{
World world = e.getEntity().getEntityWorld();
Random rng = world.rand;
if (e.getEntity() instanceof EntitySkeleton) {
EntitySkeleton skele = (EntitySkeleton) e.getEntity();
if (skele.getSkeletonType() == 1) {
if (rng.nextFloat() < 0.20 + (e.getLootingLevel() + 1 * 0.05))
e.getDrops().add(new EntityItem(world, skele.posX, skele.posY, skele.posZ, new ItemStack(ModItems.MobDust, 1, 0)));
}
}
if (e.getEntity() instanceof EntityCaveSpider) {
if (rng.nextFloat() < 0.20 + (e.getLootingLevel() + 1 * 0.05))
e.getDrops().add(new EntityItem(world, e.getEntity().posX, e.getEntity().posY, e.getEntity().posZ, new ItemStack(ModItems.MobDust, 1, 1)));
}
}
示例2: onLeftClickEntity
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
@Override
public boolean onLeftClickEntity(ItemStack stack, EntityPlayer player, Entity entity)
{
if(entity instanceof EntitySkeleton)
{
EntitySkeleton skele = (EntitySkeleton) entity;
if(skele.getSkeletonType() == 1)
{
skele.attackEntityFrom(DamageSource.causePlayerDamage(player),2.0F);
return false;
}
}
if(entity instanceof EntityLivingBase)
{
entity.worldObj.newExplosion(entity,entity.posX,entity.posY,entity.posZ,3.0F,false,true);
player.attackEntityFrom(DamageSource.magic,1000.0F);
stack.stackSize = 0;
return false;
}
return true;
}
示例3: preRenderCallback
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(EntitySkeleton entitylivingbaseIn, float partialTickTime)
{
if (entitylivingbaseIn.getSkeletonType() == 1)
{
GlStateManager.scale(1.2F, 1.2F, 1.2F);
}
}
示例4: preRenderCallback
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
/**
* Allows the render to do state modifications necessary before the model is rendered.
*/
protected void preRenderCallback(EntitySkeleton entitylivingbaseIn, float partialTickTime)
{
if (entitylivingbaseIn.getSkeletonType() == SkeletonType.WITHER)
{
GlStateManager.scale(1.2F, 1.2F, 1.2F);
}
}
示例5: doRenderLayer
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
public void doRenderLayer(EntitySkeleton entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (entitylivingbaseIn.getSkeletonType() == SkeletonType.STRAY)
{
this.layerModel.setModelAttributes(this.renderer.getMainModel());
this.layerModel.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partialTicks);
this.renderer.bindTexture(STRAY_CLOTHES_TEXTURES);
this.layerModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
}
}
示例6: onAttackEntity
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
@SubscribeEvent
public void onAttackEntity(AttackEntityEvent event) {
if (event.getTarget() instanceof EntityLivingBase) {
EntityLivingBase target = (EntityLivingBase) event.getTarget();
EntityPlayer player = event.getEntityPlayer();
if (this.isActive(player)) {
PossessivePlayer possessivePlayer = PossessHandler.get(player);
EntitySkeleton possessing = (EntitySkeleton) possessivePlayer.getPossessing();
if (possessing.getSkeletonType() == SkeletonType.WITHER) {
target.addPotionEffect(new PotionEffect(MobEffects.WITHER, 100, 1));
}
}
}
}
示例7: preRenderCallback
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(EntitySkeleton par1EntitySkeleton, float par2)
{
if (par1EntitySkeleton.getSkeletonType() == 1)
{
GL11.glScalef(1.2F, 1.2F, 1.2F);
}
}
示例8: dropHeads
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
private void dropHeads(LivingDeathEvent event) {
if(event.entityLiving instanceof EntityCreeper) {
event.entityLiving.entityDropItem(new ItemStack(Items.skull, 1, 4), 0.0F);
return;
}
if(event.entityLiving instanceof EntityPlayer) {
ItemStack drop = new ItemStack(Items.skull, 1, 3);
drop.stackTagCompound = new NBTTagCompound();
drop.stackTagCompound.setString("SkullOwner", ((EntityPlayer) event.entityLiving).getDisplayName());
event.entityLiving.entityDropItem(drop, 0.0F);
return;
}
if(event.entityLiving instanceof EntitySkeleton) {
EntitySkeleton sk = (EntitySkeleton) event.entityLiving;
if(sk.getSkeletonType() == 0) {
event.entityLiving.entityDropItem(new ItemStack(Items.skull, 1, 0), 0.0F);
return;
} else {
event.entityLiving.entityDropItem(new ItemStack(Items.skull, 1, 1), 0.0F);
return;
}
}
if(event.entityLiving instanceof EntityZombie) {
event.entityLiving.entityDropItem(new ItemStack(Items.skull, 1, 2), 0.0F);
return;
}
}
示例9: fromMC
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
@Override
public I fromMC(EntitySkeleton entityMC) {
/* */
if (entityMC.getSkeletonType() == 0)
return (I) new Skeleton(entityMC);
else
return (I) new WitherSkeleton(entityMC);
}
示例10: preRenderCallback
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
protected void preRenderCallback(EntitySkeleton p_77041_1_, float p_77041_2_)
{
if (p_77041_1_.getSkeletonType() == 1)
{
GL11.glScalef(1.2F, 1.2F, 1.2F);
}
}
示例11: scaleSkeleton
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
protected void scaleSkeleton(EntitySkeleton par1EntitySkeleton, float par2)
{
if (par1EntitySkeleton.getSkeletonType() == 1)
{
GL11.glScalef(1.2F, 1.2F, 1.2F);
}
}
示例12: getEntityTexture
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntitySkeleton entity)
{
return entity.getSkeletonType() == 1 ? witherSkeletonTextures : skeletonTextures;
}
示例13: getEntityTexture
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
/**
* Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntitySkeleton entity)
{
SkeletonType skeletontype = entity.getSkeletonType();
return skeletontype == SkeletonType.WITHER ? WITHER_SKELETON_TEXTURES : (skeletontype == SkeletonType.STRAY ? STRAY_SKELETON_TEXTURES : SKELETON_TEXTURES);
}
示例14: onArrowLoose
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
@SubscribeEvent
public void onArrowLoose(ArrowLooseEvent event) {
EntityPlayer player = event.getEntityPlayer();
if (this.isActive(player)) {
if (!event.hasAmmo()) {
ItemStack stack = event.getBow();
World world = player.getEntityWorld();
EntitySkeleton skeleton = (EntitySkeleton) PossessHandler.get(player).getPossessing();
float velocity = ItemBow.getArrowVelocity(event.getCharge());
if (velocity >= 0.1) {
if (!world.isRemote) {
EntityTippedArrow arrow = new EntityTippedArrow(world, player);
if (skeleton.getSkeletonType() != SkeletonType.STRAY) {
arrow.setPotionEffect(new ItemStack(Items.ARROW));
} else {
arrow.setPotionEffect(new ItemStack(Items.TIPPED_ARROW));
arrow.addEffect(new PotionEffect(MobEffects.SLOWNESS, 600));
}
arrow.setAim(player, player.rotationPitch, player.rotationYaw, 0.0F, velocity * 3.0F, 1.0F);
arrow.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY;
if (velocity == 1.0F) {
arrow.setIsCritical(true);
}
int power = EnchantmentHelper.getEnchantmentLevel(Enchantments.POWER, stack);
if (power > 0) {
arrow.setDamage(arrow.getDamage() + (double) power * 0.5 + 0.5);
}
int punch = EnchantmentHelper.getEnchantmentLevel(Enchantments.PUNCH, stack);
if (punch > 0) {
arrow.setKnockbackStrength(punch);
}
if (EnchantmentHelper.getEnchantmentLevel(Enchantments.FLAME, stack) > 0) {
arrow.setFire(100);
}
stack.damageItem(1, player);
world.spawnEntityInWorld(arrow);
}
world.playSound(null, player.posX, player.posY, player.posZ, SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 1.0F, 1.0F / (world.rand.nextFloat() * 0.4F + 1.2F) + velocity * 0.5F);
player.addStat(StatList.getObjectUseStats(stack.getItem()));
}
}
}
}
示例15: onEntityCollidedWithBlock
import net.minecraft.entity.monster.EntitySkeleton; //导入方法依赖的package包/类
@Override
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity) {
if (world.isRemote)
return;
if (entity.isDead)
return;
if (entity instanceof EntitySkeleton) {
EntitySkeleton skeleton = (EntitySkeleton) entity;
if (skeleton.getSkeletonType() == SkeletonType.NORMAL) {
skeleton.setSkeletonType(SkeletonType.WITHER);
skeleton.setHealth(skeleton.getMaxHealth());
return;
}
}
if (entity instanceof EntityCreeper) {
EntityCreeper creeper = (EntityCreeper) entity;
if (!creeper.getPowered()) {
creeper.onStruckByLightning(null);
creeper.setHealth(creeper.getMaxHealth());
return;
}
}
if (entity instanceof EntitySpider && !(entity instanceof EntityCaveSpider)) {
EntitySpider spider = (EntitySpider) entity;
spider.setDead();
EntityCaveSpider caveSpider = new EntityCaveSpider(world);
caveSpider.setLocationAndAngles(spider.posX, spider.posY, spider.posZ, spider.rotationYaw, spider.rotationPitch);
caveSpider.renderYawOffset = spider.renderYawOffset;
caveSpider.setHealth(caveSpider.getMaxHealth());
world.spawnEntity(caveSpider);
return;
}
if (entity instanceof EntitySquid) {
EntitySquid squid = (EntitySquid) entity;
squid.setDead();
EntityGhast ghast = new EntityGhast(world);
ghast.setLocationAndAngles(squid.posX, squid.posY, squid.posZ, squid.rotationYaw, squid.rotationPitch);
ghast.renderYawOffset = squid.renderYawOffset;
ghast.setHealth(ghast.getMaxHealth());
world.spawnEntity(ghast);
return;
}
if (entity instanceof EntityAnimal) {
((EntityAnimal) entity).onStruckByLightning(null);
return;
}
if (entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
player.addPotionEffect(new PotionEffect(MobEffects.BLINDNESS, 210, 0));
player.addPotionEffect(new PotionEffect(MobEffects.WEAKNESS, 210, 2));
player.addPotionEffect(new PotionEffect(MobEffects.WITHER, 210, 0));
player.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, 210, 0));
}
}