Search in sources :

Example 1 with ResourcefulBee

use of com.teamresourceful.resourcefulbees.entity.passive.ResourcefulBee in project ResourcefulBees by Resourceful-Bees.

the class BeeJar method setBeeAngry.

public static void setBeeAngry(Bee beeEntity, Player player) {
    if (beeEntity.isAngry()) {
        beeEntity.setTarget(player);
        if (beeEntity instanceof ResourcefulBee) {
            ResourcefulBee customBee = (ResourcefulBee) beeEntity;
            TraitData traitData = customBee.getTraitData();
            if (traitData.getDamageTypes().stream().anyMatch(damageType -> damageType.getType().equals(TraitConstants.EXPLOSIVE))) {
                customBee.setExplosiveCooldown(60);
            }
        }
    }
}
Also used : ResourcefulBee(com.teamresourceful.resourcefulbees.entity.passive.ResourcefulBee) TraitData(com.teamresourceful.resourcefulbees.api.beedata.traits.TraitData)

Example 2 with ResourcefulBee

use of com.teamresourceful.resourcefulbees.entity.passive.ResourcefulBee in project ResourcefulBees by Resourceful-Bees.

the class RegistryHandler method registerBee.

private static void registerBee(String name, float sizeModifier) {
    final RegistryObject<EntityType<? extends CustomBeeEntity>> customBeeEntity = ENTITY_TYPES.register(name + "_bee", () -> EntityType.Builder.<ResourcefulBee>of((type, world) -> new ResourcefulBee(type, world, name), ModConstants.BEE_MOB_CATEGORY).sized(0.7F * sizeModifier, 0.6F * sizeModifier).build(name + "_bee"));
    ModItems.ITEMS.register(name + "_bee_spawn_egg", () -> new BeeSpawnEggItem(customBeeEntity, 0xffcc33, 0x303030, name, new Item.Properties().tab(ItemGroupResourcefulBees.RESOURCEFUL_BEES)));
    ModEntities.getModBees().put(name, customBeeEntity);
}
Also used : EntityType(net.minecraft.world.entity.EntityType) JsonObject(com.google.gson.JsonObject) Config(com.teamresourceful.resourcefulbees.config.Config) ShearsDispenserBehavior(com.teamresourceful.resourcefulbees.item.dispenser.ShearsDispenserBehavior) Items(net.minecraft.world.item.Items) RegistryObject(net.minecraftforge.fml.RegistryObject) HoneycombType(com.teamresourceful.resourcefulbees.lib.enums.HoneycombType) EntityType(net.minecraft.world.entity.EntityType) CustomBeeEntity(com.teamresourceful.resourcefulbees.entity.passive.CustomBeeEntity) Item(net.minecraft.world.item.Item) HashMap(java.util.HashMap) LiquidBlock(net.minecraft.world.level.block.LiquidBlock) IEventBus(net.minecraftforge.eventbus.api.IEventBus) ForgeFlowingFluid(net.minecraftforge.fluids.ForgeFlowingFluid) JsonOps(com.mojang.serialization.JsonOps) FMLJavaModLoadingContext(net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext) DispenserBlockInvoker(com.teamresourceful.resourcefulbees.mixin.DispenserBlockInvoker) CustomHoneyFluid(com.teamresourceful.resourcefulbees.fluids.CustomHoneyFluid) EntityAttributeCreationEvent(net.minecraftforge.event.entity.EntityAttributeCreationEvent) HoneycombData(com.teamresourceful.resourcefulbees.api.beedata.HoneycombData) HoneyBottleData(com.teamresourceful.resourcefulbees.api.honeydata.HoneyBottleData) MobCategory(net.minecraft.world.entity.MobCategory) Map(java.util.Map) CustomHoneyBottleItem(com.teamresourceful.resourcefulbees.item.CustomHoneyBottleItem) ResourcefulBee(com.teamresourceful.resourcefulbees.entity.passive.ResourcefulBee) SoundEvents(net.minecraft.sounds.SoundEvents) BlockBehaviour(net.minecraft.world.level.block.state.BlockBehaviour) CustomHoneyFluidBlock(com.teamresourceful.resourcefulbees.block.CustomHoneyFluidBlock) ScraperDispenserBehavior(com.teamresourceful.resourcefulbees.item.dispenser.ScraperDispenserBehavior) CustomHoneyBlock(com.teamresourceful.resourcefulbees.block.CustomHoneyBlock) HoneyFluidAttributes(com.teamresourceful.resourcefulbees.fluids.HoneyFluidAttributes) BlockItem(net.minecraft.world.item.BlockItem) HoneycombBlock(com.teamresourceful.resourcefulbees.block.HoneycombBlock) DeferredRegister(net.minecraftforge.registries.DeferredRegister) Material(net.minecraft.world.level.material.Material) Blocks(net.minecraft.world.level.block.Blocks) DispenserBlock(net.minecraft.world.level.block.DispenserBlock) FlowingFluid(net.minecraft.world.level.material.FlowingFluid) CustomHoneyBucketItem(com.teamresourceful.resourcefulbees.item.CustomHoneyBucketItem) BeeSpawnEggItem(com.teamresourceful.resourcefulbees.item.BeeSpawnEggItem) ResourcefulBees(com.teamresourceful.resourcefulbees.ResourcefulBees) Block(net.minecraft.world.level.block.Block) ItemStack(net.minecraft.world.item.ItemStack) HoneycombItem(com.teamresourceful.resourcefulbees.item.HoneycombItem) ForgeRegistries(net.minecraftforge.registries.ForgeRegistries) ModConstants(com.teamresourceful.resourcefulbees.lib.constants.ModConstants) BeeSpawnEggItem(com.teamresourceful.resourcefulbees.item.BeeSpawnEggItem) Item(net.minecraft.world.item.Item) CustomHoneyBottleItem(com.teamresourceful.resourcefulbees.item.CustomHoneyBottleItem) BlockItem(net.minecraft.world.item.BlockItem) CustomHoneyBucketItem(com.teamresourceful.resourcefulbees.item.CustomHoneyBucketItem) BeeSpawnEggItem(com.teamresourceful.resourcefulbees.item.BeeSpawnEggItem) HoneycombItem(com.teamresourceful.resourcefulbees.item.HoneycombItem) CustomBeeEntity(com.teamresourceful.resourcefulbees.entity.passive.CustomBeeEntity) ResourcefulBee(com.teamresourceful.resourcefulbees.entity.passive.ResourcefulBee)

