Class MissingCropGenerator
java.lang.Object
net.darkhax.botanypots.common.impl.command.generator.MissingCropGenerator
- All Implemented Interfaces:
CropGenerator
This crop generator is used as a fallback when none of the other generators have claimed an item. It will generate a
block derived crop for a wide range of blocks in the game such as flowers, seeds, crop blocks, bonemealable blocks,
and corals.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanGenerateCrop(net.minecraft.server.level.ServerLevel level, net.minecraft.world.item.ItemStack stack) Determines if te generator can generate a crop for a specific item.com.google.gson.JsonObjectgenerateData(net.minecraft.server.level.ServerLevel level, net.minecraft.world.item.ItemStack stack) Generates the JSON data for the crop.
-
Constructor Details
-
MissingCropGenerator
public MissingCropGenerator()
-
-
Method Details
-
canGenerateCrop
public boolean canGenerateCrop(net.minecraft.server.level.ServerLevel level, net.minecraft.world.item.ItemStack stack) Description copied from interface:CropGeneratorDetermines if te generator can generate a crop for a specific item. If a generator returns true the item will be considered claimed by the generator and other generators will not be given a chance to generate a crop for the item.- Specified by:
canGenerateCropin interfaceCropGenerator- Parameters:
level- The current world level. Used to provide context like registry access and the recipe manager.stack- The item to test.- Returns:
- If the generator can generate a crop for the provided item.
-
generateData
public com.google.gson.JsonObject generateData(net.minecraft.server.level.ServerLevel level, net.minecraft.world.item.ItemStack stack) Description copied from interface:CropGeneratorGenerates the JSON data for the crop.- Specified by:
generateDatain interfaceCropGenerator- Parameters:
level- The current world level. Used to provide context like registry access and the recipe manager.stack- The item to test.- Returns:
- The JSON representation of the crop. The produced data must be a valid JSON representation that can be parsed by a registered recipe serializer.
-