本文整理汇总了Java中net.minecraft.entity.monster.EntityShulker类的典型用法代码示例。如果您正苦于以下问题:Java EntityShulker类的具体用法?Java EntityShulker怎么用?Java EntityShulker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityShulker类属于net.minecraft.entity.monster包,在下文中一共展示了EntityShulker类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkSetTarget
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@SubscribeEvent
public void checkSetTarget(LivingSetAttackTargetEvent event) {
if (event.getTarget() == null)
return;
if (!(event.getTarget() instanceof EntityPlayer) || event.getTarget() instanceof FakePlayer)
return;
if (!(event.getEntity() instanceof EntityLiving))
return;
EntityPlayer player = (EntityPlayer)event.getTarget();
EntityLiving ent = (EntityLiving)event.getEntity();
boolean flag = player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() == UCItems.poncho && NBTUtils.getInt(player.inventory.armorInventory[2], ItemGeneric.TAG_UPGRADE, -1) == 10;
if (flag && ent.isNonBoss() && !(ent instanceof EntityGuardian || ent instanceof EntityShulker))
{
ent.setAttackTarget(null);
ent.setRevengeTarget(null);
}
}
示例2: doRender
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityShulker entity, double x, double y, double z, float entityYaw, float partialTicks)
{
int i = entity.getClientTeleportInterp();
if (i > 0 && entity.isAttachedToBlock())
{
BlockPos blockpos = entity.getAttachmentPos();
BlockPos blockpos1 = entity.getOldAttachPos();
double d0 = (double)((float)i - partialTicks) / 6.0D;
d0 = d0 * d0;
double d1 = (double)(blockpos.getX() - blockpos1.getX()) * d0;
double d2 = (double)(blockpos.getY() - blockpos1.getY()) * d0;
double d3 = (double)(blockpos.getZ() - blockpos1.getZ()) * d0;
super.doRender(entity, x - d1, y - d2, z - d3, entityYaw, partialTicks);
}
else
{
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
}
示例3: shouldRender
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
public boolean shouldRender(EntityShulker livingEntity, ICamera camera, double camX, double camY, double camZ)
{
if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
{
return true;
}
else
{
if (livingEntity.getClientTeleportInterp() > 0 && livingEntity.isAttachedToBlock())
{
BlockPos blockpos = livingEntity.getOldAttachPos();
BlockPos blockpos1 = livingEntity.getAttachmentPos();
Vec3d vec3d = new Vec3d((double)blockpos1.getX(), (double)blockpos1.getY(), (double)blockpos1.getZ());
Vec3d vec3d1 = new Vec3d((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ());
if (camera.isBoundingBoxInFrustum(new AxisAlignedBB(vec3d1.xCoord, vec3d1.yCoord, vec3d1.zCoord, vec3d.xCoord, vec3d.yCoord, vec3d.zCoord)))
{
return true;
}
}
return false;
}
}
示例4: handleDataMarker
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
protected void handleDataMarker(String p_186175_1_, BlockPos p_186175_2_, World p_186175_3_, Random p_186175_4_, StructureBoundingBox p_186175_5_)
{
if (p_186175_1_.startsWith("Chest"))
{
BlockPos blockpos = p_186175_2_.down();
if (p_186175_5_.isVecInside(blockpos))
{
TileEntity tileentity = p_186175_3_.getTileEntity(blockpos);
if (tileentity instanceof TileEntityChest)
{
((TileEntityChest)tileentity).setLootTable(LootTableList.CHESTS_END_CITY_TREASURE, p_186175_4_.nextLong());
}
}
}
else if (p_186175_1_.startsWith("Sentry"))
{
EntityShulker entityshulker = new EntityShulker(p_186175_3_);
entityshulker.setPosition((double)p_186175_2_.getX() + 0.5D, (double)p_186175_2_.getY() + 0.5D, (double)p_186175_2_.getZ() + 0.5D);
entityshulker.setAttachmentPos(p_186175_2_);
p_186175_3_.spawnEntityInWorld(entityshulker);
}
else if (p_186175_1_.startsWith("Elytra"))
{
EntityItemFrame entityitemframe = new EntityItemFrame(p_186175_3_, p_186175_2_, this.rotation.rotate(EnumFacing.SOUTH));
entityitemframe.setDisplayedItem(new ItemStack(Items.ELYTRA));
p_186175_3_.spawnEntityInWorld(entityitemframe);
}
}
示例5: rotateCorpse
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
protected void rotateCorpse(EntityShulker entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
super.rotateCorpse(entityLiving, p_77043_2_, p_77043_3_, partialTicks);
switch (entityLiving.getAttachmentFacing())
{
case DOWN:
default:
break;
case EAST:
GlStateManager.translate(0.5F, 0.5F, 0.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F);
break;
case WEST:
GlStateManager.translate(-0.5F, 0.5F, 0.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F);
break;
case NORTH:
GlStateManager.translate(0.0F, 0.5F, -0.5F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
break;
case SOUTH:
GlStateManager.translate(0.0F, 0.5F, 0.5F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
break;
case UP:
GlStateManager.translate(0.0F, 1.0F, 0.0F);
GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
}
}
示例6: setRotationAngles
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
* and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
* "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
EntityShulker entityshulker = (EntityShulker)entityIn;
float f = ageInTicks - (float)entityshulker.ticksExisted;
float f1 = (0.5F + entityshulker.getClientPeekAmount(f)) * (float)Math.PI;
float f2 = -1.0F + MathHelper.sin(f1);
float f3 = 0.0F;
if (f1 > (float)Math.PI)
{
f3 = MathHelper.sin(ageInTicks * 0.1F) * 0.7F;
}
this.lid.setRotationPoint(0.0F, 16.0F + MathHelper.sin(f1) * 8.0F + f3, 0.0F);
if (entityshulker.getClientPeekAmount(f) > 0.3F)
{
this.lid.rotateAngleY = f2 * f2 * f2 * f2 * (float)Math.PI * 0.125F;
}
else
{
this.lid.rotateAngleY = 0.0F;
}
this.head.rotateAngleX = headPitch * 0.017453292F;
this.head.rotateAngleY = netHeadYaw * 0.017453292F;
}
示例7: doRender
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
/**
* Renders the desired {@code T} type Entity.
*/
public void doRender(EntityShulker entity, double x, double y, double z, float entityYaw, float partialTicks)
{
if (this.modelVersion != ((ModelShulker)this.mainModel).getModelVersion())
{
this.mainModel = new ModelShulker();
this.modelVersion = ((ModelShulker)this.mainModel).getModelVersion();
}
int i = entity.getClientTeleportInterp();
if (i > 0 && entity.isAttachedToBlock())
{
BlockPos blockpos = entity.getAttachmentPos();
BlockPos blockpos1 = entity.getOldAttachPos();
double d0 = (double)((float)i - partialTicks) / 6.0D;
d0 = d0 * d0;
double d1 = (double)(blockpos.getX() - blockpos1.getX()) * d0;
double d2 = (double)(blockpos.getY() - blockpos1.getY()) * d0;
double d3 = (double)(blockpos.getZ() - blockpos1.getZ()) * d0;
super.doRender(entity, x - d1, y - d2, z - d3, entityYaw, partialTicks);
}
else
{
super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
}
示例8: rotateCorpse
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
protected void rotateCorpse(EntityShulker entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
super.rotateCorpse(entityLiving, p_77043_2_, p_77043_3_, partialTicks);
switch (entityLiving.getAttachmentFacing())
{
case DOWN:
default:
break;
case EAST:
GlStateManager.translate(0.5F, 0.5F, 0.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F);
break;
case WEST:
GlStateManager.translate(-0.5F, 0.5F, 0.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(-90.0F, 0.0F, 0.0F, 1.0F);
break;
case NORTH:
GlStateManager.translate(0.0F, 0.5F, -0.5F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
break;
case SOUTH:
GlStateManager.translate(0.0F, 0.5F, 0.5F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
break;
case UP:
GlStateManager.translate(0.0F, 1.0F, 0.0F);
GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
}
}
示例9: onEntityDrop
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@SubscribeEvent
public void onEntityDrop(LivingDropsEvent event) {
EntityLivingBase living = event.getEntityLiving();
if (living == null || living.world == null) return;
Random rand = living.world.rand;
if (living instanceof EntityShulker) {
if (rand.nextFloat() < 1.0f) {
event.getEntityLiving().entityDropItem(ModItems.material.getMaterial("ender_cream", 1 + rand.nextInt(2)), 0);
}
}
}
示例10: isHostileMob
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
private boolean isHostileMob(EntityLivingBase victim) {
return victim instanceof EntityMob ||
victim instanceof EntitySlime ||
victim instanceof EntityMagmaCube ||
victim instanceof EntityGhast ||
victim instanceof EntityShulker;
}
示例11: initEntityAI
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@Override
protected void initEntityAI()
{
super.initEntityAI();
this.tasks.addTask(1, new MobAIRangedAttack(this, 0, 0, 15));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityDragon>(this, EntityDragon.class, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityGhast>(this, EntityGhast.class, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityMob>(this, EntityMob.class, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityShulker>(this, EntityShulker.class, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntitySlime>(this, EntitySlime.class, true));
}
示例12: attachCapabilities
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
/**
* Called every time a target is constructed. Allows for capabilities to be attatched to
* the target.
*
* @param event The forge event.
*/
@SubscribeEvent
public void attachCapabilities (AttachCapabilitiesEvent<Entity> event) {
if (event.getObject() instanceof EntityShulker) {
event.addCapability(new ResourceLocation(DarkUtils.MOD_ID, "shulker_info"), new Provider());
}
}
示例13: onLivingDrops
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@SubscribeEvent
public void onLivingDrops (LivingDropsEvent event) {
if (event.getEntity() instanceof EntityShulker) {
final ICustomData data = ShulkerDataHandler.getData(event.getEntity());
if (data != null && data.getCooldown() <= 0) {
final Vec3d pos = event.getEntity().getPositionVector();
event.getDrops().add(new EntityItem(event.getEntity().getEntityWorld(), pos.x, pos.y, pos.z, new ItemStack(itemShulkerPearl)));
data.setCooldown(this.maxCooldown);
}
}
}
示例14: onEntityInteract
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@SubscribeEvent
public void onEntityInteract (EntityInteract event) {
if (event.getSide().equals(Side.SERVER) && this.harvestablePearls && event.getTarget() instanceof EntityShulker) {
final ICustomData data = ShulkerDataHandler.getData(event.getTarget());
if (data != null && data.getCooldown() <= 0) {
event.getTarget().entityDropItem(new ItemStack(itemShulkerPearl), 0.5f);
data.setCooldown(this.maxCooldown);
}
}
}
示例15: onEntityUpdate
import net.minecraft.entity.monster.EntityShulker; //导入依赖的package包/类
@SubscribeEvent
public void onEntityUpdate (LivingUpdateEvent event) {
if (this.harvestablePearls && event.getEntity() instanceof EntityShulker) {
final ICustomData data = ShulkerDataHandler.getData(event.getEntity());
final int current = data.getCooldown();
if (data != null && current > 0) {
data.setCooldown(current - 1);
}
}
}