本文整理汇总了Java中net.minecraft.entity.monster.EntityCreeper类的典型用法代码示例。如果您正苦于以下问题:Java EntityCreeper类的具体用法?Java EntityCreeper怎么用?Java EntityCreeper使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EntityCreeper类属于net.minecraft.entity.monster包,在下文中一共展示了EntityCreeper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: shouldAttackEntity
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
{
if (p_142018_1_ instanceof EntityWolf)
{
EntityWolf entitywolf = (EntityWolf)p_142018_1_;
if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
{
return false;
}
}
return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse)p_142018_1_).isTame();
}
else
{
return false;
}
}
示例2: getColorMultiplier
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
/**
* Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime
*/
protected int getColorMultiplier(EntityCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
if ((int)(f * 10.0F) % 2 == 0)
{
return 0;
}
else
{
int i = (int)(f * 0.2F * 255.0F);
i = MathHelper.clamp_int(i, 0, 255);
return i << 24 | 16777215;
}
}
示例3: loadEntityShader
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
/**
* What shader to use when spectating this entity
*/
public void loadEntityShader(Entity entityIn)
{
if (OpenGlHelper.shadersSupported)
{
if (this.theShaderGroup != null)
{
this.theShaderGroup.deleteShaderGroup();
}
this.theShaderGroup = null;
if (entityIn instanceof EntityCreeper)
{
this.loadShader(new ResourceLocation("shaders/post/creeper.json"));
}
else if (entityIn instanceof EntitySpider)
{
this.loadShader(new ResourceLocation("shaders/post/spider.json"));
}
else if (entityIn instanceof EntityEnderman)
{
this.loadShader(new ResourceLocation("shaders/post/invert.json"));
}
}
}
示例4: loadEntityShader
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
/**
* What shader to use when spectating this entity
*/
public void loadEntityShader(Entity entityIn) {
if (OpenGlHelper.shadersSupported) {
if (this.theShaderGroup != null) {
this.theShaderGroup.deleteShaderGroup();
}
this.theShaderGroup = null;
if (entityIn instanceof EntityCreeper) {
this.loadShader(new ResourceLocation("shaders/post/creeper.json"));
} else if (entityIn instanceof EntitySpider) {
this.loadShader(new ResourceLocation("shaders/post/spider.json"));
} else if (entityIn instanceof EntityEnderman) {
this.loadShader(new ResourceLocation("shaders/post/invert.json"));
}
}
}
示例5: addEntitySpawns
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
/**
* Add spawning rules for the living mobs we want to be able to spawn naturally.
*/
public static void addEntitySpawns()
{
// get the list of biomes that creepers can spawn in, we'll use the same biomes for all of our mobs
Biome[] biomes = getBiomeList(EntityCreeper.class, EnumCreatureType.MONSTER);
// add the spawn rules to the entity registry
EntityRegistry.addSpawn(EntityJumpkin.class, 100, 4, 4, EnumCreatureType.MONSTER, biomes);
EntityRegistry.addSpawn(EntityZombieHands.class, 100, 4, 4, EnumCreatureType.MONSTER, biomes);
EntityRegistry.addSpawn(EntityHallowitch.class, 75, 4, 4, EnumCreatureType.MONSTER, biomes);
EntityRegistry.addSpawn(EntityCreeperween.class, 75, 4, 4, EnumCreatureType.MONSTER, biomes);
EntityRegistry.addSpawn(EntityHaunter.class, 5, 1, 1, EnumCreatureType.MONSTER, biomes);
EntityRegistry.addSpawn(EntityTreater.class, 50, 4, 4, EnumCreatureType.MONSTER, biomes);
}
示例6: shouldAttackEntity
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_) {
if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast)) {
if (p_142018_1_ instanceof EntityFrienderman) {
EntityFrienderman frienderman = (EntityFrienderman) p_142018_1_;
if (frienderman.isTamed() && frienderman.getOwner() == p_142018_2_) {
return false;
}
}
return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer) p_142018_2_).canAttackPlayer((EntityPlayer) p_142018_1_) ? false : !(p_142018_1_ instanceof EntityHorse) || !((EntityHorse) p_142018_1_).isTame();
}
else {
return false;
}
}
示例7: onUpdate
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected) {
if (stack.getItemDamage() != 20)
return;
if (!(entity instanceof EntityPlayer) || (entity instanceof FakePlayer))
return;
if (itemSlot < ((EntityPlayer)entity).inventory.getHotbarSize()) {
List<EntityLiving> entities = entity.worldObj.getEntitiesWithinAABB(EntityLiving.class, new AxisAlignedBB(entity.getPosition().add(-range, -range, -range), entity.getPosition().add(range, range, range)));
for (EntityLiving ent : entities) {
List<EntityAITaskEntry> entries = new ArrayList(ent.tasks.taskEntries);
entries.addAll(new ArrayList(ent.targetTasks.taskEntries));
for (EntityAITaskEntry entry : entries) {
if (entry.action instanceof EntityAIAttackRangedBow) {
makeSkellyShootSlower((EntityAIAttackRangedBow)entry.action);
}
}
if (ent instanceof EntityCreeper)
ReflectionHelper.setPrivateValue(EntityCreeper.class, (EntityCreeper)ent, 60, this.FUSETIME);
}
}
}
示例8: shouldAttackEntity
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
public boolean shouldAttackEntity(EntityLivingBase p_142018_1_, EntityLivingBase p_142018_2_)
{
if (!(p_142018_1_ instanceof EntityCreeper) && !(p_142018_1_ instanceof EntityGhast))
{
if (p_142018_1_ instanceof EntityWolf)
{
EntityWolf entitywolf = (EntityWolf)p_142018_1_;
if (entitywolf.isTamed() && entitywolf.getOwner() == p_142018_2_)
{
return false;
}
}
return p_142018_1_ instanceof EntityPlayer && p_142018_2_ instanceof EntityPlayer && !((EntityPlayer)p_142018_2_).canAttackPlayer((EntityPlayer)p_142018_1_) ? false : !(p_142018_1_ instanceof AbstractHorse) || !((AbstractHorse)p_142018_1_).isTame();
}
else
{
return false;
}
}
示例9: getColorMultiplier
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
/**
* Gets an RGBA int color multiplier to apply.
*/
protected int getColorMultiplier(EntityCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
if ((int)(f * 10.0F) % 2 == 0)
{
return 0;
}
else
{
int i = (int)(f * 0.2F * 255.0F);
i = MathHelper.clamp(i, 0, 255);
return i << 24 | 822083583;
}
}
示例10: getColorMultiplier
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
/**
* Gets an RGBA int color multiplier to apply.
*/
protected int getColorMultiplier(EntityCreeper entitylivingbaseIn, float lightBrightness, float partialTickTime)
{
float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
if ((int)(f * 10.0F) % 2 == 0)
{
return 0;
}
else
{
int i = (int)(f * 0.2F * 255.0F);
i = MathHelper.clamp_int(i, 0, 255);
return i << 24 | 822083583;
}
}
示例11: performEffect
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
@Override
public void performEffect(EntityLivingBase entity, int level) {
if(entity instanceof EntityCreeper)
{
//spawn firefly particles
return;
}
if (entity instanceof EntityPlayer) {
entity.resetActiveHand();
}
entity.attackEntityFrom(DamageSource.LIGHTNING_BOLT, 0.1f);
entity.heal(0.1f);
entity.motionX = 0;
entity.motionY = 0;
entity.motionZ = 0;
}
示例12: compare
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
@Override
public int compare(Entity p_compare_1_, Entity p_compare_2_) {
double compareDistance1 = this.theEntity.getDistanceSqToEntity(p_compare_1_);
double compareDistance2 = this.theEntity.getDistanceSqToEntity(p_compare_2_);
boolean b0 = false;
boolean b1i = true;
if (!ConfigValues.HUNTCREEPERS && p_compare_1_ instanceof EntityCreeper)
b0 = true;
if (!ConfigValues.HUNTCREEPERS && p_compare_2_ instanceof EntityCreeper)
b1i = false;
if (!b0 && b1i) {
return Double.compare(compareDistance1, compareDistance2);
} else if (b0 && b1i) {
return 1;
} else if (!b0) {
return -1;
} else {
return 0;
}
}
示例13: addMovementTasks
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
/**
* Register your movement tasks here.
*/
public void addMovementTasks() {
switch (dataManager.get(MOVEMENT_MODE)) {
case 1:
if (!ConfigValues.HUNTCREEPERS)
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityCreeper.class, 10.0F, 1.2D, 1.6D));
this.tasks.addTask(4, new EntityAIOpenDoor(this, getAttackMode() != 2));
this.tasks.addTask(6, new EntityAIFollowMaster(this, 1.0D, 10.0F, 2.0F));
case 0:
this.detachHome();
break;
case 2:
default:
this.setHomePosAndDistance(new BlockPos(this.posX, this.posY, this.posZ), 20);
this.tasks.addTask(2, new EntityAIRestrictSun(this));
this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D));
if (!ConfigValues.HUNTCREEPERS)
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityCreeper.class, 10.0F, 1.2D, 1.6D));
this.tasks.addTask(4, new EntityAIOpenDoor(this, getAttackMode() != 2));
this.tasks.addTask(7, new EntityAIWanderBase(this, 1.0D));
}
}
示例14: shouldAttackEntity
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
public boolean shouldAttackEntity(EntityLivingBase target){
EntityLivingBase owner = getOwner();
if (ConfigValues.HUNTCREEPERS || !(target instanceof EntityCreeper)) {
if (target instanceof EntityWolf) {
EntityWolf entitywolf = (EntityWolf) target;
if (entitywolf.isTamed() && entitywolf.getOwner() == owner || Alliances.getInstance().isAlliedTo(entitywolf.getOwnerId(), getOwnerId()))
return false;
}
if (target instanceof EntityArmyMember)
if ((getAttackMode() < 2 && Enemies.getInstance().isNotEnemiesWith(((EntityArmyMember) target).getOwnerId(), getOwnerId())) || ((EntityArmyMember) target).getOwnerId().equals(getOwnerId()) || Alliances.getInstance().isAlliedTo(((EntityArmyMember) target).getOwnerId(), getOwnerId()))
return false;
return !(target instanceof EntityPlayer && owner instanceof EntityPlayer && !((EntityPlayer) owner).canAttackPlayer((EntityPlayer) target)) && (!(target instanceof EntityHorse) || !((EntityHorse) target).isTame());
} else
return false;
}
示例15: onDeath
import net.minecraft.entity.monster.EntityCreeper; //导入依赖的package包/类
@Override
public void onDeath(@Nonnull DamageSource cause) {
super.onDeath(cause);
Entity damageCause = cause.getTrueSource();
if (damageCause instanceof EntityCreeper && ((EntityCreeper) damageCause).getPowered() && !((EntityCreeper) damageCause).isAIDisabled()) {
((EntityCreeper) damageCause).incrementDroppedSkulls();
this.entityDropItem(new ItemStack(Items.SKULL), 0.0F);
}
if (!this.world.isRemote) {
for (int i = 0; i < equipInventory.getSizeInventory(); i++) {
if (!equipInventory.getStackInSlot(i).isEmpty()) {
EntityItem entityitem = new EntityItem(world, posX, posY, posZ, equipInventory.getStackInSlot(i));
entityitem.setDefaultPickupDelay();
world.spawnEntity(entityitem);
}
}
}
}