本文整理匯總了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;
}
}
示例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
}
}
示例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));
}
示例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;
}
示例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));
}
示例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;
}
}
示例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);
}
}
示例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;
}
}
}
}
示例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);
}
示例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));
}
}
示例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
}
}
示例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));
}
示例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;
}
}
示例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);
}
示例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;
}
}