| 1 | package net.minecraft.entity;
|
| 2 |
|
| 3 | import net.minecraft.block.material.Material;
|
| 4 | import net.minecraft.entity.monster.IMob;
|
| 5 | import net.minecraft.entity.passive.EntityAmbientCreature;
|
| 6 | import net.minecraft.entity.passive.EntityAnimal;
|
| 7 | import net.minecraft.entity.passive.EntityWaterMob;
|
| 8 | import net.minecraft.entity.passive.IAnimals;
|
| 9 |
|
| 10 | public enum EnumCreatureType
|
| 11 | {
|
| 12 | MONSTER(IMob.class, 70, Material.air, false, false),
|
| 13 | CREATURE(EntityAnimal.class, 10, Material.air, true, true),
|
| 14 | AMBIENT(EntityAmbientCreature.class, 15, Material.air, true, false),
|
| 15 | WATER_CREATURE(EntityWaterMob.class, 5, Material.water, true, false);
|
| 16 |
|
| 17 | private final Class <? extends IAnimals > creatureClass;
|
| 18 | private final int maxNumberOfCreature;
|
| 19 | private final Material creatureMaterial;
|
| 20 |
|
| 21 | /** A flag indicating whether this creature type is peaceful. */
|
| 22 | private final boolean isPeacefulCreature;
|
| 23 |
|
| 24 | /** Whether this creature type is an animal. */
|
| 25 | private final boolean isAnimal;
|
| 26 |
|
| 27 | private EnumCreatureType(Class <? extends IAnimals > creatureClassIn, int maxNumberOfCreatureIn, Material creatureMaterialIn, boolean isPeacefulCreatureIn, boolean isAnimalIn)
|
| 28 | {
|
| 29 | this.creatureClass = creatureClassIn;
|
| 30 | this.maxNumberOfCreature = maxNumberOfCreatureIn;
|
| 31 | this.creatureMaterial = creatureMaterialIn;
|
| 32 | this.isPeacefulCreature = isPeacefulCreatureIn;
|
| 33 | this.isAnimal = isAnimalIn;
|
| 34 | }
|
| 35 |
|
| 36 | public Class <? extends IAnimals > getCreatureClass()
|
| 37 | {
|
| 38 | return this.creatureClass;
|
| 39 | }
|
| 40 |
|
| 41 | public int getMaxNumberOfCreature()
|
| 42 | {
|
| 43 | return this.maxNumberOfCreature;
|
| 44 | }
|
| 45 |
|
| 46 | /**
|
| 47 | * Gets whether or not this creature type is peaceful.
|
| 48 | */
|
| 49 | public boolean getPeacefulCreature()
|
| 50 | {
|
| 51 | return this.isPeacefulCreature;
|
| 52 | }
|
| 53 |
|
| 54 | /**
|
| 55 | * Return whether this creature type is an animal.
|
| 56 | */
|
| 57 | public boolean getAnimal()
|
| 58 | {
|
| 59 | return this.isAnimal;
|
| 60 | }
|
| 61 | }
|
| 62 |
|