Search in sources :

Example 1 with PlantEntry

use of jeresources.entry.PlantEntry in project JustEnoughResources by way2muchnoise.

the class MinecraftCompat method registerVanillaPlants.

private void registerVanillaPlants() {
    // Potato
    PlantDrop potato = new PlantDrop(new ItemStack(Items.POTATO), 1, 4);
    PlantDrop poisonous = new PlantDrop(new ItemStack(Items.POISONOUS_POTATO), 0.02F);
    registerPlant(new PlantEntry((PotatoBlock) Blocks.POTATOES, potato, poisonous));
    // Carrot
    PlantDrop carrot = new PlantDrop(new ItemStack(Items.CARROT), 1, 4);
    registerPlant(new PlantEntry((CarrotBlock) Blocks.CARROTS, carrot));
    // Wheat
    PlantDrop wheat = new PlantDrop(new ItemStack(Items.WHEAT), 1, 1);
    PlantDrop seeds = new PlantDrop(new ItemStack(Items.WHEAT_SEEDS), 0, 3);
    registerPlant(new PlantEntry((CropBlock) Blocks.WHEAT, wheat, seeds));
    // Melon
    PlantDrop melonSlice = new PlantDrop(new ItemStack(Items.MELON_SLICE), 3, 7);
    registerPlant(new PlantEntry((StemBlock) Blocks.MELON_STEM, melonSlice));
    // Pumpkin
    PlantDrop pumpkin = new PlantDrop(new ItemStack(Blocks.PUMPKIN), 1, 1);
    registerPlant(new PlantEntry((StemBlock) Blocks.PUMPKIN_STEM, pumpkin));
    // Beetroot
    PlantDrop beetroot = new PlantDrop(new ItemStack(Items.BEETROOT), 1, 1);
    PlantDrop beetrootSeeds = new PlantDrop(new ItemStack(Items.BEETROOT_SEEDS), 0, 3);
    registerPlant(new PlantEntry((BeetrootBlock) Blocks.BEETROOTS, beetroot, beetrootSeeds));
    // Nether Wart
    PlantDrop netherWartDrop = new PlantDrop(new ItemStack(Items.NETHER_WART), 2, 4);
    PlantEntry netherWartEntry = new PlantEntry((NetherWartBlock) Blocks.NETHER_WART, netherWartDrop);
    netherWartEntry.setSoil(Blocks.SOUL_SAND.defaultBlockState());
    registerPlant(netherWartEntry);
    // Sweet berries
    // Drops 1-2 at age 2, 2-3 at age 3
    PlantDrop sweetBerriesDrop = new PlantDrop(new ItemStack(Items.SWEET_BERRIES), 1, 3);
    PlantEntry sweetBerriesEntry = new PlantEntry((SweetBerryBushBlock) Blocks.SWEET_BERRY_BUSH, sweetBerriesDrop);
    sweetBerriesEntry.setSoil(Blocks.GRASS_BLOCK.defaultBlockState());
    registerPlant(sweetBerriesEntry);
}
Also used : PlantEntry(jeresources.entry.PlantEntry) PlantDrop(jeresources.api.drop.PlantDrop) ItemStack(net.minecraft.world.item.ItemStack)

Example 2 with PlantEntry

use of jeresources.entry.PlantEntry in project JustEnoughResources by way2muchnoise.

the class PlantRegistryImpl method registerWithSoil.

@Override
public void registerWithSoil(ItemStack stack, IPlantable plant, Property<?> ageProperty, BlockState soil, PlantDrop... drops) {
    try {
        PlantEntry entry = new PlantEntry(stack, plant, drops);
        entry.setAgeProperty(ageProperty);
        entry.setSoil(soil);
        registers.add(entry);
    } catch (Exception e) {
        LogHelper.debug("Error while registering plant %s", stack.toString());
    }
}
Also used : PlantEntry(jeresources.entry.PlantEntry)

Example 3 with PlantEntry

use of jeresources.entry.PlantEntry in project JustEnoughResources by way2muchnoise.

the class PlantRegistryImpl method register.

@Override
public void register(ItemStack itemStack, Property<?> ageProperty, PlantDrop... drops) {
    try {
        PlantEntry entry = new PlantEntry(itemStack, drops);
        entry.setAgeProperty(ageProperty);
        registers.add(entry);
    } catch (Exception e) {
        LogHelper.debug("Error while registering plant %s", itemStack.toString());
    }
}
Also used : PlantEntry(jeresources.entry.PlantEntry)

Example 4 with PlantEntry

use of jeresources.entry.PlantEntry in project JustEnoughResources by way2muchnoise.

the class PlantRegistryImpl method register.

@Override
public void register(ItemStack itemStack, BlockState plantState, Property<?> ageProperty, PlantDrop... drops) {
    try {
        PlantEntry entry = new PlantEntry(itemStack, drops);
        entry.setPlantState(plantState);
        entry.setAgeProperty(ageProperty);
        registers.add(entry);
    } catch (Exception e) {
        LogHelper.debug("Error while registering plant %s", itemStack.toString());
    }
}
Also used : PlantEntry(jeresources.entry.PlantEntry)

Example 5 with PlantEntry

use of jeresources.entry.PlantEntry in project JustEnoughResources by way2muchnoise.

the class PlantRegistryImpl method registerWithSoil.

@Override
public void registerWithSoil(ItemStack stack, Property<?> ageProperty, BlockState soil, PlantDrop... drops) {
    try {
        PlantEntry entry = new PlantEntry(stack, drops);
        entry.setAgeProperty(ageProperty);
        entry.setSoil(soil);
        registers.add(entry);
    } catch (Exception e) {
        LogHelper.debug("Error while registering plant %s", stack.toString());
    }
}
Also used : PlantEntry(jeresources.entry.PlantEntry)

Aggregations

PlantEntry (jeresources.entry.PlantEntry)12 PlantDrop (jeresources.api.drop.PlantDrop)1 ItemStack (net.minecraft.world.item.ItemStack)1