use of net.minecraft.entity.passive.EntityRabbit in project SilentGems by SilentChaos512.
the class GemsCommonEvents method onLivingUpdate.
@SubscribeEvent
public void onLivingUpdate(LivingUpdateEvent event) {
if (!event.getEntity().world.isRemote && event.getEntityLiving() instanceof EntityRabbit) {
EntityRabbit rabbit = (EntityRabbit) event.getEntityLiving();
ModuleCoffee.tickRabbit(rabbit);
}
}
use of net.minecraft.entity.passive.EntityRabbit 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.EntityRabbit in project Minestuck by mraof.
the class RabbitSpawner method generate.
@Override
public BlockPos generate(World world, Random random, BlockPos pos, ChunkProviderLands provider) {
pos = world.getTopSolidOrLiquidBlock(pos);
if (!world.getBlockState(pos).getMaterial().isLiquid() && !provider.isPositionInSpawn(pos.getX(), pos.getZ())) {
EntityRabbit entity = new EntityRabbit(world);
entity.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
entity.onInitialSpawn(null, null);
world.spawnEntity(entity);
}
return null;
}
Aggregations