本文整理匯總了Java中net.minecraft.entity.passive.EntitySquid類的典型用法代碼示例。如果您正苦於以下問題:Java EntitySquid類的具體用法?Java EntitySquid怎麽用?Java EntitySquid使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EntitySquid類屬於net.minecraft.entity.passive包,在下文中一共展示了EntitySquid類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: checkValidity
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
private boolean checkValidity(final EntityLivingBase entity) {
if (entity == this.mc.thePlayer) {
return false;
}
if (!entity.isEntityAlive()) {
return false;
}
if (this.mc.thePlayer.getDistanceToEntity(entity) > this.range) {
return false;
}
if (!(entity instanceof EntityPlayer)) {
return (this.monsters && entity instanceof EntityMob) || (this.animals && (entity instanceof EntityAnimal || entity instanceof EntitySquid)) || (this.bats && entity instanceof EntityBat);
}
if (this.players) {
final EntityPlayer player = (EntityPlayer)entity;
return (this.friend && FriendManager.isFriend(player.getName())) || (!FriendManager.isFriend(player.getName()) && (!this.noArmor || this.hasArmor(player)));
}
return false;
}
示例2: getEntityColor
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
public Color getEntityColor() {
if ((entity instanceof EntityAnimal)) {
return Color.white;
}
if ((entity instanceof EntityMob)) {
return Color.red;
}
if ((entity instanceof EntitySlime)) {
return Color.green;
}
if ((entity instanceof EntityVillager)) {
return new Color(245, 245, 220);
}
if ((entity instanceof EntityBat)) {
return Color.BLACK;
}
if ((entity instanceof EntitySquid)) {
return Color.PINK;
}
return Color.white;
}
示例3: isValidTarget
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
private boolean isValidTarget(Entity e)
{
if (e == null) return false;
else if (e instanceof EntityPlayer)
{
EntityPlayer p = ((EntityPlayer) e);
if (p.capabilities.isCreativeMode) return false;
else
{
if (kPlayers) return true;
else if (!kTeam) return false;
RivalRebelsPlayer rrp = RivalRebels.round.rrplayerlist.getForName(((EntityPlayer) e).getCommandSenderName());
if (rrp == null) return kTeam;
if (rrp.rrteam == RivalRebelsTeam.NONE) return !p.getCommandSenderName().equals(username);
if (rrp.rrteam != team) return kTeam;
else return false;
}
}
else return (kMobs && (e instanceof EntityRhodes || (e instanceof EntityMob && !(e instanceof EntityAnimal) && !(e instanceof EntityBat) && !(e instanceof EntityVillager) && !(e instanceof EntitySquid)) || e instanceof EntityGhast));
}
示例4: determineRelation
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
protected Relation determineRelation() {
if (entity instanceof EntityMob) {
return Relation.FOE;
} else if (entity instanceof EntitySlime) {
return Relation.FOE;
} else if (entity instanceof EntityGhast) {
return Relation.FOE;
} else if (entity instanceof EntityAnimal) {
return Relation.FRIEND;
} else if (entity instanceof EntitySquid) {
return Relation.FRIEND;
} else if (entity instanceof EntityAmbientCreature) {
return Relation.FRIEND;
} else {
return Relation.UNKNOWN;
}
}
示例5: BiomeDarkOcean
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
public BiomeDarkOcean(int biomeID)
{
super(biomeID);
setColor(0x000014);
topBlock = TDEBlocks.dark_grass;
fillerBlock = TDEBlocks.dark_dirt;
waterColorMultiplier = 0x000014;
setHeight(height_Oceans);
spawnableCreatureList.clear();
spawnableMonsterList.clear();
spawnableWaterCreatureList.clear();
spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4));
}
示例6: onDeath
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
@SubscribeEvent
public void onDeath(LivingDeathEvent event) {
if (!event.entityLiving.worldObj.isRemote) {
EntityLivingBase entity = event.entityLiving;
if (entity instanceof EntityBat) {
if (((EntityBat) entity).worldObj.rand.nextInt(100) < 80) {
EntityItem batWing = new EntityItem(((EntityBat) entity).worldObj, ((EntityBat) entity).posX, ((EntityBat) entity).posY, ((EntityBat) entity).posZ, new ItemStack(ModItems.materials));
((EntityBat) entity).worldObj.spawnEntityInWorld(batWing);
}
} else if (entity instanceof EntitySquid) {
if (((EntitySquid) entity).worldObj.rand.nextInt(100) < 60) {
EntityItem tentacle = new EntityItem(((EntitySquid) entity).worldObj, ((EntitySquid) entity).posX, ((EntitySquid) entity).posY, ((EntitySquid) entity).posZ, new ItemStack(ModItems.materials, 1, 4));
((EntitySquid) entity).worldObj.spawnEntityInWorld(tentacle);
}
}
}
}
示例7: executeFullGrownEffect
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
@Override
public void executeFullGrownEffect(World world, int x, int y, int z, Random rand){
if(world.getBlockMetadata(x, y, z) == 14) {
int nearbyEntityCount = world.getEntitiesWithinAABB(EntitySquid.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(SPAWN_RANGE * 2, 4.0D, SPAWN_RANGE * 2)).size();
if(nearbyEntityCount < MAX_NEARBY_ENTITIES) {
EntitySquid squid = new EntitySquid(world);
double randXmotion = rand.nextDouble() - 0.5D;
double randYmotion = 1D;// rand.nextDouble();
double randZmotion = rand.nextDouble() - 0.5D;
squid.setLocationAndAngles(x + 0.5D, y + 0.5D, z + 0.5D, rand.nextFloat() * 360.0F, 0.0F);
squid.motionX = randXmotion;
squid.motionY = randYmotion;
squid.motionZ = randZmotion;
world.spawnEntityInWorld(squid);
squid.spawnExplosionParticle();
squid.playSound("mob.newsound.chickenplop", 0.2F, ((rand.nextFloat() - rand.nextFloat()) * 0.7F + 1.0F) * 2.0F);
world.setBlockMetadataWithNotify(x, y, z, 11, 3);
}
} else {
world.setBlockMetadataWithNotify(x, y, z, 14, 2);
world.scheduleBlockUpdate(x, y, z, this, 60);
}
}
示例8: entityDrops
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
@SubscribeEvent
public void entityDrops(LivingDropsEvent event) {
EntityLivingBase killedEnt = event.entityLiving;
DamageSource source = event.source;
boolean recentlyHit = event.recentlyHit;
if (recentlyHit) {
if (source.getEntity() instanceof EntityPlayer) {
if (killedEnt instanceof EntitySquid) {
event.drops.add(new EntityItem(killedEnt.worldObj, killedEnt.posX, killedEnt.posY, killedEnt.posZ,
new ItemStack(ModItems.squid, 1)));
}
if (killedEnt instanceof EntitySheep) {
if (killedEnt.isBurning()) {
event.drops.add(new EntityItem(killedEnt.worldObj, killedEnt.posX, killedEnt.posY, killedEnt.posZ,
new ItemStack(ModItems.lambCooked, 1)));
}
else {
event.drops.add(new EntityItem(killedEnt.worldObj, killedEnt.posX, killedEnt.posY, killedEnt.posZ,
new ItemStack(ModItems.lamb, 1)));
}
}
}
}
}
示例9: onEntityLivingDeath
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
@ForgeSubscribe
public void onEntityLivingDeath(LivingDeathEvent event)
{
if (!hasChecked)
{
dartcraftTrue = Loader.isModLoaded("dartCraft");
hasChecked = true;
}
if (!event.entity.worldObj.isRemote)
{
if (event.entityLiving instanceof EntitySquid && ConfigKeys.allowDropTentacles)
event.entityLiving.dropItem(ItemInfo.SQUID_TENTACLE_ID + 256, (int) (Math.random() * 4 + 1));
else if (event.entityLiving instanceof EntitySheep && ConfigKeys.allowDropMutton && !dartcraftTrue)
event.entityLiving.dropItem(ItemInfo.RAW_MUTTON_ID + 256, (int) (Math.random() * 2 + 1));
if (usedEssenceContainer)
{
((ItemEssenceContainer) stack.getItem()).setName(stack, entity);
usedEssenceContainer = false;
}
}
}
示例10: onEntitySpawn
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
@SubscribeEvent
public void onEntitySpawn(LivingSpawnEvent.CheckSpawn evt) {
if (evt.getResult() == Result.DENY) {
return;
}
if(Config.spawnGuardStopAllSlimesDebug && evt.getEntity() instanceof EntitySlime) {
evt.setResult(Result.DENY);
return;
}
if(Config.spawnGuardStopAllSquidSpawning && evt.getEntity().getClass() == EntitySquid.class) {
evt.setResult(Result.DENY);
return;
}
Map<BlockPos, ISpawnCallback> guards = getGuardsForWorld(evt.getWorld());
for (ISpawnCallback guard : guards.values()) {
ISpawnCallback.Result result = guard.isSpawnPrevented(evt.getEntityLiving());
if (result == ISpawnCallback.Result.DENY) {
evt.setResult(Result.DENY);
return;
} else if (result == ISpawnCallback.Result.DONE) {
return;
}
}
}
示例11: isPassive
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
/**
* Checks if the specified entity is a passive
*
* @param e The entity
* @return Whether or not the entity is a passive
*/
public static boolean isPassive(Entity e) {
if (e instanceof EntityPigZombie)
return !isAngry((EntityPigZombie) e);
if (e instanceof EntityIronGolem)
return !isAngry((EntityIronGolem) e);
if (e instanceof EntityPolarBear)
return !isAngry((EntityPolarBear) e);
if (e instanceof EntityAnimal)
return true;
if (e instanceof EntitySquid)
return true;
if (e instanceof EntityBat)
return true;
if (e instanceof EntityVillager)
return true;
if (e instanceof EntitySnowman)
return true;
return false;
}
示例12: BiomeGenBase
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
protected BiomeGenBase(int id)
{
this.minHeight = height_Default.rootHeight;
this.maxHeight = height_Default.variation;
this.temperature = 0.5F;
this.rainfall = 0.5F;
this.waterColorMultiplier = 16777215;
this.spawnableMonsterList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
this.spawnableCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
this.spawnableWaterCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
this.spawnableCaveCreatureList = Lists.<BiomeGenBase.SpawnListEntry>newArrayList();
this.enableRain = true;
this.worldGeneratorTrees = new WorldGenTrees(false);
this.worldGeneratorBigTree = new WorldGenBigTree(false);
this.worldGeneratorSwamp = new WorldGenSwamp();
this.biomeID = id;
biomeList[id] = this;
this.theBiomeDecorator = this.createBiomeDecorator();
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySheep.class, 12, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityRabbit.class, 10, 3, 3));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityPig.class, 10, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityChicken.class, 10, 4, 4));
this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityCow.class, 8, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySpider.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityZombie.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 100, 4, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntityWitch.class, 5, 1, 1));
this.spawnableWaterCreatureList.add(new BiomeGenBase.SpawnListEntry(EntitySquid.class, 10, 4, 4));
this.spawnableCaveCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityBat.class, 10, 8, 8));
}
示例13: rotateCorpse
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
protected void rotateCorpse(EntitySquid bat, float p_77043_2_, float p_77043_3_, float partialTicks)
{
float f = bat.prevSquidPitch + (bat.squidPitch - bat.prevSquidPitch) * partialTicks;
float f1 = bat.prevSquidYaw + (bat.squidYaw - bat.prevSquidYaw) * partialTicks;
GlStateManager.translate(0.0F, 0.5F, 0.0F);
GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(f1, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.0F, -1.2F, 0.0F);
}
示例14: Biome
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
protected Biome(Biome.BiomeProperties properties)
{
this.biomeName = properties.biomeName;
this.baseHeight = properties.baseHeight;
this.heightVariation = properties.heightVariation;
this.temperature = properties.temperature;
this.rainfall = properties.rainfall;
this.waterColor = properties.waterColor;
this.enableSnow = properties.enableSnow;
this.enableRain = properties.enableRain;
this.baseBiomeRegName = properties.baseBiomeRegName;
this.theBiomeDecorator = this.createBiomeDecorator();
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntitySheep.class, 12, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityPig.class, 10, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 10, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityCow.class, 8, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySpider.class, 100, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityZombie.class, 95, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityZombieVillager.class, 5, 1, 1));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySlime.class, 100, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityWitch.class, 5, 1, 1));
this.spawnableWaterCreatureList.add(new Biome.SpawnListEntry(EntitySquid.class, 10, 4, 4));
this.spawnableCaveCreatureList.add(new Biome.SpawnListEntry(EntityBat.class, 10, 8, 8));
}
示例15: rotateCorpse
import net.minecraft.entity.passive.EntitySquid; //導入依賴的package包/類
protected void rotateCorpse(EntitySquid entityLiving, float p_77043_2_, float p_77043_3_, float partialTicks)
{
float f = entityLiving.prevSquidPitch + (entityLiving.squidPitch - entityLiving.prevSquidPitch) * partialTicks;
float f1 = entityLiving.prevSquidYaw + (entityLiving.squidYaw - entityLiving.prevSquidYaw) * partialTicks;
GlStateManager.translate(0.0F, 0.5F, 0.0F);
GlStateManager.rotate(180.0F - p_77043_3_, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(f, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(f1, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(0.0F, -1.2F, 0.0F);
}