Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package net.runelite.client.plugins.microbot.herbrun;

import lombok.Getter;
import net.runelite.api.gameval.ItemID;

import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

@Getter
public enum AllotmentSeedType {
BEST("Best available", -1, 0),
POTATO("Potato seed", ItemID.POTATO_SEED, 1),
ONION("Onion seed", ItemID.ONION_SEED, 5),
CABBAGE("Cabbage seed", ItemID.CABBAGE_SEED, 7),
TOMATO("Tomato seed", ItemID.TOMATO_SEED, 12),
SWEETCORN("Sweetcorn seed", ItemID.SWEETCORN_SEED, 20),
STRAWBERRY("Strawberry seed", ItemID.STRAWBERRY_SEED, 31),
WATERMELON("Watermelon seed", ItemID.WATERMELON_SEED, 47),
SNAPE_GRASS("Snape grass seed", ItemID.SNAPE_GRASS_SEED, 61);

private final String seedName;
private final int itemId;
private final int levelRequired;

AllotmentSeedType(String seedName, int itemId, int levelRequired) {
this.seedName = seedName;
this.itemId = itemId;
this.levelRequired = levelRequired;
}

public static List<AllotmentSeedType> getPlantableSeeds(int farmingLevel) {
return Arrays.stream(values())
.filter(seed -> seed != BEST && seed.levelRequired <= farmingLevel)
.sorted(Comparator.comparingInt(AllotmentSeedType::getLevelRequired).reversed())
.collect(Collectors.toList());
}

public boolean canPlant(int farmingLevel) {
return this != BEST && farmingLevel >= this.levelRequired;
}

@Override
public String toString() {
return seedName;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package net.runelite.client.plugins.microbot.herbrun;

import lombok.Getter;
import net.runelite.api.gameval.ItemID;

@Getter
public enum FlowerSeedType {
MARIGOLD("Marigold seed", ItemID.MARIGOLD_SEED, 2),
ROSEMARY("Rosemary seed", ItemID.ROSEMARY_SEED, 11),
NASTURTIUM("Nasturtium seed", ItemID.NASTURTIUM_SEED, 24),
WOAD("Woad seed", ItemID.WOAD_SEED, 25),
LIMPWURT("Limpwurt seed", ItemID.LIMPWURT_SEED, 26),
WHITE_LILY("White lily seed", ItemID.WHITE_LILY_SEED, 58);

private final String seedName;
private final int itemId;
private final int levelRequired;

FlowerSeedType(String seedName, int itemId, int levelRequired) {
this.seedName = seedName;
this.itemId = itemId;
this.levelRequired = levelRequired;
}

public boolean canPlant(int farmingLevel) {
return farmingLevel >= this.levelRequired;
}

@Override
public String toString() {
return seedName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -231,4 +231,62 @@ default boolean enableGuild() {
)
String locationSection = "Location";

@ConfigSection(
name = "Allotments",
description = "Allotment patch settings",
position = 4
)
String allotmentSection = "allotments";

@ConfigItem(
keyName = "enableAllotments",
name = "Enable Allotments",
description = "Plant and harvest allotment patches at each location",
section = allotmentSection,
position = 0
)
default boolean enableAllotments() {
return false;
}

@ConfigItem(
keyName = "allotmentSeedType",
name = "Allotment Seed Type",
description = "Choose which allotment seeds to plant (3 seeds per patch)",
section = allotmentSection,
position = 1
)
default AllotmentSeedType allotmentSeedType() {
return AllotmentSeedType.SWEETCORN;
}

@ConfigSection(
name = "Flowers",
description = "Flower patch settings",
position = 5
)
String flowerSection = "flowers";

@ConfigItem(
keyName = "enableFlowers",
name = "Enable Flowers",
description = "Plant and harvest flower patches at each location",
section = flowerSection,
position = 0
)
default boolean enableFlowers() {
return false;
}

@ConfigItem(
keyName = "flowerSeedType",
name = "Flower Seed Type",
description = "Choose which flower seeds to plant (White lily protects all allotments)",
section = flowerSection,
position = 1
)
default FlowerSeedType flowerSeedType() {
return FlowerSeedType.LIMPWURT;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
@Slf4j

public class HerbrunPlugin extends Plugin {
public static final String version = "1.1.1";
public static final String version = "1.2.0";
@Inject
private HerbrunConfig config;

Expand Down
Loading
Loading