I have a map defined as a class attribute
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Predicate;
public class BetterPaths implements ModInitializer {
public static final String MOD_ID = "betterpaths";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
public static Map<BlockState, Pair<Predicate<ItemUsageContext>, Consumer<ItemUsageContext>>> TILLING_ACTIONS; // Here is the Map
@Override
public void onInitialize() {
ModItemGroups.registerItemGroups();
//ModItems.registerModItems();
ModBlocks.registerModBlocks();
TILLING_ACTIONS = // I want to assign to it here
}
I have these 2 key value pairs ready
ModBlocks.GRASS_SLAB.getDefaultState(), Pair.of(HoeItem::canTillFarmland, HoeItem.createTillAction(ModBlocks.FARMLAND_SLAB.getDefaultState())),
ModBlocks.GRASS_SLAB.getDefaultState().with(TYPE, SlabType.TOP), Pair.of(HoeItem::canTillFarmland, HoeItem.createTillAction(ModBlocks.FARMLAND_SLAB.getDefaultState().with(TYPE, SlabType.TOP)))