當前位置: 首頁>>代碼示例>>Java>>正文


Java EntitySlime類代碼示例

本文整理匯總了Java中net.minecraft.entity.monster.EntitySlime的典型用法代碼示例。如果您正苦於以下問題:Java EntitySlime類的具體用法?Java EntitySlime怎麽用?Java EntitySlime使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


EntitySlime類屬於net.minecraft.entity.monster包,在下文中一共展示了EntitySlime類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addInfo

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
@Override
public void addInfo(Entity entity, List<String> curInfo) {
    switch (((EntitySlime) entity).getSlimeSize()) {
        case 1:
            curInfo.add("Size: Tiny");
            return;
        case 2:
            curInfo.add("Size: Small");
            return;
        case 4:
            curInfo.add("Size: Big");
            return;
        default:
            curInfo.add("Size: " + ((EntitySlime) entity).getSlimeSize());
            return;
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:18,代碼來源:EntityTrackHandler.java

示例2: initializeEntityActivationType

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
/**
 * Initializes an entities type on construction to specify what group this
 * entity is in for activation ranges.
 *
 * @param entity
 * @return group id
 */
public static byte initializeEntityActivationType(Entity entity)
{
    Chunk chunk = null;
    // Cauldron start - account for entities that dont extend EntityMob, EntityAmbientCreature, EntityCreature
    if ( entity instanceof EntityMob || entity instanceof EntitySlime || entity.isCreatureType(EnumCreatureType.monster, false)) // Cauldron - account for entities that dont extend EntityMob
    {
        return 1; // Monster
    } else if ( entity instanceof EntityCreature || entity instanceof EntityAmbientCreature || entity.isCreatureType(EnumCreatureType.creature, false) 
             || entity.isCreatureType(EnumCreatureType.waterCreature, false) || entity.isCreatureType(EnumCreatureType.ambient, false))
    {
        return 2; // Animal
    // Cauldron end
    } else
    {
        return 3; // Misc
    }
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:25,代碼來源:ActivationRange.java

示例3: BiomeGenSwamp

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
protected BiomeGenSwamp(int p_i1988_1_)
{
    super(p_i1988_1_);
    this.theBiomeDecorator.treesPerChunk = 2;
    this.theBiomeDecorator.flowersPerChunk = 1;
    this.theBiomeDecorator.deadBushPerChunk = 1;
    this.theBiomeDecorator.mushroomsPerChunk = 8;
    this.theBiomeDecorator.reedsPerChunk = 10;
    this.theBiomeDecorator.clayPerChunk = 1;
    this.theBiomeDecorator.waterlilyPerChunk = 4;
    this.theBiomeDecorator.sandPerChunk2 = 0;
    this.theBiomeDecorator.sandPerChunk = 0;
    this.theBiomeDecorator.grassPerChunk = 5;
    this.waterColorMultiplier = 14745518;
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 1, 1, 1));
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:17,代碼來源:BiomeGenSwamp.java

示例4: getEntityColor

import net.minecraft.entity.monster.EntitySlime; //導入依賴的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;
}
 
開發者ID:Moudoux,項目名稱:EMC,代碼行數:22,代碼來源:IEntity.java

示例5: initialize

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
public static void initialize()
{
    inLove = ReflectionHelper.findField(EntityAnimal.class, "field_70881_d", "inLove");

    //Standard
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntityCow(world)),100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntitySheep(world)),100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntityPig(world)),100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntityChicken(world)),50)); //Lower chance for egg hatching animal

    //Parent species
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,mother.createChild(mother)),100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,father.createChild(father)),100));

    //Abominations
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world,pos,new EntitySilverfish(world)),200));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world,pos,new EntityCaveSpider(world)),100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world,pos,new EntitySlime(world)),50));

    //Enviroment dependent
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world,pos,new EntitySquid(world)),0).setCustomWeight(AnimalCrossbreedHandler::getSquidWeight));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntityWolf(world)),0).setCustomWeight(AnimalCrossbreedHandler::getWolfWeight));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world,pos,new EntityOcelot(world)),0).setCustomWeight(AnimalCrossbreedHandler::getOcelotWeight));
}
 
開發者ID:DaedalusGame,項目名稱:BetterWithAddons,代碼行數:25,代碼來源:AnimalCrossbreedHandler.java

示例6: determineRelation

import net.minecraft.entity.monster.EntitySlime; //導入依賴的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;
	}
}
 
開發者ID:ToroCraft,項目名稱:ToroHealth,代碼行數:18,代碼來源:AbstractHealthDisplay.java

