本文整理汇总了Java中net.minecraft.entity.monster.EntityGuardian类的典型用法代码示例。如果您正苦于以下问题:Java EntityGuardian类的具体用法?Java EntityGuardian怎么用?Java EntityGuardian使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityGuardian类属于net.minecraft.entity.monster包,在下文中一共展示了EntityGuardian类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: func_175817_a
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
protected boolean func_175817_a(World worldIn, StructureBoundingBox p_175817_2_, int p_175817_3_, int p_175817_4_, int p_175817_5_)
{
int i = this.getXWithOffset(p_175817_3_, p_175817_5_);
int j = this.getYWithOffset(p_175817_4_);
int k = this.getZWithOffset(p_175817_3_, p_175817_5_);
if (p_175817_2_.isVecInside(new BlockPos(i, j, k)))
{
EntityGuardian entityguardian = new EntityGuardian(worldIn);
entityguardian.setElder(true);
entityguardian.heal(entityguardian.getMaxHealth());
entityguardian.setLocationAndAngles((double)i + 0.5D, (double)j, (double)k + 0.5D, 0.0F, 0.0F);
entityguardian.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityguardian)), (IEntityLivingData)null);
worldIn.spawnEntityInWorld(entityguardian);
return true;
}
else
{
return false;
}
}
示例2: handleEntityStatus
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
* Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
* MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
* (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
* particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
*/
public void handleEntityStatus(S19PacketEntityStatus packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null)
{
if (packetIn.getOpCode() == 21)
{
this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity));
}
else
{
entity.handleStatusUpdate(packetIn.getOpCode());
}
}
}
示例3: checkSetTarget
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的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);
}
}
示例4: spawnElder
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
protected boolean spawnElder(World worldIn, StructureBoundingBox p_175817_2_, int p_175817_3_, int p_175817_4_, int p_175817_5_)
{
int i = this.getXWithOffset(p_175817_3_, p_175817_5_);
int j = this.getYWithOffset(p_175817_4_);
int k = this.getZWithOffset(p_175817_3_, p_175817_5_);
if (p_175817_2_.isVecInside(new BlockPos(i, j, k)))
{
EntityGuardian entityguardian = new EntityGuardian(worldIn);
entityguardian.setElder(true);
entityguardian.heal(entityguardian.getMaxHealth());
entityguardian.setLocationAndAngles((double)i + 0.5D, (double)j, (double)k + 0.5D, 0.0F, 0.0F);
entityguardian.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityguardian)), (IEntityLivingData)null);
worldIn.spawnEntityInWorld(entityguardian);
return true;
}
else
{
return false;
}
}
示例5: handleEntityStatus
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
* Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
* MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
* (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
* particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
*/
public void handleEntityStatus(SPacketEntityStatus packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null)
{
if (packetIn.getOpCode() == 21)
{
this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity));
}
else
{
entity.handleStatusUpdate(packetIn.getOpCode());
}
}
}
示例6: onRenderFog
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
@SubscribeEvent
public void onRenderFog(EntityViewRenderEvent.FogDensity event) {
if (event.getEntity() instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) event.getEntity();
PossessivePlayer possessivePlayer = PossessHandler.get(player);
if (possessivePlayer != null && (possessivePlayer.getPossessing().canBreatheUnderwater() || possessivePlayer.getPossessing() instanceof EntityGuardian)) {
if (ActiveRenderInfo.getBlockStateAtEntityViewpoint(ClientEventHandler.MINECRAFT.theWorld, player, (float) event.getRenderPartialTicks()).getMaterial() != Material.WATER) {
GlStateManager.setFog(GlStateManager.FogMode.EXP);
event.setDensity(0.125F);
event.setCanceled(true);
} else {
GlStateManager.setFog(GlStateManager.FogMode.EXP);
event.setDensity(0.02F);
event.setCanceled(true);
}
}
}
}
示例7: matches
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
@Override
protected boolean matches(EntityLivingBase entity) {
if (type == BOSS) return !entity.isNonBoss();
else if (!entity.isNonBoss()) return false;
switch (type) {
case ANIMAL: return entity instanceof EntityAnimal;
case MONSTER: return entity instanceof IMob;
case TAMEABLE: return entity instanceof IEntityOwnable;
case PLAYER: return entity instanceof EntityPlayer;
case WATER: return entity instanceof EntityWaterMob || entity instanceof EntityGuardian;
case NPC: return entity instanceof INpc;
case GOLEM: return entity instanceof EntityGolem;
default: return false;
}
}
示例8: onUpdate
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
* Called to update the entity's position/logic.
*/
public void onUpdate()
{
super.onUpdate();
if (this.entity == null)
{
EntityGuardian entityguardian = new EntityGuardian(this.worldObj);
entityguardian.setElder();
this.entity = entityguardian;
}
}
示例9: shouldRender
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ)
{
if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
{
return true;
}
else
{
if (livingEntity.hasTargetedEntity())
{
EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity();
if (entitylivingbase != null)
{
Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F);
Vec3 vec31 = this.func_177110_a(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F);
if (camera.isBoundingBoxInFrustum(AxisAlignedBB.fromBounds(vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord, vec3.zCoord)))
{
return true;
}
}
}
return false;
}
}
示例10: preRenderCallback
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
* Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
* entityLiving, partialTickTime
*/
protected void preRenderCallback(EntityGuardian entitylivingbaseIn, float partialTickTime)
{
if (entitylivingbaseIn.isElder())
{
GlStateManager.scale(2.35F, 2.35F, 2.35F);
}
}
示例11: GuardianSound
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
public GuardianSound(EntityGuardian guardian)
{
super(new ResourceLocation("minecraft:mob.guardian.attack"));
this.guardian = guardian;
this.attenuationType = ISound.AttenuationType.NONE;
this.repeat = true;
this.repeatDelay = 0;
}
示例12: shouldRender
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ)
{
if (super.shouldRender((EntityLiving)livingEntity, camera, camX, camY, camZ))
{
return true;
}
else
{
if (livingEntity.hasTargetedEntity())
{
EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity();
if (entitylivingbase != null)
{
Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F);
Vec3 vec31 = this.func_177110_a(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F);
if (camera.isBoundingBoxInFrustum(AxisAlignedBB.fromBounds(vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord, vec3.zCoord)))
{
return true;
}
}
}
return false;
}
}
示例13: handleEntityStatus
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
* Invokes the entities' handleUpdateHealth method which is implemented in
* LivingBase (hurt/death), MinecartMobSpawner (spawn delay), FireworkRocket &
* MinecartTNT (explosion), IronGolem (throwing,...), Witch (spawn particles),
* Zombie (villager transformation), Animal (breeding mode particles), Horse
* (breeding/smoke particles), Sheep (...), Tameable (...), Villager (particles
* for breeding mode, angry and happy), Wolf (...)
*/
public void handleEntityStatus(S19PacketEntityStatus packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null) {
if (packetIn.getOpCode() == 21) {
this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian) entity));
} else {
entity.handleStatusUpdate(packetIn.getOpCode());
}
}
}
示例14: handleEntityStatus
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
* Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
* MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
* (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
* particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
*/
public void handleEntityStatus(SPacketEntityStatus packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null)
{
if (packetIn.getOpCode() == 21)
{
this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity));
}
else if (packetIn.getOpCode() == 35)
{
int i = 40;
this.gameController.effectRenderer.func_191271_a(entity, EnumParticleTypes.TOTEM, 30);
this.clientWorldController.playSound(entity.posX, entity.posY, entity.posZ, SoundEvents.field_191263_gW, entity.getSoundCategory(), 1.0F, 1.0F, false);
if (entity == this.gameController.player)
{
this.gameController.entityRenderer.func_190565_a(new ItemStack(Items.field_190929_cY));
}
}
else
{
entity.handleStatusUpdate(packetIn.getOpCode());
}
}
}
示例15: handleEntityStatus
import net.minecraft.entity.monster.EntityGuardian; //导入依赖的package包/类
/**
* Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
* MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
* (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
* particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
*/
public void handleEntityStatus(SPacketEntityStatus packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null)
{
if (packetIn.getOpCode() == 21)
{
this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity));
}
else if (packetIn.getOpCode() == 35)
{
int i = 40;
this.gameController.effectRenderer.func_191271_a(entity, EnumParticleTypes.TOTEM, 30);
this.clientWorldController.playSound(entity.posX, entity.posY, entity.posZ, SoundEvents.field_191263_gW, entity.getSoundCategory(), 1.0F, 1.0F, false);
if (entity == this.gameController.player)
{
if (!Hacks.findMod(AntiTotemAnimation.class).isEnabled()) {
this.gameController.entityRenderer.func_190565_a(new ItemStack(Items.field_190929_cY));
}
}
}
else
{
entity.handleStatusUpdate(packetIn.getOpCode());
}
}
}