use of net.minecraft.entity.passive.EntityCow in project Bewitchment by Um-Mitternacht.
the class MycologicalCorruptionBrew method apply.
// Todo: Put Animania compat here, Animania replaces vanilla cows and mooshrooms
@Override
public void apply(World world, BlockPos pos, EntityLivingBase entity, int amplifier, int tick) {
if (entity instanceof EntityCow & !(entity instanceof EntityMooshroom)) {
EntityMooshroom mooshroom = new EntityMooshroom(world);
mooshroom.setPosition(pos.getX(), pos.getY(), pos.getZ());
entity.setDead();
world.spawnEntity(mooshroom);
}
}
use of net.minecraft.entity.passive.EntityCow in project ForestryMC by ForestryMC.
the class AlleleEffectFungification method doEntityEffect.
private void doEntityEffect(IBeeGenome genome, IBeeHousing housing) {
AxisAlignedBB aabb = this.getBounding(genome, housing, 1f);
World world = housing.getWorld();
List entities = world.getEntitiesWithinAABB(EntityCow.class, aabb);
for (Object entity : entities) {
if (entity instanceof EntityCow && !(entity instanceof EntityMooshroom)) {
convertCowToMooshroom((EntityCow) entity);
break;
}
}
}
use of net.minecraft.entity.passive.EntityCow in project Bewitchment by Um-Mitternacht.
the class GrassGrowBrew method apply.
// Todo: Put Animania compat here, Animania replaces vanilla cows and mooshrooms
@Override
public void apply(World world, BlockPos pos, EntityLivingBase entity, int amplifier, int tick) {
if (entity instanceof EntityMooshroom) {
EntityCow cow = new EntityCow(world);
cow.setPosition(pos.getX(), pos.getY(), pos.getZ());
entity.setDead();
world.spawnEntity(cow);
}
}
use of net.minecraft.entity.passive.EntityCow in project Almura by AlmuraDev.
the class MixinEntityAnimal method isCustomBreedingItem.
private boolean isCustomBreedingItem(ItemStack stack) {
final String itemName = stack.getTranslationKey();
// System.out.println("Breed Item: " + itemName);
final Entity animal = this;
if (animal instanceof EntityCow) {
switch(itemName.toUpperCase()) {
case "ITEM.ALMURA.FOOD.FOOD.CORN":
case "ITEM.ALMURA.FOOD.FOOD.SOYBEAN":
case "ITEM.ALMURA.NORMAL.CROP.ALFALFA_ITEM":
case "ITEM.WHEAT":
return true;
default:
return false;
}
}
if (animal instanceof EntityPig) {
switch(itemName.toUpperCase()) {
case "ITEM.ALMURA.FOOD.FOOD.CORN":
case "ITEM.ALMURA.FOOD.FOOD.SOYBEAN":
case "ITEM.CARROTS":
return true;
default:
return false;
}
}
if (animal instanceof EntitySheep) {
switch(itemName.toUpperCase()) {
case "ITEM.ALMURA.FOOD.FOOD.CORN":
case "ITEM.ALMURA.FOOD.FOOD.SOYBEAN":
case "ITEM.WHEAT":
return true;
default:
return false;
}
}
if (animal instanceof EntityChicken) {
switch(itemName.toUpperCase()) {
case "ITEM.ALMURA.FOOD.FOOD.CORN":
case "ITEM.ALMURA.FOOD.FOOD.SOYBEAN":
case "ITEM.SEEDS":
case "ITEM.SEEDS_MELON":
case "ITEM.BEETROOT_SEEDS":
case "ITEM.SEEDS_PUMPKIN":
return true;
default:
return false;
}
}
if (animal instanceof EntityOcelot) {
switch(itemName.toUpperCase()) {
case "ITEM.FISH":
return true;
default:
return false;
}
}
if (animal instanceof EntityWolf) {
return stack.getItem() instanceof ItemFood && ((ItemFood) stack.getItem()).isWolfsFavoriteMeat();
}
if (animal instanceof EntityRabbit) {
return this.isRabbitBreedingItem(stack.getItem());
}
return false;
}
use of net.minecraft.entity.passive.EntityCow in project minecolonies by Minecolonies.
the class EntityAIWorkCowboy method milkCows.
/**
* Makes the Cowboy "Milk" the cows (Honestly all he does is swap an empty
* bucket for a milk bucket, there's no actual "Milk" method in {@link EntityCow}
*
* @return The next {@link AIState}
*/
private AIState milkCows() {
worker.setLatestStatus(new TextComponentTranslation(TranslationConstants.COM_MINECOLONIES_COREMOD_STATUS_COWBOY_MILKING));
if (!worker.hasItemInInventory(getBreedingItem().getItem(), 0) && isInHut(new ItemStack(Items.BUCKET, 1))) {
if (!walkToBuilding() && getOwnBuilding() != null) {
isInTileEntity(getOwnBuilding().getTileEntity(), new ItemStack(Items.BUCKET, 1));
} else {
return HERDER_DECIDE;
}
}
final EntityCow cow = searchForAnimals().stream().findFirst().orElse(null);
if (cow == null) {
return HERDER_DECIDE;
}
if (!walkingToAnimal(cow) && equipItem(new ItemStack(Items.BUCKET, 1))) {
if (!worker.getInventoryCitizen().addItemStackToInventory(new ItemStack(Items.MILK_BUCKET))) {
worker.removeHeldItem();
equipItem(new ItemStack(Items.MILK_BUCKET));
InventoryUtils.removeStackFromItemHandler(new InvWrapper(worker.getInventoryCitizen()), new ItemStack(Items.BUCKET, 1));
}
incrementActionsDoneAndDecSaturation();
worker.addExperience(1.0);
}
return HERDER_DECIDE;
}
Aggregations