示例7: makeMobRebornTransition

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
private void makeMobRebornTransition(LivingDropsEvent event) {
	if (ConfigValues.ALLOWBOSSES) {
		if (event.getEntityLiving() instanceof EntityWither || event.getEntityLiving() instanceof EntityDragon) {
			makeMobReborn(event);
			return;
		}
	} else if (event.getEntityLiving() instanceof EntityWither || event.getEntityLiving() instanceof EntityDragon)
		return;
	if (ConfigValues.ALLOWSLIMES) {
		if (event.getEntityLiving() instanceof EntitySlime) {
			makeMobReborn(event);
			return;
		}
	} else if (event.getEntityLiving() instanceof EntitySlime)
		return;
	if (ConfigValues.VANILLAONLY) {
		if (isVanilla(event.getEntityLiving())) {
			makeMobReborn(event);
		}
	} else {
		makeMobReborn(event);
	}
}
 
開發者ID:The-Fireplace-Minecraft-Mods,項目名稱:Mob-Rebirth,代碼行數:24,代碼來源:CommonEvents.java

示例8: checkSpawn

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
@SubscribeEvent
public void checkSpawn (EntityJoinWorldEvent event) {

    if (event.getEntity() instanceof EntitySlime && !event.getEntity().hasCustomName()) {

        for (final TileEntity tile : event.getWorld().loadedTileEntityList) {

            if (tile instanceof TileEntityAntiSlime && ((TileEntityAntiSlime) tile).shareChunks((EntityLivingBase) event.getEntity())) {

                if (event.getWorld().isBlockPowered(tile.getPos())) {
                    continue;
                }

                event.setCanceled(true);
                event.getEntity().setDead();
                break;
            }
        }
    }
}
 
開發者ID:Darkhax-Minecraft,項目名稱:Dark-Utilities,代碼行數:21,代碼來源:FeatureAntiSlime.java

示例9: shouldExecute

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
@Override
public boolean shouldExecute()
{
    if (slime.getSlimeSize() >= BIG_SLIME)
        return false;
    if (slime.ticksExisted < AGE_LIMIT)
        return false;
    if (rand.nextFloat() > 0.5)
        return false;
    List<EntitySlime> list = slime.world
            .getEntitiesWithinAABB(EntitySlime.class,
                    slime.getEntityBoundingBox().grow(slime.getSlimeSize()*1.5, slime.getSlimeSize(), slime.getSlimeSize()*1.5),
                    (other) -> other != slime
                            && other.isEntityAlive()
                            && other.getClass() == slime.getClass()
                            && other.ticksExisted > AGE_LIMIT
                            && other.getSlimeSize() == slime.getSlimeSize());
    return (list.size() >= 3);
}
 
開發者ID:gigaherz,項目名稱:Survivalist,代碼行數:20,代碼來源:SlimeMerger.java

示例10: EntityAIFindOtherSlimeNearest

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
public EntityAIFindOtherSlimeNearest(final EntitySlime mobIn)
{
    super(mobIn, EntitySlime.class);
    this.slime = mobIn;
    Predicate<EntityLivingBase> predicate = entity -> {
        double range = EntityAIFindOtherSlimeNearest.this.getFollowRange();
        return entity != null
                && entity != mobIn
                && entity.getClass() == mobIn.getClass()
                && entity.ticksExisted > AGE_LIMIT
                && !entity.isInvisible()
                && entity.getDistance(mobIn) <= range
                && ((EntitySlime) entity).getSlimeSize() == mobIn.getSlimeSize()
                && EntityAITarget.isSuitableTarget(mobIn, entity, false, true);
    };

    try
    {
        predicateField.set(this, predicate);
    }
    catch (IllegalAccessException e)
    {
        throw new ReportedException(new CrashReport("Could not set private field '" + predicateField.getName() + "'", e));
    }
}
 
開發者ID:gigaherz,項目名稱:Survivalist,代碼行數:26,代碼來源:SlimeMerger.java

示例11: initializeEntityActivationType

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
/**
 * Initializes an entities type on construction to specify what group this
 * entity is in for activation ranges.
 *
 * @param entity
 * @return group id
 */
public static byte initializeEntityActivationType(Entity entity)
{
    Chunk chunk = null;
    // Cauldron start - account for entities that dont extend EntityMob, EntityAmbientCreature, EntityCreature
    if ( entity.getClass().equals(EntityMob.class) || entity.getClass().equals(EntitySlime.class) || entity.isCreatureType(EnumCreatureType.monster, false)) // Cauldron - account for entities that dont extend EntityMob
    {
        return 1; // Monster
    } else if ( entity.getClass().equals(EntityCreature.class) || entity.getClass().equals(EntityAmbientCreature.class) || entity.isCreatureType(EnumCreatureType.creature, false) 
             || entity.isCreatureType(EnumCreatureType.waterCreature, false) || entity.isCreatureType(EnumCreatureType.ambient, false))
    {
        return 2; // Animal
    // Cauldron end
    } else
    {
        return 3; // Misc
    }
}
 
