Closed Dakotaa closed 1 year ago
I don't exactly follow, do you mean make an Enum of all crop types (e.g. enum crops {WHEAT, BEETROOT, CARROTS, POTATOES, NETHER_WART, COCOA, SUGAR_CANE, CACTUS}
, make an EnumSet from that, and then make the list of materials from that EnumSet? Or make two EnumSets (one for the ageable crops and one for sugarcane/cactus) from the Enum?
Or something like this?
if (cropMaterials == null) {
EnumSet<XMaterial> ageableCrops = EnumSet.of(XMaterial.WHEAT, XMaterial.BEETROOTS, XMaterial.CARROTS, XMaterial.POTATOES, XMaterial.NETHER_WART, XMaterial.COCOA);
for (XMaterial m : ageableCrops) {
cropMaterials.add(m.parseMaterial());
}
}
I don't exactly follow, do you mean make an Enum of all crop types (e.g.
enum crops {WHEAT, BEETROOT, CARROTS, POTATOES, NETHER_WART, COCOA, SUGAR_CANE, CACTUS}
, make an EnumSet from that, and then make the list of materials from that EnumSet? Or make two EnumSets (one for the ageable crops and one for sugarcane/cactus) from the Enum?
I meant using java.util.EnumSet
in a similar way to:
private static final Set<Material> VALID_CROPS = EnumSet.of(
XMaterial.WHEAT.parseMaterial(),
XMaterial.BEETROOT.parseMaterial()
...
);
This fixes the crop boost upgrade by making it more like one would expect based on the description. It now grows crops by an extra stage, rather than just setting them to fully grown instantly, and works for all ageable crops (wheat, beetroots, carrots, potatoes, netherwart, and cocoa)