Add Health Check data to PatchImplementation.java

This commit is contained in:
Morgan Lewis
2020-12-22 13:41:13 -07:00
parent 0381abddcb
commit 519968f568
2 changed files with 44 additions and 56 deletions

View File

@@ -33,7 +33,7 @@ import net.runelite.client.plugins.timetracking.Tab;
@Getter @Getter
public enum PatchImplementation public enum PatchImplementation
{ {
BELLADONNA(Tab.SPECIAL, "") BELLADONNA(Tab.SPECIAL, "", false)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -71,7 +71,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
MUSHROOM(Tab.SPECIAL, "") MUSHROOM(Tab.SPECIAL, "", false)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -109,7 +109,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
HESPORI(Tab.SPECIAL, "") HESPORI(Tab.SPECIAL, "", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -137,7 +137,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
ALLOTMENT(Tab.ALLOTMENT, "") ALLOTMENT(Tab.ALLOTMENT, "", false)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -470,7 +470,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
HERB(Tab.HERB, "") HERB(Tab.HERB, "", false)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -738,7 +738,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
FLOWER(Tab.FLOWER, "") FLOWER(Tab.FLOWER, "", false)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -1011,7 +1011,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
BUSH(Tab.BUSH, "") BUSH(Tab.BUSH, "", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -1244,7 +1244,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
FRUIT_TREE(Tab.FRUIT_TREE, "") FRUIT_TREE(Tab.FRUIT_TREE, "", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -1527,7 +1527,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
HOPS(Tab.HOPS, "") HOPS(Tab.HOPS, "", false)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -1830,7 +1830,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
TREE(Tab.TREE, "") TREE(Tab.TREE, "", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2113,7 +2113,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
HARDWOOD_TREE(Tab.TREE, "Hardwood Trees") HARDWOOD_TREE(Tab.TREE, "Hardwood Trees", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2196,7 +2196,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
REDWOOD(Tab.TREE, "Redwood Trees") REDWOOD(Tab.TREE, "Redwood Trees", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2244,7 +2244,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
SPIRIT_TREE(Tab.TREE, "Spirit Trees") SPIRIT_TREE(Tab.TREE, "Spirit Trees", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2292,7 +2292,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
ANIMA(Tab.SPECIAL, "") ANIMA(Tab.SPECIAL, "", false)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2339,7 +2339,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
CACTUS(Tab.SPECIAL, "Cactus") CACTUS(Tab.SPECIAL, "Cactus", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2412,7 +2412,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
SEAWEED(Tab.SPECIAL, "Seaweed") SEAWEED(Tab.SPECIAL, "Seaweed", false)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2450,7 +2450,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
CALQUAT(Tab.FRUIT_TREE, "Calquat") CALQUAT(Tab.FRUIT_TREE, "Calquat", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2493,7 +2493,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
CELASTRUS(Tab.FRUIT_TREE, "Celastrus") CELASTRUS(Tab.FRUIT_TREE, "Celastrus", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2551,7 +2551,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
GRAPES(Tab.GRAPE, "") GRAPES(Tab.GRAPE, "", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2576,7 +2576,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
CRYSTAL_TREE(Tab.FRUIT_TREE, "Crystal Tree") CRYSTAL_TREE(Tab.FRUIT_TREE, "Crystal Tree", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2604,7 +2604,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
COMPOST(Tab.SPECIAL, "Compost Bin") COMPOST(Tab.SPECIAL, "Compost Bin", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2677,7 +2677,7 @@ public enum PatchImplementation
return null; return null;
} }
}, },
GIANT_COMPOST(Tab.SPECIAL, "Giant Compost Bin") GIANT_COMPOST(Tab.SPECIAL, "Giant Compost Bin", true)
{ {
@Override @Override
PatchState forVarbitValue(int value) PatchState forVarbitValue(int value)
@@ -2787,4 +2787,6 @@ public enum PatchImplementation
private final Tab tab; private final Tab tab;
private final String name; private final String name;
private final boolean healthCheckRequired;
} }

View File

@@ -65,13 +65,13 @@ public enum Produce
POISON_IVY("Poison ivy", "Poison ivy berries", PatchImplementation.BUSH, ItemID.POISON_IVY_BERRIES, 20, 9, 20, 5), POISON_IVY("Poison ivy", "Poison ivy berries", PatchImplementation.BUSH, ItemID.POISON_IVY_BERRIES, 20, 9, 20, 5),
// Hop crops // Hop crops
BARLEY("Barley", ItemID.BARLEY, 10, 5, 0, 3), BARLEY("Barley", PatchImplementation.HOPS, ItemID.BARLEY, 10, 5, 0, 3),
HAMMERSTONE("Hammerstone", ItemID.HAMMERSTONE_HOPS, 10, 5, 0, 3), HAMMERSTONE("Hammerstone", PatchImplementation.HOPS, ItemID.HAMMERSTONE_HOPS, 10, 5, 0, 3),
ASGARNIAN("Asgarnian", ItemID.ASGARNIAN_HOPS, 10, 6, 0, 3), ASGARNIAN("Asgarnian", PatchImplementation.HOPS, ItemID.ASGARNIAN_HOPS, 10, 6, 0, 3),
JUTE("Jute", ItemID.JUTE_FIBRE, 10, 6, 0, 3), JUTE("Jute", PatchImplementation.HOPS, ItemID.JUTE_FIBRE, 10, 6, 0, 3),
YANILLIAN("Yanillian", ItemID.YANILLIAN_HOPS, 10, 7, 0, 3), YANILLIAN("Yanillian", PatchImplementation.HOPS, ItemID.YANILLIAN_HOPS, 10, 7, 0, 3),
KRANDORIAN("Krandorian", ItemID.KRANDORIAN_HOPS, 10, 8, 0, 3), KRANDORIAN("Krandorian", PatchImplementation.HOPS, ItemID.KRANDORIAN_HOPS, 10, 8, 0, 3),
WILDBLOOD("Wildblood", ItemID.WILDBLOOD_HOPS, 10, 9, 0, 3), WILDBLOOD("Wildblood", PatchImplementation.HOPS, ItemID.WILDBLOOD_HOPS, 10, 9, 0, 3),
// Herb crops // Herb crops
GUAM("Guam", PatchImplementation.HERB, ItemID.GUAM_LEAF, 20, 5, 0, 3), GUAM("Guam", PatchImplementation.HERB, ItemID.GUAM_LEAF, 20, 5, 0, 3),
@@ -113,25 +113,25 @@ public enum Produce
POTATO_CACTUS("Potato cactus", "Potato cacti", PatchImplementation.CACTUS, ItemID.POTATO_CACTUS, 10, 8, 5, 7), POTATO_CACTUS("Potato cactus", "Potato cacti", PatchImplementation.CACTUS, ItemID.POTATO_CACTUS, 10, 8, 5, 7),
// Hardwood // Hardwood
TEAK("Teak", ItemID.TEAK_LOGS, 560, 8), TEAK("Teak", PatchImplementation.HARDWOOD_TREE, ItemID.TEAK_LOGS, 560, 8),
MAHOGANY("Mahogany", ItemID.MAHOGANY_LOGS, 640, 9), MAHOGANY("Mahogany", PatchImplementation.HARDWOOD_TREE, ItemID.MAHOGANY_LOGS, 640, 9),
// Anima // Anima
ATTAS("Attas", NullItemID.NULL_22940, 640, 9), ATTAS("Attas", PatchImplementation.ANIMA, NullItemID.NULL_22940, 640, 9),
IASOR("Iasor", NullItemID.NULL_22939, 640, 9), IASOR("Iasor", PatchImplementation.ANIMA, NullItemID.NULL_22939, 640, 9),
KRONOS("Kronos", NullItemID.NULL_22938, 640, 9), KRONOS("Kronos", PatchImplementation.ANIMA, NullItemID.NULL_22938, 640, 9),
// Special crops // Special crops
SEAWEED("Seaweed", ItemID.GIANT_SEAWEED, 10, 5, 0, 4), SEAWEED("Seaweed", PatchImplementation.SEAWEED, ItemID.GIANT_SEAWEED, 10, 5, 0, 4),
GRAPE("Grape", ItemID.GRAPES, 5, 8, 0, 5), GRAPE("Grape", PatchImplementation.GRAPES, ItemID.GRAPES, 5, 8, 0, 5),
MUSHROOM("Mushroom", ItemID.MUSHROOM, 40, 7, 0, 7), MUSHROOM("Mushroom", PatchImplementation.MUSHROOM, ItemID.MUSHROOM, 40, 7, 0, 7),
BELLADONNA("Belladonna", ItemID.CAVE_NIGHTSHADE, 80, 5), BELLADONNA("Belladonna", PatchImplementation.BELLADONNA, ItemID.CAVE_NIGHTSHADE, 80, 5),
CALQUAT("Calquat", ItemID.CALQUAT_FRUIT, 160, 9, 0, 7), CALQUAT("Calquat", PatchImplementation.CALQUAT, ItemID.CALQUAT_FRUIT, 160, 9, 0, 7),
SPIRIT_TREE("Spirit tree", ItemID.SPIRIT_TREE, 320, 13), SPIRIT_TREE("Spirit tree", PatchImplementation.SPIRIT_TREE, ItemID.SPIRIT_TREE, 320, 13),
CELASTRUS("Celastrus", "Celastrus tree", PatchImplementation.CELASTRUS, ItemID.BATTLESTAFF, 160, 6, 0, 4), CELASTRUS("Celastrus", "Celastrus tree", PatchImplementation.CELASTRUS, ItemID.BATTLESTAFF, 160, 6, 0, 4),
REDWOOD("Redwood", "Redwood tree", PatchImplementation.REDWOOD, ItemID.REDWOOD_LOGS, 640, 11), REDWOOD("Redwood", "Redwood tree", PatchImplementation.REDWOOD, ItemID.REDWOOD_LOGS, 640, 11),
HESPORI("Hespori", NullItemID.NULL_23044, 640, 4, 0, 2), HESPORI("Hespori", PatchImplementation.HESPORI, NullItemID.NULL_23044, 640, 4, 0, 2),
CRYSTAL_TREE("Crystal tree", ItemID.CRYSTAL_SHARDS, 80, 7), CRYSTAL_TREE("Crystal tree", PatchImplementation.CRYSTAL_TREE, ItemID.CRYSTAL_SHARDS, 80, 7),
// Compost bins // Compost bins
EMPTY_COMPOST_BIN("Compost Bin", PatchImplementation.COMPOST, ItemID.COMPOST_BIN, 0, 1, 0, 0), // Dummy produce for the empty state EMPTY_COMPOST_BIN("Compost Bin", PatchImplementation.COMPOST, ItemID.COMPOST_BIN, 0, 1, 0, 0), // Dummy produce for the empty state
@@ -204,20 +204,6 @@ public enum Produce
this(name, name, null, itemID, tickrate, stages, 0, 1); this(name, name, null, itemID, tickrate, stages, 0, 1);
} }
boolean requiresHealthCheck()
{
switch (this.patchImplementation)
{
case BUSH:
case TREE:
case CACTUS:
case REDWOOD:
case CELASTRUS:
return true;
}
return false;
}
@Nullable @Nullable
static Produce getByItemID(int itemId) static Produce getByItemID(int itemId)
{ {