開發者ID:Bogdan-G,項目名稱:FFoKC,代碼行數:25,代碼來源:ActivationRange.java

示例12: BiomeGenSwamp

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
protected BiomeGenSwamp(int par1)
{
    super(par1);
    this.theBiomeDecorator.treesPerChunk = 2;
    this.theBiomeDecorator.flowersPerChunk = 1;
    this.theBiomeDecorator.deadBushPerChunk = 1;
    this.theBiomeDecorator.mushroomsPerChunk = 8;
    this.theBiomeDecorator.reedsPerChunk = 10;
    this.theBiomeDecorator.clayPerChunk = 1;
    this.theBiomeDecorator.waterlilyPerChunk = 4;
    this.theBiomeDecorator.sandPerChunk2 = 0;
    this.theBiomeDecorator.sandPerChunk = 0;
    this.theBiomeDecorator.grassPerChunk = 5;
    this.waterColorMultiplier = 14745518;
    this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 1, 1, 1));
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:17,代碼來源:BiomeGenSwamp.java

示例13: shouldRenderPass

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
/**
 * Queries whether should render the specified pass or not.
 */
protected int shouldRenderPass(EntitySlime par1EntitySlime, int par2, float par3)
{
    if (par1EntitySlime.isInvisible())
    {
        return 0;
    }
    else if (par2 == 0)
    {
        this.setRenderPassModel(this.scaleAmount);
        GL11.glEnable(GL11.GL_NORMALIZE);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        return 1;
    }
    else
    {
        if (par2 == 1)
        {
            GL11.glDisable(GL11.GL_BLEND);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        }

        return -1;
    }
}
 
開發者ID:MinecraftModdedClients,項目名稱:Resilience-Client-Source,代碼行數:29,代碼來源:RenderSlime.java

示例14: BiomeGenDeepSwamp

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
public BiomeGenDeepSwamp(int biomeId, boolean register) {
	super(biomeId,register);
	this.biomeName="DeepSwamp";
	rootHeight=-0.1f;
	heightVariation=0.2f;
	rainfall = 0.9f;
	temperature = 0.9f;
	this.theBiomeDecorator.treesPerChunk = 10;
       this.theBiomeDecorator.flowersPerChunk = 1;
       this.theBiomeDecorator.deadBushPerChunk = 1;
       this.theBiomeDecorator.mushroomsPerChunk = 8;
       this.theBiomeDecorator.reedsPerChunk = 10;
       this.theBiomeDecorator.clayPerChunk = 1;
       this.theBiomeDecorator.waterlilyPerChunk = 4;
       this.theBiomeDecorator.sandPerChunk2 = 0;
       this.theBiomeDecorator.sandPerChunk = 0;
       this.theBiomeDecorator.grassPerChunk = 5;
       this.waterColorMultiplier = 14745518;
       this.spawnableMonsterList.add(new BiomeGenBase.SpawnListEntry(EntitySlime.class, 1, 1, 1));
       this.flowers.clear();
       this.addFlower(Blocks.red_flower, 1, 10);
	swampTree = new WorldGenSwampTree(2);
}
 
開發者ID:zmaster587,項目名稱:AdvancedRocketry,代碼行數:24,代碼來源:BiomeGenDeepSwamp.java

示例15: shouldRenderPass

import net.minecraft.entity.monster.EntitySlime; //導入依賴的package包/類
/**
 * Queries whether should render the specified pass or not.
 */
protected int shouldRenderPass(EntitySlime slime, int p_77032_2_, float p_77032_3_)
{
    if (slime.isInvisible())
    {
        return 0;
    }
    else if (p_77032_2_ == 0)
    {
        this.setRenderPassModel(this.scaleAmount);
        GL11.glEnable(GL11.GL_NORMALIZE);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        return 1;
    }
    else
    {
        if (p_77032_2_ == 1)
        {
            GL11.glDisable(GL11.GL_BLEND);
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        }

        return -1;
    }
}
 
開發者ID:SpitefulFox,項目名稱:RidiculousWorld,代碼行數:29,代碼來源:RenderShadowSlime.java


注:本文中的net.minecraft.entity.monster.EntitySlime類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。