Search in sources :

Example 1 with BeeSpawnEggItem

use of com.teamresourceful.resourcefulbees.item.BeeSpawnEggItem in project ResourcefulBees by Resourceful-Bees.

the class ItemMutationPage method mouseClick.

@Override
public boolean mouseClick(int xPos, int yPos, int mouseX, int mouseY) {
    if (super.mouseClick(xPos, yPos, mouseX, mouseY))
        return true;
    Item output = outputs.get(outputCounter).getRight().getItem();
    if (output instanceof BeeSpawnEggItem) {
        BeeSpawnEggItem beeEgg = (BeeSpawnEggItem) output;
        if (BeepediaScreen.mouseHovering((float) xPos + 112, (float) yPos + 27, 30, 30, mouseX, mouseY)) {
            if (BeepediaScreen.currScreenState.getPageID().equals((beeEgg.getBeeData().toString())))
                return false;
            // // THESE TO STRING CALLS NEED TO BE FIXED AFTER TESTING - DONT FORGET!
            BeepediaScreen.saveScreenState();
            beepedia.setActive(BeepediaScreen.PageType.BEE, beeEgg.getBeeData().toString());
            return true;
        }
    }
    return false;
}
Also used : Item(net.minecraft.world.item.Item) BeeSpawnEggItem(com.teamresourceful.resourcefulbees.item.BeeSpawnEggItem) BeeSpawnEggItem(com.teamresourceful.resourcefulbees.item.BeeSpawnEggItem)

Example 2 with BeeSpawnEggItem

use of com.teamresourceful.resourcefulbees.item.BeeSpawnEggItem 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

BeeSpawnEggItem (com.teamresourceful.resourcefulbees.item.BeeSpawnEggItem)2 Item (net.minecraft.world.item.Item)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 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 ResourcefulBee (com.teamresourceful.resourcefulbees.entity.passive.ResourcefulBee)1 CustomHoneyFluid (com.teamresourceful.resourcefulbees.fluids.CustomHoneyFluid)1 HoneyFluidAttributes (com.teamresourceful.resourcefulbees.fluids.HoneyFluidAttributes)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