Aggregations

ResourcefulBee (com.teamresourceful.resourcefulbees.entity.passive.ResourcefulBee)2 JsonObject (com.google.gson.JsonObject)1 JsonOps (com.mojang.serialization.JsonOps)1 ResourcefulBees (com.teamresourceful.resourcefulbees.ResourcefulBees)1 HoneycombData (com.teamresourceful.resourcefulbees.api.beedata.HoneycombData)1 TraitData (com.teamresourceful.resourcefulbees.api.beedata.traits.TraitData)1 HoneyBottleData (com.teamresourceful.resourcefulbees.api.honeydata.HoneyBottleData)1 CustomHoneyBlock (com.teamresourceful.resourcefulbees.block.CustomHoneyBlock)1 CustomHoneyFluidBlock (com.teamresourceful.resourcefulbees.block.CustomHoneyFluidBlock)1 HoneycombBlock (com.teamresourceful.resourcefulbees.block.HoneycombBlock)1 Config (com.teamresourceful.resourcefulbees.config.Config)1 CustomBeeEntity (com.teamresourceful.resourcefulbees.entity.passive.CustomBeeEntity)1 CustomHoneyFluid (com.teamresourceful.resourcefulbees.fluids.CustomHoneyFluid)1 HoneyFluidAttributes (com.teamresourceful.resourcefulbees.fluids.HoneyFluidAttributes)1 BeeSpawnEggItem (com.teamresourceful.resourcefulbees.item.BeeSpawnEggItem)1 CustomHoneyBottleItem (com.teamresourceful.resourcefulbees.item.CustomHoneyBottleItem)1 CustomHoneyBucketItem (com.teamresourceful.resourcefulbees.item.CustomHoneyBucketItem)1 HoneycombItem (com.teamresourceful.resourcefulbees.item.HoneycombItem)1 ScraperDispenserBehavior (com.teamresourceful.resourcefulbees.item.dispenser.ScraperDispenserBehavior)1 ShearsDispenserBehavior (com.teamresourceful.resourcefulbees.item.dispenser.ShearsDispenserBehavior)1