Add llamas and parrots to the cocoon's rare animal spawns

Llamas were added in 1.11, while parrots were added in 1.12.
Both of them are an exotic pet and so should be available from
the cocoon.
This commit is contained in:
Hubry committed 2018-08-26 23:52:13 +02:00
1 parent c3a7cc5c27
commit 94721a0149
1 file changed
+9 -1
@@ -16,8 +16,10 @@ import net.minecraft.entity.monster.EntityShulker;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntityLlama;
import net.minecraft.entity.passive.EntityMooshroom;
import net.minecraft.entity.passive.EntityOcelot;
import net.minecraft.entity.passive.EntityParrot;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntityRabbit;
import net.minecraft.entity.passive.EntitySheep;
@@ -66,7 +68,7 @@ public class TileCocoon extends TileMod implements ITickable{
} else {
float specialChance = 0.05F;
if(Math.random() < specialChance) {
int entityType = world.rand.nextInt(3);
int entityType = world.rand.nextInt(5);
switch(entityType) {
case 0:
entity = new EntityHorse(world);
@@ -77,6 +79,12 @@ public class TileCocoon extends TileMod implements ITickable{
case 2:
entity = new EntityOcelot(world);
break;
case 3:
entity = new EntityParrot(world);
break;
case 4:
entity = new EntityLlama(world);
break;
}
} else {
int entityType = world.rand.nextInt(5);